voruby 1.1 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/REQUIREMENTS +3 -3
- data/Rakefile.rb +6 -2
- data/lib/voruby/active_votable/active_votable.rb +61 -6
- data/lib/voruby/adql/adql.rb +64 -12
- data/lib/voruby/adql/ext.rb +2 -3
- data/lib/voruby/adql/loader.rb +1 -0
- data/lib/voruby/resources/voresource/voresource_v0_10.rb +7 -2
- data/lib/voruby/services/gestalt/footprint.rb +2 -2
- data/lib/voruby/services/gestalt/wesix.rb +1 -1
- data/lib/voruby/services/resolver/resolver.rb +1 -1
- data/lib/voruby/services/schema/schema.rb +644 -0
- data/lib/voruby/simple/sap.rb +2 -2
- data/lib/voruby/votables/chandra.rb +194 -231
- data/lib/voruby/votables/galex.rb +229 -242
- data/lib/voruby/votables/int.rb +193 -230
- data/lib/voruby/votables/nsa.rb +299 -282
- data/lib/voruby/votables/rexml_votable.rb +1 -1
- data/lib/voruby/votables/sdss.rb +194 -231
- data/lib/voruby/votables/transforms.rb +3 -3
- data/lib/voruby/votables/votable.rb +338 -281
- data/test/active_votable/unittest.rb +18 -4
- data/test/plastic/test.rb +1 -1
- data/test/resources/voresource/unittest_v1_0.rb +2 -2
- data/test/stc/unittest_v1_20.rb +2 -2
- metadata +52 -54
- data/lib/voruby/votables/cnoc.rb +0 -393
- data/lib/voruby/votables/hst.rb +0 -391
- data/lib/voruby/votables/nsar3.rb +0 -410
- data/lib/voruby/votables/xmm.rb +0 -394
@@ -6,7 +6,7 @@ module VORuby
|
|
6
6
|
require 'voruby/votables/rexml_parser'
|
7
7
|
|
8
8
|
# A wrapper around VOTable::VOTable that uses ruby's built in rexml library
|
9
|
-
# to parse XML. Typically one would use
|
9
|
+
# to parse XML. Typically one would use VOTable::TreeParsedVOTable
|
10
10
|
# rather than using this class directly.
|
11
11
|
# rexml_votable = VOTable::RexmlParsedVOTable('my_votable.xml')
|
12
12
|
# votable = rexml_votable.votable
|
data/lib/voruby/votables/sdss.rb
CHANGED
@@ -9,7 +9,7 @@ module VORuby
|
|
9
9
|
|
10
10
|
module VOTable
|
11
11
|
class SDSSVOTable < VOTable
|
12
|
-
|
12
|
+
|
13
13
|
# Our object's contructor
|
14
14
|
# [_votable:_]
|
15
15
|
# The VOTable object
|
@@ -18,7 +18,7 @@ module VORuby
|
|
18
18
|
votable.definitions, votable.coosys, votable.params,
|
19
19
|
votable.info, votable.resources)
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
22
|
# Find a field in SDSS configuration file given a key.
|
23
23
|
# Returns a hash with the field's attributes
|
24
24
|
# [_key_:]
|
@@ -27,7 +27,7 @@ module VORuby
|
|
27
27
|
# fields
|
28
28
|
def find_field_in_conf_file(key)
|
29
29
|
sdss_field = {'id'=> nil, 'name'=> nil, 'ucd'=> nil}
|
30
|
-
|
30
|
+
|
31
31
|
if key != nil
|
32
32
|
SDSS_ARCHIVE_CONFIG.each do |archive|
|
33
33
|
archive['votable_fields'].each do |field|
|
@@ -42,352 +42,315 @@ module VORuby
|
|
42
42
|
end
|
43
43
|
return sdss_field
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
# Find the column number(s) associated with the
|
47
47
|
# VOX:imageAccessReference UCD.
|
48
48
|
# Returns a list of column positions.
|
49
49
|
def image_access_reference_columns()
|
50
50
|
sdss_ucd_access = find_field_in_conf_file('VOX:Image_AccessReference')['ucd']
|
51
|
-
|
51
|
+
|
52
52
|
if find_columns(sdss_ucd_access).first != nil
|
53
53
|
find_columns(sdss_ucd_access).first
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
def image_ra_columns
|
58
58
|
ucd_ra = find_field_in_conf_file('POS_EQ_RA_MAIN')['ucd']
|
59
|
-
|
59
|
+
|
60
60
|
if find_columns(ucd_ra).first != nil
|
61
61
|
find_columns(ucd_ra).first
|
62
62
|
end
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def image_dec_columns
|
66
66
|
ucd_dec = find_field_in_conf_file('POS_EQ_DEC_MAIN')['ucd']
|
67
|
-
|
67
|
+
|
68
68
|
if find_columns(ucd_dec).first != nil
|
69
69
|
find_columns(ucd_dec).first
|
70
70
|
end
|
71
71
|
end
|
72
|
-
|
72
|
+
|
73
73
|
def image_filter_columns
|
74
74
|
#ucd_filter = find_field_in_conf_file('')['ucd']
|
75
|
-
|
75
|
+
|
76
76
|
#if find_columns(ucd_filter).first != nil
|
77
77
|
# find_columns(ucd_filter).first
|
78
78
|
#end
|
79
79
|
end
|
80
|
-
|
80
|
+
|
81
81
|
def image_date_obs_columns
|
82
82
|
#ucd_date_obs = find_field_in_conf_file('')['ucd']
|
83
|
-
|
83
|
+
|
84
84
|
#if find_columns(ucd_date_obs).first != nil
|
85
85
|
# find_columns(ucd_date_obs).first
|
86
86
|
#end
|
87
87
|
end
|
88
|
-
|
88
|
+
|
89
89
|
def image_telescope_columns
|
90
90
|
#ucd_telescope = find_field_in_conf_file('')['ucd']
|
91
|
-
|
91
|
+
|
92
92
|
#if find_columns(ucd_telescope).first != nil
|
93
93
|
# find_columns(ucd_telescope).first
|
94
94
|
#end
|
95
95
|
end
|
96
|
-
|
96
|
+
|
97
97
|
def image_survey_columns
|
98
98
|
ucd_survey = find_field_in_conf_file('VOX:Image_Title')['ucd']
|
99
|
-
|
99
|
+
|
100
100
|
if find_columns(ucd_survey).first != nil
|
101
101
|
find_columns(ucd_survey).first
|
102
102
|
end
|
103
103
|
end
|
104
|
-
|
104
|
+
|
105
105
|
def image_instrument_columns
|
106
106
|
#ucd_instrument = find_field_in_conf_file('')['ucd']
|
107
|
-
|
107
|
+
|
108
108
|
#if find_columns(ucd_instrument).first != nil
|
109
109
|
# find_columns(ucd_instrument).first
|
110
110
|
#end
|
111
111
|
end
|
112
|
-
|
112
|
+
|
113
113
|
def image_sky_columns
|
114
114
|
#ucd_sky = find_field_in_conf_file('')['ucd']
|
115
|
-
|
115
|
+
|
116
116
|
#if find_columns(ucd_sky).first != nil
|
117
117
|
# find_columns(ucd_sky).first
|
118
118
|
#end
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
def image_zeropoint_columns
|
122
122
|
#ucd_zeropoint = find_field_in_conf_file('')['ucd']
|
123
|
-
|
123
|
+
|
124
124
|
#if find_columns(ucd_zeropoint).first != nil
|
125
125
|
# find_columns(ucd_zeropoint).first
|
126
126
|
#end
|
127
127
|
end
|
128
|
-
|
128
|
+
|
129
129
|
def image_seeing_columns
|
130
130
|
#ucd_seeing = find_field_in_conf_file('')['ucd']
|
131
|
-
|
131
|
+
|
132
132
|
#if find_columns(ucd_seeing).first != nil
|
133
133
|
# find_columns(ucd_seeing).first
|
134
134
|
#end
|
135
135
|
end
|
136
|
-
|
136
|
+
|
137
137
|
def image_depth_columns
|
138
138
|
#ucd_depth = find_field_in_conf_file('')['ucd']
|
139
|
-
|
139
|
+
|
140
140
|
#if find_columns(ucd_depth).first != nil
|
141
141
|
# find_columns(ucd_depth).first
|
142
142
|
#end
|
143
143
|
end
|
144
|
-
|
144
|
+
|
145
145
|
def image_exptime_columns
|
146
146
|
#ucd_exptime = find_field_in_conf_file('')['ucd']
|
147
|
-
|
147
|
+
|
148
148
|
#if find_columns(ucd_exptime).first != nil
|
149
149
|
# find_columns(ucd_exptime).first
|
150
150
|
#end
|
151
151
|
end
|
152
|
-
|
153
|
-
# Create headers for HTML table
|
154
|
-
# [
|
155
|
-
# The resource from which to extract the table in question.
|
156
|
-
# [_tbl_:]
|
157
|
-
# The table inside the resource from which to extract the rows in question.
|
158
|
-
# [_infer_add_to_cart_ref_:]
|
159
|
-
#
|
160
|
-
# [_add_to_cart_header_value_:]
|
161
|
-
#
|
162
|
-
# [_infer_access_ref_:]
|
163
|
-
# Link the access reference URL associated with a row.
|
164
|
-
# [_access_ref_header_value_:]
|
165
|
-
# For the access reference column, place this value in the header.
|
166
|
-
# [_access_ref_col_:]
|
152
|
+
|
153
|
+
# Create the headers for HTML table
|
154
|
+
# [_access_ref_index_:]
|
167
155
|
# A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
|
168
|
-
# [
|
169
|
-
#
|
170
|
-
def create_headers(
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
thead = "<thead class=\"#{header_class}\">\n"
|
177
|
-
|
178
|
-
thead << "<tr>\n"
|
179
|
-
if infer_add_to_cart_ref
|
180
|
-
thead << "<th>#{add_to_cart_header_value}</th>\n"
|
181
|
-
headers.push("<a href=\"javascript:void(0);\" onclick=\"siap.addAllRowsToCart('#{id}');\">*</a>")
|
182
|
-
end
|
183
|
-
if infer_access_ref
|
184
|
-
thead << "<th>#{access_ref_header_value}</th>\n"
|
185
|
-
headers.push(' ')
|
156
|
+
# [_options_:]
|
157
|
+
#
|
158
|
+
def create_headers(access_ref_index, options)
|
159
|
+
thead, thead_2row = create_header_cart_links(options)
|
160
|
+
|
161
|
+
if options[:infer_access_ref] and access_ref_index
|
162
|
+
thead << "<th>#{options[:access_ref_header_label]}</th>\n"
|
163
|
+
thead_2row.push(' ')
|
186
164
|
end
|
165
|
+
|
187
166
|
col_count = 0
|
188
|
-
fields(res, tbl).each do |field|
|
167
|
+
fields(options[:res], options[:tbl]).each do |field|
|
189
168
|
field_archive = find_field_in_conf_file(field.ucd.value())
|
190
169
|
field_ucd = field_archive['ucd']
|
191
|
-
if infer_access_ref and col_count ==
|
192
|
-
|
170
|
+
if options[:infer_access_ref] and col_count == access_ref_index
|
171
|
+
thead_2row[1] = field_ucd if field_ucd != 'nil'
|
193
172
|
else
|
194
173
|
thead << "<th>#{field_archive['id']}</th>\n"
|
195
174
|
if field_ucd != 'nil'
|
196
|
-
|
175
|
+
thead_2row.push(field_ucd)
|
197
176
|
else
|
198
|
-
|
177
|
+
thead_2row.push(' ')
|
199
178
|
end
|
200
179
|
end
|
201
180
|
col_count += 1
|
202
181
|
end
|
182
|
+
|
203
183
|
thead << " </tr>\n"
|
204
|
-
|
184
|
+
|
205
185
|
thead << "<tr>\n"
|
206
|
-
|
186
|
+
thead_2row.each do |h|
|
207
187
|
thead << "<th>#{h}</th>\n"
|
208
188
|
end
|
209
189
|
thead << "</tr>\n"
|
210
|
-
|
190
|
+
|
211
191
|
thead << "</thead>"
|
212
|
-
|
192
|
+
|
213
193
|
return thead
|
214
194
|
end
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
195
|
+
|
196
|
+
# Creates the cart parameters
|
197
|
+
# [_cart_params:_]
|
198
|
+
#
|
199
|
+
# [_columns:_]
|
200
|
+
#
|
201
|
+
def create_item_cart_params(cart_params, columns)
|
202
|
+
link_ref_array = []
|
203
|
+
|
204
|
+
cart_params.each do |key, value|
|
205
|
+
link_ref_array.push("#{key}=#{value}")
|
206
|
+
end
|
207
|
+
|
208
|
+
access_ref_index = image_access_reference_columns()
|
209
|
+
link_ref_array.push("resource=#{CGI.escape(columns[access_ref_index].value).to_s}") if access_ref_index
|
210
|
+
ra_index = image_ra_columns()
|
211
|
+
link_ref_array.push("rac=#{columns[ra_index].value.to_s}") if ra_index
|
212
|
+
dec_index = image_dec_columns()
|
213
|
+
link_ref_array.push("decc=#{columns[dec_index].value.to_s}") if dec_index
|
214
|
+
filter_index = image_filter_columns()
|
215
|
+
link_ref_array.push("filter=#{columns[filter_index].value.to_s}") if filter_index
|
216
|
+
date_obs_index = image_date_obs_columns()
|
217
|
+
link_ref_array.push("date_obs=#{columns[date_obs_index].value.to_s}") if date_obs_index
|
218
|
+
teles_index = image_telescope_columns()
|
219
|
+
link_ref_array.push("telescop=#{columns[teles_index].value.to_s}") if teles_index
|
220
|
+
survey_index = image_survey_columns()
|
221
|
+
link_ref_array.push("survey=#{columns[survey_index].value.to_s}") if survey_index
|
222
|
+
instrum_index = image_instrument_columns()
|
223
|
+
link_ref_array.push("instrument=#{columns[instrum_index].value.to_s}") if instrum_index
|
224
|
+
sky_index = image_sky_columns()
|
225
|
+
link_ref_array.push("sky=#{columns[sky_index].value.to_s}") if sky_index
|
226
|
+
zerop_index = image_zeropoint_columns()
|
227
|
+
link_ref_array.push("zeropoint=#{columns[zerop_index].value.to_s}") if zerop_index
|
228
|
+
seeing_index = image_seeing_columns()
|
229
|
+
link_ref_array.push("seeing=#{columns[seeing_index].value.to_s}") if seeing_index
|
230
|
+
depth_index = image_depth_columns()
|
231
|
+
link_ref_array.push("depth=#{columns[depth_index].value.to_s}") if depth_index
|
232
|
+
exptime_index = image_exptime_columns()
|
233
|
+
link_ref_array.push("exptime=#{columns[exptime_index].value.to_s}") if exptime_index
|
234
|
+
|
235
|
+
return link_ref_array.join('&')
|
245
236
|
end
|
246
|
-
|
237
|
+
|
247
238
|
# Create body for HTML table
|
248
|
-
# [
|
249
|
-
# The resource from which to extract the table in question.
|
250
|
-
# [_tbl_:]
|
251
|
-
# The table inside the resource from which to extract the rows in question.
|
252
|
-
# [_infer_add_to_cart_ref_:]
|
253
|
-
#
|
254
|
-
# [_add_to_cart_link_value_:]
|
255
|
-
#
|
256
|
-
# [_add_to_cart_link_ref_:]
|
257
|
-
#
|
258
|
-
# [_infer_access_ref_:]
|
259
|
-
# Link the access reference URL associated with a row.
|
260
|
-
# [_access_ref_link_value_:]
|
261
|
-
# For the access reference column, link this word.
|
262
|
-
# [_access_ref_col_:]
|
239
|
+
# [_access_ref_index_:]
|
263
240
|
# A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
|
264
|
-
# [
|
265
|
-
#
|
266
|
-
|
267
|
-
|
268
|
-
def create_body(res, tbl,
|
269
|
-
infer_add_to_cart_ref, add_to_cart_link_value, add_to_cart_link_ref,
|
270
|
-
infer_access_ref, access_ref_link_value, access_ref_col,
|
271
|
-
body_class, row_classes)
|
272
|
-
|
273
|
-
tbody = "<tbody class=\"#{body_class}\">\n"
|
241
|
+
# [_options_:]
|
242
|
+
#
|
243
|
+
def create_body(access_ref_index, options)
|
244
|
+
tbody = "<tbody class=\"#{options[:body_class]}\" align=\"center\">\n"
|
274
245
|
row_count = 0
|
275
|
-
rows(res, tbl)
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
246
|
+
rows_data = rows(options[:res], options[:tbl])
|
247
|
+
if rows_data
|
248
|
+
rows_data.each do |tr|
|
249
|
+
tbody << "<tr class=\"#{options[:row_classes][row_count % 2]}\">\n"
|
250
|
+
|
251
|
+
# Specially mark up the first column to link to the image.
|
252
|
+
columns = tr.tds()
|
253
|
+
|
254
|
+
if options[:infer_add_to_cart_ref] and access_ref_index
|
255
|
+
tbody << "<td><input type=\"checkbox\" " +
|
256
|
+
"id=\"checkbox_add_#{options[:cart_params][:archive]}_#{row_count.to_s}\" " +
|
257
|
+
"value=\"#{create_item_cart_params(options[:cart_params], columns)}\"/></td>\n"
|
258
|
+
end
|
259
|
+
|
260
|
+
if options[:infer_access_ref] and access_ref_index
|
261
|
+
tbody << "<td><a href=\"#{columns[access_ref_index].value}\">#{options[:access_ref_link_label]}</a></td>\n"
|
262
|
+
end
|
263
|
+
|
264
|
+
col_count = 0
|
265
|
+
#ra_index = image_ra_columns()
|
266
|
+
#dec_index = image_dec_columns()
|
267
|
+
columns.each do |td|
|
268
|
+
if col_count != access_ref_index
|
269
|
+
#if ra_index and col_count == ra_index
|
270
|
+
# tbody << "<td>#{convert_ra_to_degrees(td.value)}</td>\n"
|
271
|
+
#elsif dec_index and col_count == dec_index
|
272
|
+
# tbody << "<td>#{convert_dec_to_degrees(td.value)}</td>\n"
|
273
|
+
#else
|
274
|
+
tbody << "<td>#{td.value}</td>\n"
|
275
|
+
#end
|
276
|
+
end
|
277
|
+
col_count += 1
|
278
|
+
end
|
279
|
+
|
280
|
+
tbody << "</tr>\n"
|
281
|
+
row_count += 1
|
303
282
|
end
|
304
|
-
tbody << "</tr>\n"
|
305
|
-
row_count += 1
|
306
283
|
end
|
307
284
|
tbody << "</tbody>"
|
308
|
-
|
285
|
+
|
309
286
|
return tbody
|
310
287
|
end
|
311
|
-
|
288
|
+
|
312
289
|
# Convert the specified table in the specified resource into an HTML
|
313
290
|
# table.
|
314
|
-
# [
|
315
|
-
# The
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
# The resource from which to extract the table in question.
|
320
|
-
# [_tbl_:]
|
321
|
-
# The table inside the resource from which to extract the rows in question.
|
322
|
-
# [_infer_add_to_cart_ref_:]
|
323
|
-
#
|
324
|
-
# [_add_to_cart_header_value_:]
|
325
|
-
#
|
326
|
-
# [_add_to_cart_link_value_:]
|
327
|
-
#
|
328
|
-
# [_infer_access_ref_:]
|
329
|
-
# Link the access reference URL associated with a row.
|
330
|
-
# [_access_ref_header_value_:]
|
331
|
-
# For the access reference column, place this value in the header.
|
332
|
-
# [_access_ref_link_value_:]
|
333
|
-
# For the access reference column, link this word.
|
334
|
-
# [_show_border_:]
|
335
|
-
# The boolean value to show HTML table border
|
336
|
-
# [_table_class_:]
|
337
|
-
# The class to assign the HTML table as a whole.
|
338
|
-
# [_header_class_:]
|
339
|
-
# The class to assign the header of the HTML table.
|
340
|
-
# [_body_class_:]
|
341
|
-
# The class to assign the body of the HTML table.
|
342
|
-
# [_row_classes_:]
|
343
|
-
# The class to assign the HTML table body rows.
|
344
|
-
def to_html(id=nil, add_to_cart_link_ref=nil, res=0, tbl=0,
|
345
|
-
infer_add_to_cart_ref=true,
|
346
|
-
add_to_cart_header_value='Add to Cart',
|
347
|
-
add_to_cart_link_value='Add',
|
348
|
-
infer_access_ref=true,
|
349
|
-
access_ref_header_value='URL',
|
350
|
-
access_ref_link_value='Retrieve',
|
351
|
-
show_border=false,
|
352
|
-
table_class='votable',
|
353
|
-
header_class='header',
|
354
|
-
body_class='body',
|
355
|
-
row_classes=['row1', 'row2'])
|
356
|
-
begin
|
357
|
-
# A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
|
358
|
-
access_ref_col = image_access_reference_columns()
|
359
|
-
|
360
|
-
if access_ref_col
|
361
|
-
# Create headers
|
362
|
-
thead = create_headers(res, tbl,
|
363
|
-
infer_add_to_cart_ref, add_to_cart_header_value,
|
364
|
-
infer_access_ref, access_ref_header_value, access_ref_col,
|
365
|
-
header_class, id)
|
291
|
+
# [_options_:]
|
292
|
+
# The options for this VOTable.
|
293
|
+
def to_html(options={})
|
294
|
+
# The ID to assign to the HTML table as a whole.
|
295
|
+
options[:id] = options[:id] || "#{votable}_#{Time.now.to_i}_#{rand(10000)}"
|
366
296
|
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
body_class, row_classes)
|
297
|
+
options[:infer_add_to_cart_ref] = true if options[:infer_add_to_cart_ref] == nil
|
298
|
+
options[:add_to_cart_header_label] = options[:add_to_cart_header_label] || 'Add to Cart'
|
299
|
+
options[:cart_params] = {} if options[:cart_params] == nil
|
300
|
+
#options[:add_to_cart_url] = options[:add_to_cart_url] || nil
|
372
301
|
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
302
|
+
options[:throbber_src] = options[:throbber_src] || '/images/general/indicator.gif'
|
303
|
+
options[:throbber_size] = options[:throbber_size] || '16x16'
|
304
|
+
options[:throbber_class] = options[:throbber_class] || 'throbber'
|
305
|
+
options[:throbber_id] = options[:throbber_id] || "#{options[:id]}_throbber_id"
|
306
|
+
|
307
|
+
options[:flash_notice_class] = options[:flash_notice_class] || 'flash_notice'
|
308
|
+
options[:flash_notice_id] = options[:flash_notice_id] || "#{options[:id]}_flash_notice_id"
|
309
|
+
|
310
|
+
# Link the access reference URL associated with a row.
|
311
|
+
options[:infer_access_ref] = true if options[:infer_access_ref] == nil
|
312
|
+
#options[:retrieve_link_ref] = options[:retrieve_link_ref] || nil
|
313
|
+
# For the access reference column, place this value in the header.
|
314
|
+
options[:access_ref_header_label] = options[:access_ref_header_label] || 'URL'
|
315
|
+
# For the access reference column, link this word.
|
316
|
+
options[:access_ref_link_label] = options[:access_ref_link_label] || 'Retrieve'
|
317
|
+
options[:ssl] = false if options[:ssl] == nil
|
318
|
+
#options[:resource_link] = options[:resource_link]
|
319
|
+
|
320
|
+
# The resource from which to extract the table in question.
|
321
|
+
options[:res] = options[:res] || 0
|
322
|
+
# The table inside the resource from which to extract the rows in question.
|
323
|
+
options[:tbl] = options[:tbl] || 0
|
324
|
+
|
325
|
+
# The boolean value to show HTML table border
|
326
|
+
options[:show_border] = false if options[:show_border] == nil
|
327
|
+
# The class to assign the HTML table as a whole.
|
328
|
+
options[:table_class] = options[:table_class] || 'votable'
|
329
|
+
# The class to assign the header of the HTML table.
|
330
|
+
options[:header_class] = options[:header_class] || 'header'
|
331
|
+
# The class to assign the body of the HTML table.
|
332
|
+
options[:body_class] = options[:body_class] || 'body'
|
333
|
+
# The class to assign the HTML table body rows.
|
334
|
+
options[:row_classes] = options[:row_classes] || ['row1', 'row2']
|
335
|
+
|
336
|
+
begin
|
337
|
+
# A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
|
338
|
+
access_ref_index = image_access_reference_columns()
|
339
|
+
|
340
|
+
return create_votable(create_headers(access_ref_index, options),
|
341
|
+
create_body(access_ref_index, options),
|
342
|
+
options)
|
343
|
+
|
381
344
|
rescue Exception => e
|
382
|
-
title = 'Error'
|
383
|
-
message =
|
384
|
-
|
385
|
-
|
345
|
+
title = 'Error...'
|
346
|
+
message = "VORuby error: #{e.message}<br>#{e.backtrace}"
|
347
|
+
message << "<br>#{@resources[0].info[0].text().to_s()}" if @resources[0].info[0]
|
348
|
+
create_message(title, message, options)
|
386
349
|
end
|
387
350
|
end
|
388
|
-
|
351
|
+
|
389
352
|
end
|
390
353
|
end
|
391
|
-
|
354
|
+
|
392
355
|
end
|
393
|
-
end
|
356
|
+
end
|
@@ -207,7 +207,7 @@ module VORuby
|
|
207
207
|
paramrefs = []
|
208
208
|
mparamrefs.each do |mparamref|
|
209
209
|
paramrefs.push(ParamRef.new(
|
210
|
-
|
210
|
+
VOTable::_find_attr_value(mparamref.__xmlattr, 'ref')
|
211
211
|
))
|
212
212
|
end
|
213
213
|
|
@@ -261,10 +261,10 @@ module VORuby
|
|
261
261
|
content_role_txt = VOTable::_find_attr_value(mlink.__xmlattr, 'content-role')
|
262
262
|
|
263
263
|
links.push(Link.new(
|
264
|
-
(href_txt == nil)? nil:
|
264
|
+
(href_txt == nil)? nil: Type::AnyURI.new(href_txt),
|
265
265
|
VOTable::_find_attr_value(mlink.__xmlattr, 'value'),
|
266
266
|
VOTable::_find_attr_value(mlink.__xmlattr, 'title'),
|
267
|
-
(action_txt == nil)? nil:
|
267
|
+
(action_txt == nil)? nil: Type::AnyURI.new(action_txt),
|
268
268
|
VOTable::_find_attr_value(mlink.__xmlattr, 'ID'),
|
269
269
|
VOTable::_find_attr_value(mlink.__xmlattr, 'content-type'),
|
270
270
|
(content_role_txt == nil)? nil: Type::ContentRole.new(content_role_txt),
|