voruby 1.0.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.
Files changed (156) hide show
  1. data/LICENSE +339 -0
  2. data/REQUIREMENTS +4 -0
  3. data/Rakefile.rb +296 -0
  4. data/lib/voruby/adql/adql.rb +2735 -0
  5. data/lib/voruby/adql/ext.rb +15 -0
  6. data/lib/voruby/adql/loader.rb +5 -0
  7. data/lib/voruby/adql/operations.rb +54 -0
  8. data/lib/voruby/adql/parser.rb +160 -0
  9. data/lib/voruby/adql/transforms.rb +573 -0
  10. data/lib/voruby/ext.rb +17 -0
  11. data/lib/voruby/loader.rb +4 -0
  12. data/lib/voruby/misc/propertyfile.rb +36 -0
  13. data/lib/voruby/plastic/applications.rb +174 -0
  14. data/lib/voruby/plastic/constants.rb +30 -0
  15. data/lib/voruby/plastic/loader.rb +10 -0
  16. data/lib/voruby/plastic/plastic.rb +1 -0
  17. data/lib/voruby/resources/conesearch/conesearch.rb +9 -0
  18. data/lib/voruby/resources/conesearch/conesearch_v0_2.rb +55 -0
  19. data/lib/voruby/resources/conesearch/conesearch_v0_3.rb +50 -0
  20. data/lib/voruby/resources/conesearch/conesearch_v1_0.rb +72 -0
  21. data/lib/voruby/resources/conesearch/loader.rb +4 -0
  22. data/lib/voruby/resources/loader.rb +50 -0
  23. data/lib/voruby/resources/nodes.rb +190 -0
  24. data/lib/voruby/resources/openskynode/loader.rb +4 -0
  25. data/lib/voruby/resources/openskynode/openskynode.rb +9 -0
  26. data/lib/voruby/resources/openskynode/openskynode_v0_1.rb +54 -0
  27. data/lib/voruby/resources/sia/loader.rb +5 -0
  28. data/lib/voruby/resources/sia/sia.rb +9 -0
  29. data/lib/voruby/resources/sia/sia_v0_6.rb +90 -0
  30. data/lib/voruby/resources/sia/sia_v0_7.rb +89 -0
  31. data/lib/voruby/resources/sia/sia_v1_0.rb +122 -0
  32. data/lib/voruby/resources/stsci.rb +59 -0
  33. data/lib/voruby/resources/vodataservice/coverage_v0_2.rb +195 -0
  34. data/lib/voruby/resources/vodataservice/coverage_v0_3.rb +158 -0
  35. data/lib/voruby/resources/vodataservice/loader.rb +5 -0
  36. data/lib/voruby/resources/vodataservice/vodataservice.rb +9 -0
  37. data/lib/voruby/resources/vodataservice/vodataservice_v0_4.rb +189 -0
  38. data/lib/voruby/resources/vodataservice/vodataservice_v0_5.rb +163 -0
  39. data/lib/voruby/resources/vodataservice/vodataservice_v1_0.rb +221 -0
  40. data/lib/voruby/resources/voregistry/loader.rb +4 -0
  41. data/lib/voruby/resources/voregistry/voregistry.rb +9 -0
  42. data/lib/voruby/resources/voregistry/voregistry_v0_2.rb +40 -0
  43. data/lib/voruby/resources/voregistry/voregistry_v0_3.rb +30 -0
  44. data/lib/voruby/resources/voregistry/voregistry_v1_0.rb +86 -0
  45. data/lib/voruby/resources/voresource/loader.rb +17 -0
  46. data/lib/voruby/resources/voresource/voresource.rb +9 -0
  47. data/lib/voruby/resources/voresource/voresource_v0_10.rb +322 -0
  48. data/lib/voruby/resources/voresource/voresource_v0_9.rb +405 -0
  49. data/lib/voruby/resources/voresource/voresource_v1_0.rb +230 -0
  50. data/lib/voruby/services/ext.rb +11 -0
  51. data/lib/voruby/services/gestalt/footprint.rb +95 -0
  52. data/lib/voruby/services/gestalt/wcs_fixer.rb +105 -0
  53. data/lib/voruby/services/gestalt/wesix.rb +155 -0
  54. data/lib/voruby/services/loader.rb +7 -0
  55. data/lib/voruby/services/registry/registry.rb +53 -0
  56. data/lib/voruby/services/resolver/resolver.rb +35 -0
  57. data/lib/voruby/sesame/loader.rb +6 -0
  58. data/lib/voruby/sesame/sesame_v1_0.rb +64 -0
  59. data/lib/voruby/simple/loader.rb +6 -0
  60. data/lib/voruby/simple/parameters.rb +196 -0
  61. data/lib/voruby/simple/sap.rb +446 -0
  62. data/lib/voruby/spacetime/loader.rb +3 -0
  63. data/lib/voruby/spacetime/spacetime.rb +607 -0
  64. data/lib/voruby/stc/coords_v1_20.rb +900 -0
  65. data/lib/voruby/stc/loader.rb +55 -0
  66. data/lib/voruby/stc/region_v1_20.rb +274 -0
  67. data/lib/voruby/stc/stc_v1_20.rb +1196 -0
  68. data/lib/voruby/util.rb +27 -0
  69. data/lib/voruby/voevent/loader.rb +7 -0
  70. data/lib/voruby/voevent/voevent_v1_0.rb +213 -0
  71. data/lib/voruby/voevent/voevent_v1_1.rb +196 -0
  72. data/lib/voruby/votables/chandra.rb +410 -0
  73. data/lib/voruby/votables/cnoc.rb +393 -0
  74. data/lib/voruby/votables/data.rb +179 -0
  75. data/lib/voruby/votables/galex.rb +390 -0
  76. data/lib/voruby/votables/hst.rb +391 -0
  77. data/lib/voruby/votables/int.rb +391 -0
  78. data/lib/voruby/votables/libxml_parser.rb +411 -0
  79. data/lib/voruby/votables/libxml_votable.rb +67 -0
  80. data/lib/voruby/votables/loader.rb +10 -0
  81. data/lib/voruby/votables/meta.rb +763 -0
  82. data/lib/voruby/votables/misc.rb +51 -0
  83. data/lib/voruby/votables/nsa.rb +393 -0
  84. data/lib/voruby/votables/nsar3.rb +410 -0
  85. data/lib/voruby/votables/rexml_parser.rb +408 -0
  86. data/lib/voruby/votables/rexml_votable.rb +67 -0
  87. data/lib/voruby/votables/sdss.rb +393 -0
  88. data/lib/voruby/votables/transforms.rb +388 -0
  89. data/lib/voruby/votables/tree.rb +45 -0
  90. data/lib/voruby/votables/types.rb +391 -0
  91. data/lib/voruby/votables/votable.rb +630 -0
  92. data/lib/voruby/votables/xmm.rb +394 -0
  93. data/test/adql/test1.adql +49 -0
  94. data/test/adql/test2.adql +51 -0
  95. data/test/adql/test3.adql +81 -0
  96. data/test/adql/test4.adql +53 -0
  97. data/test/adql/test5.adql +55 -0
  98. data/test/adql/test6.adql +18 -0
  99. data/test/adql/test7.adql +48 -0
  100. data/test/adql/unittest.rb +1672 -0
  101. data/test/plastic/test.rb +44 -0
  102. data/test/plastic/test.vot +5385 -0
  103. data/test/plastic/unittest.rb +66 -0
  104. data/test/resources/conesearch/conesearch_v0_3.xml +31 -0
  105. data/test/resources/conesearch/conesearch_v1_0.xml +86 -0
  106. data/test/resources/conesearch/unittest_v0_3.rb +22 -0
  107. data/test/resources/conesearch/unittest_v1_0.rb +24 -0
  108. data/test/resources/openskynode/open_sky_node_v0_1.xml +32 -0
  109. data/test/resources/openskynode/unittest_v0_1.rb +31 -0
  110. data/test/resources/sia/simple_image_access_v0_7.xml +36 -0
  111. data/test/resources/sia/simple_image_access_v1_0.xml +122 -0
  112. data/test/resources/sia/unittest_v0_7.rb +24 -0
  113. data/test/resources/sia/unittest_v1_0.rb +29 -0
  114. data/test/resources/stsci.xml +336 -0
  115. data/test/resources/unittest_stsci.rb +25 -0
  116. data/test/resources/vodataservice/catalog_service_resource_v1_0.xml +128 -0
  117. data/test/resources/vodataservice/data_collection_resource_v0_5.xml +54 -0
  118. data/test/resources/vodataservice/data_collection_resource_v1_0.xml +117 -0
  119. data/test/resources/vodataservice/data_service_resource_v1_0.xml +115 -0
  120. data/test/resources/vodataservice/sky_service_resource_v0_10.xml +45 -0
  121. data/test/resources/vodataservice/table_service_resource_v1_0.xml +122 -0
  122. data/test/resources/vodataservice/tabular_sky_service_resource_v0_10.xml +60 -0
  123. data/test/resources/vodataservice/unittest_v0_5.rb +126 -0
  124. data/test/resources/vodataservice/unittest_v1_0.rb +151 -0
  125. data/test/resources/voregistry/authority_resource_v0_3.xml +20 -0
  126. data/test/resources/voregistry/authority_resource_v1_0.xml +82 -0
  127. data/test/resources/voregistry/registry_service_v0_3.xml +20 -0
  128. data/test/resources/voregistry/registry_service_v1_0.xml +107 -0
  129. data/test/resources/voregistry/unittest_v0_3.rb +31 -0
  130. data/test/resources/voregistry/unittest_v1_0.rb +34 -0
  131. data/test/resources/voresource/organisation_resource_v1_0.xml +90 -0
  132. data/test/resources/voresource/resource_organisation_v0_10.xml +22 -0
  133. data/test/resources/voresource/resource_service_v0_10.xml +19 -0
  134. data/test/resources/voresource/resource_v0_10.xml +19 -0
  135. data/test/resources/voresource/resource_v1_0.xml +79 -0
  136. data/test/resources/voresource/service_resource_v1_0.xml +91 -0
  137. data/test/resources/voresource/unittest_v0_10.rb +61 -0
  138. data/test/resources/voresource/unittest_v0_9.rb +4 -0
  139. data/test/resources/voresource/unittest_v1_0.rb +190 -0
  140. data/test/services/gestalt/unittest.rb +74 -0
  141. data/test/services/registry/unittest.rb +34 -0
  142. data/test/services/resolver/unittest.rb +38 -0
  143. data/test/simple/unittest.rb +46 -0
  144. data/test/spacetime/unittest.rb +39 -0
  145. data/test/stc/catalog_entry_location_v1_20.xml +112 -0
  146. data/test/stc/obs_data_location_v1_20.xml +108 -0
  147. data/test/stc/search_location_v1_20.xml +54 -0
  148. data/test/stc/stc_resource_profile_v1_20.xml +60 -0
  149. data/test/stc/unittest_v1_20.rb +620 -0
  150. data/test/voevent/unittest_v1_0.rb +79 -0
  151. data/test/voevent/unittest_v1_1.rb +70 -0
  152. data/test/voevent/voevent_v1_0.xml +96 -0
  153. data/test/voevent/voevent_v1_1.xml +76 -0
  154. data/test/votables/test.vot +366 -0
  155. data/test/votables/unittest.rb +54 -0
  156. metadata +256 -0
@@ -0,0 +1,390 @@
1
+ # A set of classes designed to read and manipulate
2
+ # especific VOTables[http://www.ivoa.net/Documents/latest/VOT.html].
3
+ # This class represents a GALEX VOTable.
4
+
5
+ require 'voruby/votables/votable'
6
+
7
+ module VORuby
8
+ module VOTables
9
+ module VOTable
10
+ class GALEXVOTable < VOTable
11
+
12
+ # Our object's contructor
13
+ # [_votable:_]
14
+ # The VOTable object
15
+ def initialize(votable)
16
+ super(votable.id, votable.version, votable.description,
17
+ votable.definitions, votable.coosys, votable.params,
18
+ votable.info, votable.resources)
19
+ end
20
+
21
+ # Find a field in GALEX configuration file given a key.
22
+ # Returns a hash with the field's attributes
23
+ # [_key_:]
24
+ # The key indexing on field's attribute
25
+ def find_field_in_conf_file(key)
26
+ galex_field = {'id'=> nil, 'name'=> nil, 'ucd'=> nil}
27
+
28
+ if key != nil
29
+ GALEX_ARCHIVE_CONFIG.each do |archive|
30
+ archive['votable_fields'].each do |field|
31
+ if field['key'] == key
32
+ galex_field['id'] = field['id'] if field['id'] != 'nil'
33
+ galex_field['name'] = field['name'] if field['name'] != 'nil'
34
+ galex_field['ucd'] = field['ucd'] if field['ucd'] != 'nil'
35
+ break
36
+ end
37
+ end
38
+ end
39
+ end
40
+ return galex_field
41
+ end
42
+
43
+ # Find the column number(s) associated with the
44
+ # VOX:imageAccessReference UCD.
45
+ # Returns a list of column positions.
46
+ def image_access_reference_columns()
47
+ ucd_access = find_field_in_conf_file('VOX:Image_AccessReference')['ucd']
48
+
49
+ if find_columns(ucd_access).first != nil
50
+ find_columns(ucd_access).first
51
+ end
52
+ end
53
+
54
+ def image_ra_columns
55
+ ucd_ra = find_field_in_conf_file('POS_EQ_RA_MAIN')['ucd']
56
+
57
+ if find_columns(ucd_ra).first != nil
58
+ find_columns(ucd_ra).first
59
+ end
60
+ end
61
+
62
+ def image_dec_columns
63
+ ucd_dec = find_field_in_conf_file('POS_EQ_DEC_MAIN')['ucd']
64
+
65
+ if find_columns(ucd_dec).first != nil
66
+ find_columns(ucd_dec).first
67
+ end
68
+ end
69
+
70
+ def image_filter_columns
71
+ ucd_filter = find_field_in_conf_file('VOX:BandPass_ID')['ucd']
72
+
73
+ if find_columns(ucd_filter).first != nil
74
+ find_columns(ucd_filter).first
75
+ end
76
+ end
77
+
78
+ def image_date_obs_columns
79
+ #ucd_date_obs = find_field_in_conf_file('')['ucd']
80
+
81
+ #if find_columns(ucd_date_obs).first != nil
82
+ # find_columns(ucd_date_obs).first
83
+ #end
84
+ end
85
+
86
+ def image_telescope_columns
87
+ #ucd_telescope = find_field_in_conf_file('')['ucd']
88
+
89
+ #if find_columns(ucd_telescope).first != nil
90
+ # find_columns(ucd_telescope).first
91
+ #end
92
+ end
93
+
94
+ def image_survey_columns
95
+ ucd_survey = find_field_in_conf_file('VOX:Image_Title')['ucd']
96
+
97
+ if find_columns(ucd_survey).first != nil
98
+ find_columns(ucd_survey).first
99
+ end
100
+ end
101
+
102
+ def image_instrument_columns
103
+ ucd_instrument = find_field_in_conf_file('VOX:INST_ID')['ucd']
104
+
105
+ if find_columns(ucd_instrument).first != nil
106
+ find_columns(ucd_instrument).first
107
+ end
108
+ end
109
+
110
+ def image_sky_columns
111
+ #ucd_sky = find_field_in_conf_file('')['ucd']
112
+
113
+ #if find_columns(ucd_sky).first != nil
114
+ # find_columns(ucd_sky).first
115
+ #end
116
+ end
117
+
118
+ def image_zeropoint_columns
119
+ #ucd_zeropoint = find_field_in_conf_file('')['ucd']
120
+
121
+ #if find_columns(ucd_zeropoint).first != nil
122
+ # find_columns(ucd_zeropoint).first
123
+ #end
124
+ end
125
+
126
+ def image_seeing_columns
127
+ #ucd_seeing = find_field_in_conf_file('')['ucd']
128
+
129
+ #if find_columns(ucd_seeing).first != nil
130
+ # find_columns(ucd_seeing).first
131
+ #end
132
+ end
133
+
134
+ def image_depth_columns
135
+ #ucd_depth = find_field_in_conf_file('')['ucd']
136
+
137
+ #if find_columns(ucd_depth).first != nil
138
+ # find_columns(ucd_depth).first
139
+ #end
140
+ end
141
+
142
+ def image_exptime_columns
143
+ #ucd_exptime = find_field_in_conf_file('')['ucd']
144
+
145
+ #if find_columns(ucd_exptime).first != nil
146
+ # find_columns(ucd_exptime).first
147
+ #end
148
+ end
149
+
150
+ # Create headers for HTML table
151
+ # [_res_:]
152
+ # The resource from which to extract the table in question.
153
+ # [_tbl_:]
154
+ # The table inside the resource from which to extract the rows in question.
155
+ # [_infer_add_to_cart_ref_:]
156
+ #
157
+ # [_add_to_cart_header_value_:]
158
+ #
159
+ # [_infer_access_ref_:]
160
+ # Link the access reference URL associated with a row.
161
+ # [_access_ref_header_value_:]
162
+ # For the access reference column, place this value in the header.
163
+ # [_access_ref_col_:]
164
+ # A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
165
+ # [_header_class_:]
166
+ # The class to assign the header of the HTML table.
167
+ def create_headers(res, tbl,
168
+ infer_add_to_cart_ref, add_to_cart_header_value,
169
+ infer_access_ref, access_ref_header_value, access_ref_col,
170
+ header_class)
171
+
172
+ headers = Array.new
173
+ thead = "<thead class=\"#{header_class}\">\n"
174
+
175
+ thead << "<tr>\n"
176
+ if infer_add_to_cart_ref
177
+ thead << "<th>#{add_to_cart_header_value}</th>\n"
178
+ headers.push('&nbsp')
179
+ end
180
+ if infer_access_ref
181
+ thead << "<th>#{access_ref_header_value}</th>\n"
182
+ headers.push('&nbsp')
183
+ end
184
+ col_count = 0
185
+ fields(res, tbl).each do |field|
186
+ field_archive = find_field_in_conf_file(field.ucd.value())
187
+ field_ucd = field_archive['ucd']
188
+ if infer_access_ref and col_count == access_ref_col
189
+ headers[1] = field_ucd if field_ucd != 'nil'
190
+ else
191
+ thead << "<th>#{field_archive['name']}</th>\n"
192
+ if field_ucd != 'nil'
193
+ headers.push(field_ucd)
194
+ else
195
+ headers.push('&nbsp')
196
+ end
197
+ end
198
+ col_count += 1
199
+ end
200
+ thead << " </tr>\n"
201
+
202
+ thead << "<tr>\n"
203
+ headers.each do |h|
204
+ thead << "<th>#{h}</th>\n"
205
+ end
206
+ thead << "</tr>\n"
207
+
208
+ thead << "</thead>"
209
+
210
+ return thead
211
+ end
212
+
213
+ def create_add_to_cart_link(link_ref, columns)
214
+ access_ref_col = image_access_reference_columns()
215
+ link_ref << '&resource=' + CGI.escape(columns[access_ref_col].value).to_s if access_ref_col
216
+ ra_col = image_ra_columns()
217
+ link_ref << '&rac=' + columns[ra_col].value.to_s if ra_col
218
+ dec_col = image_dec_columns()
219
+ link_ref << '&decc=' + columns[dec_col].value.to_s if dec_col
220
+ filter_col = image_filter_columns()
221
+ link_ref << '&filter=' + columns[filter_col].value.to_s if filter_col
222
+ date_obs_col = image_date_obs_columns()
223
+ link_ref << '&date_obs=' + columns[date_obs_col].value.to_s if date_obs_col
224
+ teles_col = image_telescope_columns()
225
+ link_ref << '&telescop=' + columns[teles_col].value.to_s if teles_col
226
+ survey_col = image_survey_columns()
227
+ link_ref << '&survey=' + columns[survey_col].value.to_s if survey_col
228
+ instrum_col = image_instrument_columns()
229
+ link_ref << '&instrument=' + columns[instrum_col].value.to_s if instrum_col
230
+ sky_col = image_sky_columns()
231
+ link_ref << '&sky=' + columns[sky_col].value.to_s if sky_col
232
+ zerop_col = image_zeropoint_columns()
233
+ link_ref << '&zeropoint=' + columns[zerop_col].value.to_s if zerop_col
234
+ seeing_col = image_seeing_columns()
235
+ link_ref << '&seeing=' + columns[seeing_col].value.to_s if seeing_col
236
+ depth_col = image_depth_columns()
237
+ link_ref << '&depth=' + columns[depth_col].value.to_s if depth_col
238
+ exptime_col = image_exptime_columns()
239
+ link_ref << '&exptime=' + columns[exptime_col].value.to_s if exptime_col
240
+
241
+ return link_ref
242
+ end
243
+
244
+ # Create body for HTML table
245
+ # [_res_:]
246
+ # The resource from which to extract the table in question.
247
+ # [_tbl_:]
248
+ # The table inside the resource from which to extract the rows in question.
249
+ # [_infer_add_to_cart_ref_:]
250
+ #
251
+ # [_add_to_cart_link_value_:]
252
+ #
253
+ # [_add_to_cart_link_ref_:]
254
+ #
255
+ # [_infer_access_ref_:]
256
+ # Link the access reference URL associated with a row.
257
+ # [_access_ref_link_value_:]
258
+ # For the access reference column, link this word.
259
+ # [_access_ref_col_:]
260
+ # A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
261
+ # [_body_class_:]
262
+ # The class to assign the body of the HTML table.
263
+ # [_row_classes_:]
264
+ # The class to assign the HTML table body rows.
265
+ def create_body(res, tbl,
266
+ infer_add_to_cart_ref, add_to_cart_link_value, add_to_cart_link_ref,
267
+ infer_access_ref, access_ref_link_value, access_ref_col,
268
+ body_class, row_classes)
269
+
270
+ tbody = "<tbody class=\"#{body_class}\">\n"
271
+ row_count = 0
272
+ rows(res, tbl).each do |tr|
273
+ tbody << "<tr class=\"#{row_classes[row_count % 2]}\">\n"
274
+
275
+ # Specially mark up the first column to link to the image.
276
+ columns = tr.tds()
277
+
278
+ if infer_add_to_cart_ref
279
+ archive = add_to_cart_link_ref.slice(add_to_cart_link_ref.index('&archive='), add_to_cart_link_ref.length)
280
+ archive = archive.slice('&archive='.length, archive.length)
281
+ archive = archive.slice(0, archive.index('&')) if archive.index('&')
282
+ link_id = 'add_' + archive.to_s + '_' + row_count.to_s
283
+ url = create_add_to_cart_link(add_to_cart_link_ref, columns)
284
+ js = "new Ajax.Request('#{url}', " +
285
+ " {method: 'post', " +
286
+ " onComplete: function(request){Element.hide('#{link_id}');}});"
287
+ tbody << "<td><a id=\"#{link_id}\" href=\"javascript:void(0);\" " +
288
+ "onclick=\"#{js};return false;\"" +
289
+ ">#{add_to_cart_link_value}</a></td>\n"
290
+ end
291
+ if infer_access_ref
292
+ link_ref = columns[access_ref_col].value
293
+ tbody << "<td><a href=\"#{link_ref}\">#{access_ref_link_value}</a></td>\n"
294
+ end
295
+
296
+ col_count = 0
297
+ columns.each do |td|
298
+ tbody << "<td>#{td.value}</td>\n" if infer_access_ref and col_count != access_ref_col
299
+ col_count += 1
300
+ end
301
+ tbody << "</tr>\n"
302
+ row_count += 1
303
+ end
304
+ tbody << "</tbody>"
305
+
306
+ return tbody
307
+ end
308
+
309
+ # Convert the specified table in the specified resource into an HTML
310
+ # table.
311
+ # [_id_:]
312
+ # The ID to assign to the HTML table as a whole.
313
+ # [_add_to_cart_link_ref_:]
314
+ #
315
+ # [_res_:]
316
+ # The resource from which to extract the table in question.
317
+ # [_tbl_:]
318
+ # The table inside the resource from which to extract the rows in question.
319
+ # [_infer_add_to_cart_ref_:]
320
+ #
321
+ # [_add_to_cart_header_value_:]
322
+ #
323
+ # [_add_to_cart_link_value_:]
324
+ #
325
+ # [_infer_access_ref_:]
326
+ # Link the access reference URL associated with a row.
327
+ # [_access_ref_header_value_:]
328
+ # For the access reference column, place this value in the header.
329
+ # [_access_ref_link_value_:]
330
+ # For the access reference column, link this word.
331
+ # [_show_border_:]
332
+ # The boolean value to show HTML table border
333
+ # [_table_class_:]
334
+ # The class to assign the HTML table as a whole.
335
+ # [_header_class_:]
336
+ # The class to assign the header of the HTML table.
337
+ # [_body_class_:]
338
+ # The class to assign the body of the HTML table.
339
+ # [_row_classes_:]
340
+ # The class to assign the HTML table body rows.
341
+ def to_html(id=nil, add_to_cart_link_ref=nil, res=0, tbl=0,
342
+ infer_add_to_cart_ref=true,
343
+ add_to_cart_header_value='Add to Cart',
344
+ add_to_cart_link_value='Add',
345
+ infer_access_ref=true,
346
+ access_ref_header_value='URL',
347
+ access_ref_link_value='Retrieve',
348
+ show_border=false,
349
+ table_class='votable',
350
+ header_class='header',
351
+ body_class='body',
352
+ row_classes=['row1', 'row2'])
353
+ begin
354
+ # A valid SIA VOTable will only ever have one VOX:Image_AccessReference.
355
+ access_ref_col = image_access_reference_columns()
356
+
357
+ if access_ref_col
358
+ # Create headers
359
+ thead = create_headers(res, tbl,
360
+ infer_add_to_cart_ref, add_to_cart_header_value,
361
+ infer_access_ref, access_ref_header_value, access_ref_col,
362
+ header_class)
363
+
364
+ # Create body
365
+ tbody = create_body(res, tbl,
366
+ infer_add_to_cart_ref, add_to_cart_link_value, add_to_cart_link_ref,
367
+ infer_access_ref, access_ref_link_value, access_ref_col,
368
+ body_class, row_classes)
369
+
370
+ return create_table(id, show_border, table_class, thead, tbody)
371
+ else
372
+ title = 'No Data'
373
+ message = 'VOTable not contains data.'
374
+ return create_message_table(table_class, header_class,
375
+ body_class, row_classes, title, message)
376
+ end
377
+
378
+ rescue Exception => e
379
+ title = 'Error'
380
+ message = @resources[0].info[0].text().to_s()
381
+ table = create_message_table(table_class, header_class,
382
+ body_class, row_classes, title, message)
383
+ end
384
+ end
385
+
386
+ end
387
+ end
388
+
389
+ end
390
+ end