adiwg-mdtranslator 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (254) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -7
  3. data/Rakefile +1 -2
  4. data/adiwg-mdtranslator.gemspec +23 -23
  5. data/bin/mdtranslator +187 -155
  6. data/lib/adiwg/mdtranslator.rb +63 -38
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +123 -5
  8. data/lib/adiwg/mdtranslator/internal/module_coordinates.rb +55 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +98 -70
  10. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +13 -11
  11. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_additionalDocumentation.rb +13 -3
  12. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_address.rb +3 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_associatedResource.rb +22 -4
  14. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_boundingBox.rb +3 -1
  15. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_browseGraphic.rb +11 -1
  16. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_citation.rb +28 -9
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedData.rb +49 -0
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_classedDataItem.rb +53 -0
  19. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_contacts.rb +14 -12
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageInfo.rb +83 -0
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_coverageItem.rb +136 -0
  22. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataDictionary.rb +9 -7
  23. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dataQuality.rb +17 -3
  24. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dateTime.rb +3 -1
  25. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_descriptiveKeyword.rb +22 -5
  26. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_dictionaryInfo.rb +18 -3
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_digitalTransferOption.rb +80 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_dimension.rb +81 -0
  29. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionInfo.rb +89 -0
  30. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_distributionOrder.rb +62 -0
  31. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domain.rb +24 -5
  32. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_domainItem.rb +23 -4
  33. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entity.rb +26 -7
  34. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityAttribute.rb +24 -1
  35. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityForeignKey.rb +20 -1
  36. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_entityIndex.rb +20 -1
  37. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_extent.rb +9 -7
  38. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoCoordSystem.rb +3 -1
  39. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geoProperties.rb +9 -7
  40. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_geographicElement.rb +20 -18
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_gridInfo.rb +67 -0
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_imageInfo.rb +119 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_legalConstraint.rb +7 -1
  44. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineString.rb +5 -4
  45. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_lineage.rb +11 -5
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_locale.rb +57 -0
  47. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_mdJson.rb +10 -9
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_medium.rb +73 -0
  49. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadata.rb +14 -12
  50. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataExtension.rb +3 -1
  51. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_metadataInfo.rb +35 -15
  52. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_onlineResource.rb +7 -1
  53. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_phone.rb +3 -1
  54. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_point.rb +5 -4
  55. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_polygon.rb +5 -4
  56. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_processStep.rb +19 -6
  57. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resolution.rb +7 -1
  58. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceFormat.rb +12 -1
  59. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceIdentifier.rb +30 -5
  60. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceInfo.rb +70 -33
  61. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceMaintenance.rb +5 -3
  62. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_resourceSpecificUsage.rb +5 -3
  63. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_responsibleParty.rb +10 -8
  64. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_securityConstraint.rb +3 -1
  65. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/module_sensorInfo.rb +69 -0
  66. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_source.rb +11 -5
  67. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_spatialReference.rb +3 -1
  68. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonClass.rb +3 -1
  69. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_taxonomy.rb +11 -9
  70. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_temporalElement.rb +9 -7
  71. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timeInstant.rb +5 -3
  72. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_timePeriod.rb +6 -4
  73. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_verticalElement.rb +3 -1
  74. data/lib/adiwg/mdtranslator/readers/mdJson/{modules_1.0 → modules_v1}/module_voucher.rb +5 -3
  75. data/lib/adiwg/mdtranslator/readers/mdJson/modules_v1/version.rb +19 -0
  76. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +21 -18
  77. data/lib/adiwg/mdtranslator/version.rb +15 -1
  78. data/lib/adiwg/mdtranslator/writers/html/html_writer.rb +11 -8
  79. data/lib/adiwg/mdtranslator/writers/html/md_html_writer.rb +21 -18
  80. data/lib/adiwg/mdtranslator/writers/html/sections/html_additionalDocumentation.rb +48 -0
  81. data/lib/adiwg/mdtranslator/writers/html/sections/html_associatedResource.rb +73 -0
  82. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +84 -135
  83. data/lib/adiwg/mdtranslator/writers/html/sections/html_citation.rb +18 -8
  84. data/lib/adiwg/mdtranslator/writers/html/sections/html_classedData.rb +50 -0
  85. data/lib/adiwg/mdtranslator/writers/html/sections/html_classedDataItem.rb +50 -0
  86. data/lib/adiwg/mdtranslator/writers/html/sections/html_contact.rb +5 -9
  87. data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageInfo.rb +88 -0
  88. data/lib/adiwg/mdtranslator/writers/html/sections/html_coverageItem.rb +139 -0
  89. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +13 -12
  90. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataLineage.rb +5 -4
  91. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataSource.rb +5 -4
  92. data/lib/adiwg/mdtranslator/writers/html/sections/html_dimension.rb +71 -0
  93. data/lib/adiwg/mdtranslator/writers/html/sections/html_distributor.rb +62 -0
  94. data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +3 -2
  95. data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +5 -4
  96. data/lib/adiwg/mdtranslator/writers/html/sections/html_extent.rb +7 -6
  97. data/lib/adiwg/mdtranslator/writers/html/sections/html_format.rb +7 -1
  98. data/lib/adiwg/mdtranslator/writers/html/sections/html_geographicElement.rb +7 -7
  99. data/lib/adiwg/mdtranslator/writers/html/sections/html_gridInfo.rb +65 -0
  100. data/lib/adiwg/mdtranslator/writers/html/sections/html_head.rb +18 -3
  101. data/lib/adiwg/mdtranslator/writers/html/sections/html_imageInfo.rb +120 -0
  102. data/lib/adiwg/mdtranslator/writers/html/sections/html_inlineCss.css +13 -20
  103. data/lib/adiwg/mdtranslator/writers/html/sections/html_keyword.rb +3 -2
  104. data/lib/adiwg/mdtranslator/writers/html/sections/html_medium.rb +19 -2
  105. data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +22 -9
  106. data/lib/adiwg/mdtranslator/writers/html/sections/html_orderProcess.rb +3 -2
  107. data/lib/adiwg/mdtranslator/writers/html/sections/html_processStep.rb +5 -4
  108. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceContact.rb +3 -2
  109. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceGeneral.rb +25 -14
  110. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceId.rb +30 -3
  111. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +194 -129
  112. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceMaint.rb +3 -2
  113. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceOther.rb +7 -6
  114. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceUsage.rb +3 -2
  115. data/lib/adiwg/mdtranslator/writers/html/sections/html_responsibleParty.rb +3 -2
  116. data/lib/adiwg/mdtranslator/writers/html/sections/html_sensorInfo.rb +66 -0
  117. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +7 -6
  118. data/lib/adiwg/mdtranslator/writers/html/sections/html_temporalElement.rb +7 -6
  119. data/lib/adiwg/mdtranslator/writers/html/sections/html_timeInstant.rb +3 -2
  120. data/lib/adiwg/mdtranslator/writers/html/sections/html_timePeriod.rb +3 -2
  121. data/lib/adiwg/mdtranslator/writers/html/sections/html_transferOption.rb +29 -4
  122. data/lib/adiwg/mdtranslator/writers/html/version.rb +17 -0
  123. data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +17 -16
  124. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_address.rb +12 -8
  125. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +42 -0
  126. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_codelist.rb +8 -3
  127. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_contact.rb +16 -25
  128. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +68 -0
  129. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +39 -0
  130. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +46 -0
  131. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureAttribute.rb +17 -14
  132. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureConstraint.rb +6 -2
  133. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_featureType.rb +16 -12
  134. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_listedValue.rb +9 -18
  135. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_multiplicity.rb +8 -4
  136. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_onlineResource.rb +13 -9
  137. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_responsibleParty.rb +16 -12
  138. data/lib/adiwg/mdtranslator/writers/{iso → iso19110}/classes/class_telephone.rb +9 -5
  139. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +262 -0
  140. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +36 -16
  141. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +14 -0
  142. data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +73 -37
  143. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +116 -0
  144. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_aggregateInformation.rb +13 -9
  145. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_band.rb +165 -0
  146. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_baseUnit.rb +6 -6
  147. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_boundingPolygon.rb +14 -10
  148. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_browseGraphic.rb +9 -5
  149. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_citation.rb +31 -16
  150. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_codelist.rb +56 -0
  151. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +87 -0
  152. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contentInfo.rb +111 -0
  153. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_conventionalUnit.rb +6 -6
  154. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataIdentification.rb +106 -59
  155. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_dataQuality.rb +11 -7
  156. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_date.rb +8 -5
  157. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_definitionUnit.rb +7 -7
  158. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_derivedUnit.rb +6 -6
  159. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_digitalTransferOptions.rb +92 -0
  160. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +68 -0
  161. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distribution.rb +8 -4
  162. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_distributor.rb +44 -22
  163. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_enumerationList.rb +7 -2
  164. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_extent.rb +18 -14
  165. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_format.rb +18 -2
  166. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicBoundingBox.rb +6 -2
  167. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicDescription.rb +8 -4
  168. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_geographicElement.rb +10 -6
  169. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridInfo.rb +80 -0
  170. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_identifier.rb +10 -6
  171. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_imageDescription.rb +157 -0
  172. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_keyword.rb +12 -8
  173. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_legalConstraints.rb +12 -8
  174. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineString.rb +13 -10
  175. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_lineage.rb +14 -10
  176. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +67 -0
  177. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_maintenanceInformation.rb +12 -8
  178. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_medium.rb +30 -9
  179. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_metadataExtension.rb +19 -15
  180. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_multiGeometry.rb +22 -17
  181. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +94 -0
  182. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_point.rb +12 -9
  183. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_polygon.rb +14 -11
  184. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_processStep.rb +12 -9
  185. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeElementDescription.rb +88 -0
  186. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +52 -0
  187. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_resolution.rb +6 -2
  188. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resourceIdentifier.rb +94 -0
  189. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +106 -0
  190. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_securityConstraints.rb +12 -8
  191. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_source.rb +12 -8
  192. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_standardOrderProcess.rb +11 -9
  193. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonClassification.rb +8 -4
  194. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_taxonSystem.rb +18 -14
  195. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_telephone.rb +92 -0
  196. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_temporalExtent.rb +10 -6
  197. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timeInstant.rb +9 -8
  198. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_timePeriod.rb +10 -8
  199. data/lib/adiwg/mdtranslator/writers/{iso/units → iso19115_2/classes}/class_unitsOfMeasure.rb +48 -25
  200. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_usage.rb +11 -7
  201. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_useConstraints.rb +6 -2
  202. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_verticalExtent.rb +6 -2
  203. data/lib/adiwg/mdtranslator/writers/{iso → iso19115_2}/classes/class_vouchers.rb +8 -4
  204. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +32 -19
  205. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +17 -0
  206. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +21 -24
  207. data/test/readers/mdJson/v1/tc_reader_mdjson_additionalDocumentation.rb +116 -0
  208. data/test/readers/mdJson/v1/tc_reader_mdjson_address.rb +111 -0
  209. data/test/readers/mdJson/v1/tc_reader_mdjson_associatedResource.rb +157 -0
  210. data/test/readers/mdJson/v1/tc_reader_mdjson_browseGraphic.rb +119 -0
  211. data/test/readers/mdJson/v1/tc_reader_mdjson_citation.rb +143 -0
  212. data/test/readers/mdJson/v1/tc_reader_mdjson_contact.rb +138 -0
  213. data/test/readers/mdJson/v1/tc_reader_mdjson_dataQuality.rb +111 -0
  214. data/test/readers/mdJson/v1/tc_reader_mdjson_dateTime.rb +159 -0
  215. data/test/readers/mdJson/v1/tc_reader_mdjson_descriptiveKeyword.rb +115 -0
  216. data/test/readers/mdJson/v1/tc_reader_mdjson_dictionaryInfo.rb +121 -0
  217. data/test/readers/mdJson/v1/tc_reader_mdjson_digitalTransferOption.rb +94 -0
  218. data/test/readers/mdJson/v1/tc_reader_mdjson_distributionOrder.rb +103 -0
  219. data/test/readers/mdJson/v1/tc_reader_mdjson_domain.rb +130 -0
  220. data/test/readers/mdJson/v1/tc_reader_mdjson_domainItem.rb +98 -0
  221. data/test/readers/mdJson/v1/tc_reader_mdjson_entity.rb +134 -0
  222. data/test/readers/mdJson/v1/tc_reader_mdjson_entityAttribute.rb +154 -0
  223. data/test/readers/mdJson/v1/tc_reader_mdjson_entityForeignKey.rb +100 -0
  224. data/test/readers/mdJson/v1/tc_reader_mdjson_entityIndex.rb +99 -0
  225. data/test/readers/mdJson/v1/tc_reader_mdjson_legalConstraint.rb +104 -0
  226. data/test/readers/mdJson/v1/tc_reader_mdjson_lineage.rb +117 -0
  227. data/test/readers/mdJson/v1/tc_reader_mdjson_medium.rb +98 -0
  228. data/test/readers/mdJson/v1/tc_reader_mdjson_metadataInfo.rb +141 -0
  229. data/test/readers/mdJson/v1/tc_reader_mdjson_onlineResource.rb +110 -0
  230. data/test/readers/mdJson/v1/tc_reader_mdjson_phone.rb +112 -0
  231. data/test/readers/mdJson/v1/tc_reader_mdjson_processStep.rb +118 -0
  232. data/test/readers/mdJson/v1/tc_reader_mdjson_resolution.rb +77 -0
  233. data/test/readers/mdJson/v1/tc_reader_mdjson_source.rb +117 -0
  234. data/test/readers/mdJson/v1/tc_translation_19110.rb +57 -0
  235. data/test/readers/mdJson/{v1_0/tc_translation.rb → v1/tc_translation_19115_2.rb} +16 -31
  236. data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +22 -15
  237. metadata +219 -140
  238. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_coordinates.rb +0 -63
  239. data/lib/adiwg/mdtranslator/readers/mdJson/modules_1.0/module_distributionInfo.rb +0 -161
  240. data/lib/adiwg/mdtranslator/writers/html/sections/logo150.txt +0 -25
  241. data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +0 -62
  242. data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +0 -74
  243. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +0 -53
  244. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +0 -40
  245. data/test/readers/mdJson/v1_0/tc_reader_mdjson_additionalDocumentation.rb +0 -85
  246. data/test/readers/mdJson/v1_0/tc_reader_mdjson_address.rb +0 -100
  247. data/test/readers/mdJson/v1_0/tc_reader_mdjson_associatedResource.rb +0 -101
  248. data/test/readers/mdJson/v1_0/tc_reader_mdjson_browseGraphic.rb +0 -86
  249. data/test/readers/mdJson/v1_0/tc_reader_mdjson_citation.rb +0 -116
  250. data/test/readers/mdJson/v1_0/tc_reader_mdjson_contact.rb +0 -138
  251. data/test/readers/mdJson/v1_0/tc_reader_mdjson_dictionaryInfo.rb +0 -95
  252. data/test/readers/mdJson/v1_0/tc_reader_mdjson_domain.rb +0 -99
  253. data/test/readers/mdJson/v1_0/tc_reader_mdjson_onlineResource.rb +0 -92
  254. data/test/readers/mdJson/v1_0/tc_reader_mdjson_phone.rb +0 -110
@@ -13,13 +13,15 @@
13
13
  # Stan Smith 2014-05-02 added additional documentation
14
14
  # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
15
15
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
16
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
17
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
16
18
 
17
- require $ReaderNS.readerModule('module_metadataInfo')
18
- require $ReaderNS.readerModule('module_resourceInfo')
19
- require $ReaderNS.readerModule('module_distributionInfo')
20
- require $ReaderNS.readerModule('module_associatedResource')
21
- require $ReaderNS.readerModule('module_additionalDocumentation')
22
- require $ReaderNS.readerModule('module_citation')
19
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_metadataInfo')
20
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_resourceInfo')
21
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_distributionInfo')
22
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_associatedResource')
23
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_additionalDocumentation')
24
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
23
25
 
24
26
  module ADIWG
25
27
  module Mdtranslator
@@ -28,7 +30,7 @@ module ADIWG
28
30
 
29
31
  module Metadata
30
32
 
31
- def self.unpack(hMetadata)
33
+ def self.unpack(hMetadata, responseObj)
32
34
 
33
35
  # instance classes needed in script
34
36
  intMetadataClass = InternalMetadata.new
@@ -37,13 +39,13 @@ module ADIWG
37
39
  # metadata - metadataInfo
38
40
  # metadataInfo needs access to resourceInfo to check taxonomy
39
41
  if hMetadata.has_key?('metadataInfo')
40
- intMetadata[:metadataInfo] = $ReaderNS::MetadataInfo.unpack(hMetadata)
42
+ intMetadata[:metadataInfo] = MetadataInfo.unpack(hMetadata,responseObj)
41
43
  end
42
44
 
43
45
  # metadata - resource identification info
44
46
  if hMetadata.has_key?('resourceInfo')
45
47
  hResourceInfo = hMetadata['resourceInfo']
46
- intMetadata[:resourceInfo] = $ReaderNS::ResourceInfo.unpack(hResourceInfo)
48
+ intMetadata[:resourceInfo] = ResourceInfo.unpack(hResourceInfo, responseObj)
47
49
  end
48
50
 
49
51
  # metadata - distribution info
@@ -51,7 +53,7 @@ module ADIWG
51
53
  aDistributors = hMetadata['distributionInfo']
52
54
  unless aDistributors.empty?
53
55
  aDistributors.each do |hDistributor|
54
- intMetadata[:distributorInfo] << $ReaderNS::DistributionInfo.unpack(hDistributor)
56
+ intMetadata[:distributorInfo] << DistributionInfo.unpack(hDistributor, responseObj)
55
57
  end
56
58
  end
57
59
  end
@@ -61,7 +63,7 @@ module ADIWG
61
63
  aAssocRes = hMetadata['associatedResource']
62
64
  unless aAssocRes.empty?
63
65
  aAssocRes.each do |hAssocRes|
64
- intMetadata[:associatedResources] << $ReaderNS::AssociatedResource.unpack(hAssocRes)
66
+ intMetadata[:associatedResources] << AssociatedResource.unpack(hAssocRes, responseObj)
65
67
  end
66
68
  end
67
69
  end
@@ -71,7 +73,7 @@ module ADIWG
71
73
  aAddDocs = hMetadata['additionalDocumentation']
72
74
  unless aAddDocs.empty?
73
75
  aAddDocs.each do |hAddDoc|
74
- intMetadata[:additionalDocuments] << $ReaderNS::AdditionalDocumentation.unpack(hAddDoc)
76
+ intMetadata[:additionalDocuments] << AdditionalDocumentation.unpack(hAddDoc, responseObj)
75
77
  end
76
78
  end
77
79
  end
@@ -5,6 +5,8 @@
5
5
  # Stan Smith 2013-11-22 original script
6
6
  # Stan Smith 2014-05-15 modified for JSON schema 0.4.0
7
7
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
9
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
8
10
 
9
11
  module ADIWG
10
12
  module Mdtranslator
@@ -13,7 +15,7 @@ module ADIWG
13
15
 
14
16
  module MetadataExtension
15
17
 
16
- def self.addExtensionISObio()
18
+ def self.addExtensionISObio(responseObj)
17
19
 
18
20
  intMetadataClass = InternalMetadata.new
19
21
  intMetaExt = intMetadataClass.newMetadataExtension
@@ -9,13 +9,17 @@
9
9
  # Stan Smith 2014-11-06 removed metadataScope, moved to resourceType under resourceInfo json 0.9.0
10
10
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
11
11
  # Stan Smith 2015-06-12 added support for metadataCharacterSet
12
-
13
- require $ReaderNS.readerModule('module_responsibleParty')
14
- require $ReaderNS.readerModule('module_dateTime')
15
- require $ReaderNS.readerModule('module_resourceMaintenance')
16
- require $ReaderNS.readerModule('module_metadataExtension')
17
- require $ReaderNS.readerModule('module_resourceIdentifier')
18
- require $ReaderNS.readerModule('module_citation')
12
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
13
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
14
+ # Stan Smith 2015-07-28 added support for locale
15
+
16
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')
17
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
18
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_resourceMaintenance')
19
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_metadataExtension')
20
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_resourceIdentifier')
21
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
22
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_locale')
19
23
 
20
24
  module ADIWG
21
25
  module Mdtranslator
@@ -24,7 +28,11 @@ module ADIWG
24
28
 
25
29
  module MetadataInfo
26
30
 
27
- def self.unpack(hMetadata)
31
+ def self.unpack(hMetadata, responseObj)
32
+
33
+ # return nil object if input is empty
34
+ intMetadataInfo = nil
35
+ return if hMetadata.empty?
28
36
 
29
37
  # instance classes needed in script
30
38
  intMetadataClass = InternalMetadata.new
@@ -35,7 +43,7 @@ module ADIWG
35
43
  if hMetadataInfo.has_key?('metadataIdentifier')
36
44
  hMetadataId = hMetadataInfo['metadataIdentifier']
37
45
  unless hMetadataId.empty?
38
- intMetadataInfo[:metadataId] = $ReaderNS::ResourceIdentifier.unpack(hMetadataId)
46
+ intMetadataInfo[:metadataId] = ResourceIdentifier.unpack(hMetadataId, responseObj)
39
47
  end
40
48
  end
41
49
 
@@ -43,7 +51,7 @@ module ADIWG
43
51
  if hMetadataInfo.has_key?('parentMetadata')
44
52
  hParent = hMetadataInfo['parentMetadata']
45
53
  unless hParent.empty?
46
- intMetadataInfo[:parentMetadata] = $ReaderNS::Citation.unpack(hParent)
54
+ intMetadataInfo[:parentMetadata] = Citation.unpack(hParent, responseObj)
47
55
  end
48
56
  end
49
57
 
@@ -52,7 +60,7 @@ module ADIWG
52
60
  aCust = hMetadataInfo['metadataContact']
53
61
  unless aCust.empty?
54
62
  aCust.each do |rParty|
55
- intMetadataInfo[:metadataCustodians] << $ReaderNS::ResponsibleParty.unpack(rParty)
63
+ intMetadataInfo[:metadataCustodians] << ResponsibleParty.unpack(rParty, responseObj)
56
64
  end
57
65
  end
58
66
  end
@@ -61,7 +69,7 @@ module ADIWG
61
69
  if hMetadataInfo.has_key?('metadataCreationDate')
62
70
  s = hMetadataInfo['metadataCreationDate']
63
71
  if s != ''
64
- hDateTime = $ReaderNS::DateTime.unpack(s)
72
+ hDateTime = DateTime.unpack(s, responseObj)
65
73
  hDateTime[:dateType] = 'publication'
66
74
  intMetadataInfo[:metadataCreateDate] = hDateTime
67
75
  end
@@ -71,7 +79,7 @@ module ADIWG
71
79
  if hMetadataInfo.has_key?('metadataLastUpdate')
72
80
  s = hMetadataInfo['metadataLastUpdate']
73
81
  if s != ''
74
- hDateTime = $ReaderNS::DateTime.unpack(s)
82
+ hDateTime = DateTime.unpack(s, responseObj)
75
83
  hDateTime[:dateType] = 'revision'
76
84
  intMetadataInfo[:metadataUpdateDate] = hDateTime
77
85
  end
@@ -82,6 +90,18 @@ module ADIWG
82
90
  s = hMetadataInfo['metadataCharacterSet']
83
91
  if s != ''
84
92
  intMetadataInfo[:metadataCharacterSet] = s
93
+ else
94
+ intMetadataInfo[:metadataCharacterSet] = 'utf8'
95
+ end
96
+ end
97
+
98
+ # metadata - locale
99
+ if hMetadataInfo.has_key?('metadataLocale')
100
+ aLocale = hMetadataInfo['metadataLocale']
101
+ unless aLocale.empty?
102
+ aLocale.each do |hLocale|
103
+ intMetadataInfo[:metadataLocales] << Locale.unpack(hLocale, responseObj)
104
+ end
85
105
  end
86
106
  end
87
107
 
@@ -105,7 +125,7 @@ module ADIWG
105
125
  if hMetadataInfo.has_key?('metadataMaintenance')
106
126
  hMetaMaint = hMetadataInfo['metadataMaintenance']
107
127
  unless hMetaMaint.empty?
108
- intMetadataInfo[:maintInfo] = $ReaderNS::ResourceMaintenance.unpack(hMetaMaint)
128
+ intMetadataInfo[:maintInfo] = ResourceMaintenance.unpack(hMetaMaint, responseObj)
109
129
  end
110
130
  end
111
131
 
@@ -115,7 +135,7 @@ module ADIWG
115
135
  if resourceInfo.has_key?('taxonomy')
116
136
  hTaxonomy = resourceInfo['taxonomy']
117
137
  unless hTaxonomy.empty?
118
- intMetadataInfo[:extensions] << $ReaderNS::MetadataExtension.addExtensionISObio
138
+ intMetadataInfo[:extensions] << MetadataExtension.addExtensionISObio(responseObj)
119
139
  end
120
140
  end
121
141
  end
@@ -8,6 +8,8 @@
8
8
  # Stan Smith 2014-08-21 changed url to uri for json 0.6.0
9
9
  # Stan Smith 2014-12-10 changed to return nil intOlRes if input empty
10
10
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
11
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
12
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
11
13
 
12
14
  module ADIWG
13
15
  module Mdtranslator
@@ -16,7 +18,7 @@ module ADIWG
16
18
 
17
19
  module OnlineResource
18
20
 
19
- def self.unpack(hOlResource)
21
+ def self.unpack(hOlResource, responseObj)
20
22
 
21
23
  # return nil object if input is empty
22
24
  intOLRes = nil
@@ -32,6 +34,10 @@ module ADIWG
32
34
  s = hOlResource['uri']
33
35
  if s != ''
34
36
  intOLRes[:olResURI] = s
37
+ else
38
+ responseObj[:readerExecutionMessages] << 'Online Resource URI is missing'
39
+ responseObj[:readerExecutionPass] = false
40
+ return nil
35
41
  end
36
42
  end
37
43
 
@@ -6,6 +6,8 @@
6
6
  # Stan Smith 2014-05-14 combine phone service types
7
7
  # Stan Smith 2014-12-09 return empty phone object if no phone number
8
8
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
9
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
10
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
9
11
 
10
12
  module ADIWG
11
13
  module Mdtranslator
@@ -14,7 +16,7 @@ module ADIWG
14
16
 
15
17
  module Phone
16
18
 
17
- def self.unpack(hPhone)
19
+ def self.unpack(hPhone, responseObj)
18
20
 
19
21
  # instance classes needed in script
20
22
  intMetadataClass = InternalMetadata.new
@@ -7,8 +7,9 @@
7
7
  # Stan Smith 2014-04-30 reorganized for json schema 0.3.0
8
8
  # Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
9
9
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
10
-
11
- require $ReaderNS.readerModule('module_coordinates')
10
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
11
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
12
+ # Stan Smith 2015-07-16 moved module_coordinates from mdJson reader to internal
12
13
 
13
14
  module ADIWG
14
15
  module Mdtranslator
@@ -17,13 +18,13 @@ module ADIWG
17
18
 
18
19
  module Point
19
20
 
20
- def self.unpack(aCoords, geoType)
21
+ def self.unpack(aCoords, geoType, responseObj)
21
22
  intMetadataClass = InternalMetadata.new
22
23
  intPoint = intMetadataClass.newGeometry
23
24
 
24
25
  intPoint[:geoType] = geoType
25
26
  intPoint[:geometry] = aCoords
26
- intPoint[:dimension] = $ReaderNS::Coordinates.getDimension(aCoords)
27
+ intPoint[:dimension] = AdiwgCoordinates.getDimension(aCoords)
27
28
 
28
29
  return intPoint
29
30
  end
@@ -8,8 +8,9 @@
8
8
  # Stan Smith 2014-05-23 modified to handle MultiPolygon objects
9
9
  # Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
10
10
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
11
-
12
- require $ReaderNS.readerModule('module_coordinates')
11
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
12
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
13
+ # Stan Smith 2015-07-16 moved module_coordinates from mdJson reader to internal
13
14
 
14
15
  module ADIWG
15
16
  module Mdtranslator
@@ -18,7 +19,7 @@ module ADIWG
18
19
 
19
20
  module Polygon
20
21
 
21
- def self.unpack(aCoords, geoType)
22
+ def self.unpack(aCoords, geoType, responseObj)
22
23
  intMetadataClass = InternalMetadata.new
23
24
  intGeometry = intMetadataClass.newGeometry
24
25
  intGeometry[:geoType] = geoType
@@ -26,7 +27,7 @@ module ADIWG
26
27
  # polygon - coordinate(s)
27
28
  if geoType == 'Polygon'
28
29
  intGeometry[:geometry] = splitPolygons(aCoords)
29
- intGeometry[:dimension] = $ReaderNS::Coordinates.getDimension(intGeometry[:geometry][:exteriorRing])
30
+ intGeometry[:dimension] = AdiwgCoordinates.getDimension(intGeometry[:geometry][:exteriorRing])
30
31
  elsif geoType == 'MultiPolygon'
31
32
  aPolySets = Array.new
32
33
  aCoords.each do |aPolygonSet|
@@ -5,9 +5,10 @@
5
5
  # Stan Smith 2013-11-26 original script
6
6
  # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
7
7
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
8
9
 
9
- require $ReaderNS.readerModule('module_responsibleParty')
10
- require $ReaderNS.readerModule('module_dateTime')
10
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')
11
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
11
12
 
12
13
  module ADIWG
13
14
  module Mdtranslator
@@ -16,7 +17,11 @@ module ADIWG
16
17
 
17
18
  module ProcessStep
18
19
 
19
- def self.unpack(hProcStep)
20
+ def self.unpack(hProcStep, responseObj)
21
+
22
+ # return nil object if input is empty
23
+ intDataPStep = nil
24
+ return if hProcStep.empty?
20
25
 
21
26
  # instance classes needed in script
22
27
  intMetadataClass = InternalMetadata.new
@@ -30,12 +35,20 @@ module ADIWG
30
35
  end
31
36
  end
32
37
 
33
- # process step - description
38
+ # process step - description - required
34
39
  if hProcStep.has_key?('description')
35
40
  s = hProcStep['description']
36
41
  if s != ''
37
42
  intDataPStep[:stepDescription] = s
43
+ else
44
+ responseObj[:readerExecutionMessages] << 'Process step description is empty'
45
+ responseObj[:readerExecutionPass] = false
46
+ return nil
38
47
  end
48
+ else
49
+ responseObj[:readerExecutionMessages] << 'Process step description is missing'
50
+ responseObj[:readerExecutionPass] = false
51
+ return nil
39
52
  end
40
53
 
41
54
  # process step - rationale
@@ -50,7 +63,7 @@ module ADIWG
50
63
  if hProcStep.has_key?('dateTime')
51
64
  s = hProcStep['dateTime']
52
65
  if s != ''
53
- intDataPStep[:stepDateTime] = $ReaderNS::DateTime.unpack(s)
66
+ intDataPStep[:stepDateTime] = DateTime.unpack(s, responseObj)
54
67
  end
55
68
  end
56
69
 
@@ -59,7 +72,7 @@ module ADIWG
59
72
  aProcessors = hProcStep['processor']
60
73
  unless aProcessors.empty?
61
74
  aProcessors.each do |processor|
62
- intDataPStep[:stepProcessors] << $ReaderNS::ResponsibleParty.unpack(processor)
75
+ intDataPStep[:stepProcessors] << ResponsibleParty.unpack(processor, responseObj)
63
76
  end
64
77
  end
65
78
  end
@@ -4,6 +4,8 @@
4
4
  # History:
5
5
  # Stan Smith 2013-11-26 original script
6
6
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
7
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
8
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
7
9
 
8
10
  module ADIWG
9
11
  module Mdtranslator
@@ -12,7 +14,11 @@ module ADIWG
12
14
 
13
15
  module Resolution
14
16
 
15
- def self.unpack(hResolution)
17
+ def self.unpack(hResolution, responseObj)
18
+
19
+ # return nil object if input is empty
20
+ intResolution = nil
21
+ return if hResolution.empty?
16
22
 
17
23
  # instance classes needed in script
18
24
  intMetadataClass = InternalMetadata.new
@@ -5,6 +5,9 @@
5
5
  # Stan Smith 2013-08-26 original script
6
6
  # Stan Smith 2013-11-27 modified to process single resource format rather than array
7
7
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
9
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
10
+ # Stan Smith 2015-09-21 added compression method element
8
11
 
9
12
  module ADIWG
10
13
  module Mdtranslator
@@ -13,7 +16,7 @@ module ADIWG
13
16
 
14
17
  module ResourceFormat
15
18
 
16
- def self.unpack(hResFormat)
19
+ def self.unpack(hResFormat, responseObj)
17
20
 
18
21
  # instance classes needed in script
19
22
  intMetadataClass = InternalMetadata.new
@@ -35,6 +38,14 @@ module ADIWG
35
38
  end
36
39
  end
37
40
 
41
+ # format - compression method
42
+ if hResFormat.has_key?('compressionMethod')
43
+ s = hResFormat['compressionMethod']
44
+ if s != ''
45
+ rFormat[:compressionMethod] = s
46
+ end
47
+ end
48
+
38
49
  return rFormat
39
50
  end
40
51
 
@@ -6,10 +6,11 @@
6
6
  # Stan Smith 2014-07-03 resolve require statements using Mdtranslator.reader_module
7
7
  # Stan Smith 2014-08-18 added type to identifier schema 0.6.0
8
8
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
9
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
10
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
11
+ # Stan Smith 2015-07-31 added support for fields added by ISO 19115-1 (RS_Identifier)
9
12
 
10
- require $ReaderNS.readerModule('module_citation')
11
- require $ReaderNS.readerModule('module_responsibleParty')
12
- require $ReaderNS.readerModule('module_onlineResource')
13
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
13
14
 
14
15
  module ADIWG
15
16
  module Mdtranslator
@@ -18,7 +19,7 @@ module ADIWG
18
19
 
19
20
  module ResourceIdentifier
20
21
 
21
- def self.unpack(hResID)
22
+ def self.unpack(hResID, responseObj)
22
23
 
23
24
  # instance classes needed in script
24
25
  intMetadataClass = InternalMetadata.new
@@ -40,11 +41,35 @@ module ADIWG
40
41
  end
41
42
  end
42
43
 
44
+ # resource identifier - namespace
45
+ if hResID.has_key?('namespace')
46
+ s = hResID['namespace']
47
+ if s != ''
48
+ intResID[:identifierNamespace] = s
49
+ end
50
+ end
51
+
52
+ # resource identifier - version
53
+ if hResID.has_key?('version')
54
+ s = hResID['version']
55
+ if s != ''
56
+ intResID[:identifierVersion] = s
57
+ end
58
+ end
59
+
60
+ # resource identifier - description
61
+ if hResID.has_key?('description')
62
+ s = hResID['description']
63
+ if s != ''
64
+ intResID[:identifierDescription] = s
65
+ end
66
+ end
67
+
43
68
  # resource identifier - authority (expressed as a citation)
44
69
  if hResID.has_key?('authority')
45
70
  hCitation = hResID['authority']
46
71
  unless hCitation.empty?
47
- intResID[:identifierCitation] = $ReaderNS::Citation.unpack(hCitation)
72
+ intResID[:identifierCitation] = Citation.unpack(hCitation, responseObj)
48
73
  end
49
74
  end
50
75