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
@@ -4,6 +4,8 @@
4
4
  # History:
5
5
  # Stan Smith 2014-09-03 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,7 @@ module ADIWG
12
14
 
13
15
  module SpatialReferenceSystem
14
16
 
15
- def self.unpack(hSpatialRef)
17
+ def self.unpack(hSpatialRef, responseObj)
16
18
 
17
19
  # instance classes needed in script
18
20
  intMetadataClass = InternalMetadata.new
@@ -4,6 +4,8 @@
4
4
  # History:
5
5
  # Stan Smith 2013-11-21 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,7 @@ module ADIWG
12
14
 
13
15
  module TaxonCl
14
16
 
15
- def self.unpack(hTaxClass)
17
+ def self.unpack(hTaxClass, responseObj)
16
18
 
17
19
  # instance classes needed in script
18
20
  intMetadataClass = InternalMetadata.new
@@ -7,11 +7,13 @@
7
7
  # Stan Smith 2014-05-02 fixed assignment problem with taxonomic procedures
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
+ # 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
10
12
 
11
- require $ReaderNS.readerModule('module_citation')
12
- require $ReaderNS.readerModule('module_responsibleParty')
13
- require $ReaderNS.readerModule('module_voucher')
14
- require $ReaderNS.readerModule('module_taxonClass')
13
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_citation')
14
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')
15
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_voucher')
16
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_taxonClass')
15
17
 
16
18
  module ADIWG
17
19
  module Mdtranslator
@@ -20,7 +22,7 @@ module ADIWG
20
22
 
21
23
  module Taxonomy
22
24
 
23
- def self.unpack(hTaxonomy)
25
+ def self.unpack(hTaxonomy, responseObj)
24
26
 
25
27
  # instance classes needed in script
26
28
  intMetadataClass = InternalMetadata.new
@@ -31,7 +33,7 @@ module ADIWG
31
33
  aClassSys = hTaxonomy['classificationSystem']
32
34
  unless aClassSys.empty?
33
35
  aClassSys.each do |hCitation|
34
- intTaxSys[:taxClassSys] << $ReaderNS::Citation.unpack(hCitation)
36
+ intTaxSys[:taxClassSys] << Citation.unpack(hCitation, responseObj)
35
37
  end
36
38
  end
37
39
  end
@@ -52,7 +54,7 @@ module ADIWG
52
54
  aObservers = hTaxonomy['observer']
53
55
  unless aObservers.empty?
54
56
  aObservers.each do |observer|
55
- intTaxSys[:taxObservers] << $ReaderNS::ResponsibleParty.unpack(observer)
57
+ intTaxSys[:taxObservers] << ResponsibleParty.unpack(observer, responseObj)
56
58
  end
57
59
  end
58
60
  end
@@ -69,7 +71,7 @@ module ADIWG
69
71
  if hTaxonomy.has_key?('voucher')
70
72
  hVoucher = hTaxonomy['voucher']
71
73
  unless hVoucher.empty?
72
- intTaxSys[:taxVoucher] = $ReaderNS::Voucher.unpack(hVoucher)
74
+ intTaxSys[:taxVoucher] = Voucher.unpack(hVoucher, responseObj)
73
75
  end
74
76
  end
75
77
 
@@ -78,7 +80,7 @@ module ADIWG
78
80
  aTaxClass = hTaxonomy['taxonClass']
79
81
  unless aTaxClass.empty?
80
82
  aTaxClass.each do |hTaxClass|
81
- intTaxSys[:taxClasses] << $ReaderNS::TaxonCl.unpack(hTaxClass)
83
+ intTaxSys[:taxClasses] << TaxonCl.unpack(hTaxClass, responseObj)
82
84
  end
83
85
  end
84
86
  end
@@ -11,10 +11,12 @@
11
11
  # Stan Smith 2013-12-11 modified to handle single temporal element
12
12
  # Stan Smith 2014-07-07 resolve require statements using Mdtranslator.reader_module
13
13
  # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
14
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
15
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
14
16
 
15
- require $ReaderNS.readerModule('module_dateTime')
16
- require $ReaderNS.readerModule('module_timeInstant')
17
- require $ReaderNS.readerModule('module_timePeriod')
17
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
18
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_timeInstant')
19
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_timePeriod')
18
20
 
19
21
  module ADIWG
20
22
  module Mdtranslator
@@ -23,7 +25,7 @@ module ADIWG
23
25
 
24
26
  module TemporalElement
25
27
 
26
- def self.unpack(hTempElement)
28
+ def self.unpack(hTempElement, responseObj)
27
29
 
28
30
  # instance classes needed in script
29
31
  intMetadataClass = InternalMetadata.new
@@ -35,7 +37,7 @@ module ADIWG
35
37
  unless aDates.empty?
36
38
  aDates.each do |s|
37
39
  intTempEle = intMetadataClass.newTemporalElement
38
- intTempEle[:date] = $ReaderNS::DateTime.unpack(s)
40
+ intTempEle[:date] = DateTime.unpack(s, responseObj)
39
41
  aIntTempElements << intTempEle
40
42
  end
41
43
  end
@@ -50,7 +52,7 @@ module ADIWG
50
52
  s = hTimeInst['timePosition']
51
53
  if s != ''
52
54
  intTempEle = intMetadataClass.newTemporalElement
53
- intTempEle[:timeInstant] = $ReaderNS::TimeInstant.unpack(hTimeInst)
55
+ intTempEle[:timeInstant] = TimeInstant.unpack(hTimeInst, responseObj)
54
56
  aIntTempElements << intTempEle
55
57
  end
56
58
  end
@@ -64,7 +66,7 @@ module ADIWG
64
66
  unless aTimePeriod.empty?
65
67
  aTimePeriod.each do |hTimePeriod|
66
68
  intTempEle = intMetadataClass.newTemporalElement
67
- intTempEle[:timePeriod] = $ReaderNS::TimePeriod.unpack(hTimePeriod)
69
+ intTempEle[:timePeriod] = TimePeriod.unpack(hTimePeriod, responseObj)
68
70
  aIntTempElements << intTempEle
69
71
  end
70
72
  end
@@ -5,8 +5,10 @@
5
5
  # Stan Smith 2013-12-11 original script
6
6
  # Stan Smith 2014-07-07 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)
9
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
8
10
 
9
- require $ReaderNS.readerModule('module_dateTime')
11
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
10
12
 
11
13
  module ADIWG
12
14
  module Mdtranslator
@@ -15,7 +17,7 @@ module ADIWG
15
17
 
16
18
  module TimeInstant
17
19
 
18
- def self.unpack(hTimeInst)
20
+ def self.unpack(hTimeInst, responseObj)
19
21
 
20
22
  # instance classes needed in script
21
23
  intMetadataClass = InternalMetadata.new
@@ -41,7 +43,7 @@ module ADIWG
41
43
  if hTimeInst.has_key?('timePosition')
42
44
  s = hTimeInst['timePosition']
43
45
  if s != ''
44
- intTimeInst[:timePosition] = $ReaderNS::DateTime.unpack(s)
46
+ intTimeInst[:timePosition] = DateTime.unpack(s, responseObj)
45
47
  end
46
48
  end
47
49
 
@@ -5,8 +5,10 @@
5
5
  # Stan Smith 2013-12-11 original script
6
6
  # Stan Smith 2014-07-07 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)
9
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
8
10
 
9
- require $ReaderNS.readerModule('module_dateTime')
11
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_dateTime')
10
12
 
11
13
  module ADIWG
12
14
  module Mdtranslator
@@ -15,7 +17,7 @@ module ADIWG
15
17
 
16
18
  module TimePeriod
17
19
 
18
- def self.unpack(hTimePeriod)
20
+ def self.unpack(hTimePeriod, responseObj)
19
21
 
20
22
  # instance classes needed in script
21
23
  intMetadataClass = InternalMetadata.new
@@ -40,7 +42,7 @@ module ADIWG
40
42
  if hTimePeriod.has_key?('beginPosition')
41
43
  s = hTimePeriod['beginPosition']
42
44
  if s != ''
43
- intTimePer[:beginTime] = $ReaderNS::DateTime.unpack(s)
45
+ intTimePer[:beginTime] = DateTime.unpack(s, responseObj)
44
46
 
45
47
  end
46
48
  end
@@ -48,7 +50,7 @@ module ADIWG
48
50
  if hTimePeriod.has_key?('endPosition')
49
51
  s = hTimePeriod['endPosition']
50
52
  if s != ''
51
- intTimePer[:endTime] = $ReaderNS::DateTime.unpack(s)
53
+ intTimePer[:endTime] = DateTime.unpack(s, responseObj)
52
54
 
53
55
  end
54
56
  end
@@ -5,6 +5,8 @@
5
5
  # Stan Smith 2013-11-18 original script
6
6
  # Stan Smith 2013-12-11 modified to handle single vertical element
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 VerticalElement
15
17
 
16
- def self.unpack(hVertElement)
18
+ def self.unpack(hVertElement, responseObj)
17
19
 
18
20
  # instance classes needed in script
19
21
  intMetadataClass = InternalMetadata.new
@@ -5,8 +5,10 @@
5
5
  # Stan Smith 2013-11-21 original script
6
6
  # Stan Smith 2014-07-07 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)
9
+ # Stan Smith 2015-07-14 refactored to remove global namespace constants
8
10
 
9
- require $ReaderNS.readerModule('module_responsibleParty')
11
+ require ADIWG::Mdtranslator::Readers::MdJson.readerModule('module_responsibleParty')
10
12
 
11
13
  module ADIWG
12
14
  module Mdtranslator
@@ -15,7 +17,7 @@ module ADIWG
15
17
 
16
18
  module Voucher
17
19
 
18
- def self.unpack(hVoucher)
20
+ def self.unpack(hVoucher, responseObj)
19
21
 
20
22
  # instance classes needed in script
21
23
  intMetadataClass = InternalMetadata.new
@@ -33,7 +35,7 @@ module ADIWG
33
35
  if hVoucher.has_key?('repository')
34
36
  hRepository = hVoucher['repository']
35
37
  unless hRepository.empty?
36
- intTaxVoucher[:repository] = $ReaderNS::ResponsibleParty.unpack(hRepository)
38
+ intTaxVoucher[:repository] = ResponsibleParty.unpack(hRepository, responseObj)
37
39
  end
38
40
  end
39
41
 
@@ -0,0 +1,19 @@
1
+ # mdJson version history
2
+ # 1.1.0 2015-07-30 added support for locale in metadata record information
3
+ # 1.1.0 2015-07-31 added support for grid information
4
+ # 1.1.0 2015-08-04 added support for content coverage information
5
+ # 1.1.0 2015-09-18 added elements to distributor information
6
+ # 1.1.0 2015-09-18 moved distribution format into distributor transfer options
7
+
8
+ module ADIWG
9
+ module Mdtranslator
10
+ module Readers
11
+ module MdJson
12
+
13
+ # current version of mdJson reader version 1
14
+ VERSION = '1.1.0'
15
+
16
+ end
17
+ end
18
+ end
19
+ end
@@ -4,49 +4,52 @@
4
4
  # Stan Smith 2014-12-11 original script
5
5
  # Stan Smith 2012-12-16 generalized handleReader to use :readerRequested
6
6
  # Stan Smith 2015-03-04 changed method of setting $WriterNS
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
10
12
  module Readers
11
13
 
12
- def self.handleReader(file)
14
+ def self.handleReader(file, responseObj)
13
15
 
14
- # use reader name to load and initiate reader
15
- # build directory path name for reader
16
- readerDir = File.join(path_to_resources, $response[:readerRequested])
16
+ # use readerRequested from responseObj to build directory path to reader
17
+ # the readers's high level folder must be under the 'writers' directory
18
+ readerDir = File.join(path_to_readers, responseObj[:readerRequested])
17
19
  if File.directory?(readerDir)
18
20
 
19
21
  # if directory path exists, build reader file name and require it
20
- readerFile = File.join(readerDir, $response[:readerRequested] + '_reader')
22
+ readerFile = File.join(readerDir, responseObj[:readerRequested] + '_reader')
21
23
  require readerFile
22
- readerClassName = $response[:readerRequested].dup
23
- readerClassName[0] = readerClassName[0].upcase
24
- $ReaderNS = ADIWG::Mdtranslator::Readers.const_get(readerClassName)
25
24
 
25
+ # build the namespace for the reader
26
+ readerNS = responseObj[:readerRequested].dup
27
+ readerNS[0] = readerNS[0].upcase
28
+
29
+ # pass file and response object to requested reader
30
+ # the reader will return the internal object with the metadata content loaded
31
+ return ADIWG::Mdtranslator::Readers.const_get(readerNS).readFile(file, responseObj)
26
32
 
27
- # pass file to requested reader and return internal object
28
- # $ReaderNS is the reader namespace constant set in
29
- # ... readerRequested_reader.rb and initialized when the file is required
30
- return $ReaderNS.readFile(file)
31
33
  else
32
- # directory path was not found
33
- $response[:readerValidationPass] = false
34
- $response[:readerValidationMessages] << "Validation Failed - see following message(s):\n"
35
- $response[:readerValidationMessages] << "Reader '#{$response[:readerRequested]}' is not supported."
34
+ # the directory path was not found meaning there is no reader with that name
35
+ # set the appropriate messages and report the failure
36
+ responseObj[:readerValidationPass] = false
37
+ responseObj[:readerValidationMessages] << "Validation Failed - see following message(s):\n"
38
+ responseObj[:readerValidationMessages] << "Reader '#{responseObj[:readerRequested]}' is not supported."
36
39
  return false
37
40
  end
38
41
 
39
42
  end
40
43
 
41
44
  # return path to readers
42
- def self.path_to_resources
45
+ def self.path_to_readers
43
46
  File.dirname(File.expand_path(__FILE__))
44
47
  end
45
48
 
46
49
  # return reader readme text
47
50
  def self.get_reader_readme(reader)
48
51
  readmeText = 'No readme found'
49
- path = File.join(path_to_resources, reader, 'readme.md')
52
+ path = File.join(path_to_readers, reader, 'readme.md')
50
53
  if File.exist?(path)
51
54
  file = File.open(path, 'r')
52
55
  readmeText = file.read
@@ -43,11 +43,25 @@
43
43
  # --- added reader and writer names to CLI help
44
44
  # --- added check in responsibleParty for valid contactId
45
45
  # --- added characterSets to resource and metadata, updated iso19115_2 and html writers
46
+ # 1.3.0 2015-06-22 removed global variables for the response object
47
+ # --- removed global for show all tags and placed in response object
48
+ # --- removed global for counter for missing ISO IDs and placed in response object
49
+ # --- removed global pointers to contacts and domain arrays and point to @intObj
50
+ # 1.3.0 2015-07-14 removed global namespaces for readers and writers
51
+ # 1.3.0 2015-07-16 added version number management for readers and writers
52
+ # --- moved module_coordinates to internal
53
+ # 1.3.0 2015-07-17 suppress minor section anchor links when no section data available is in html writer
54
+ # --- added meta tags to the html writer
55
+ # --- added --css and --cssLink method_options to CLI
56
+ # 1.3.0 2015-07-20 moved mdTranslator logo to css so it can be replaced using user provided css
57
+ # 1.3.0 2015-07-30 added locale to metadata info and resource info
58
+ # 1.3.0 2015-07-31 added grid information to resource info
59
+ # 1.3.0 2015-08-19 added coverageInfo, imageInfo, sensorInfo, coverageItem, classifiedData, and classedDataItem
46
60
 
47
61
  module ADIWG
48
62
  module Mdtranslator
49
63
  # current mdtranslator version
50
- VERSION = "1.2.1"
64
+ VERSION = "1.3.0"
51
65
  end
52
66
  end
53
67
 
@@ -2,30 +2,33 @@
2
2
 
3
3
  # History:
4
4
  # Stan Smith 2015-01-28 original script
5
+ # Stan Smith 2015-06-23 replace global ($response) with passed in object (responseObj)
6
+ # Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
5
7
 
6
8
  require 'builder'
7
- require 'adiwg/mdtranslator/writers/html/md_html_writer'
9
+ require_relative 'version'
10
+ require_relative 'md_html_writer'
8
11
 
9
12
  module ADIWG
10
13
  module Mdtranslator
11
14
  module Writers
12
15
  module Html
13
16
 
14
- def self.startWriter(intObj)
17
+ def self.startWriter(intObj, responseObj, paramsObj)
15
18
 
16
19
  # set the format of the output file based on the writer specified
17
- $response[:writerFormat] = 'html'
18
- $response[:writerVersion] = ADIWG::Mdtranslator::VERSION
20
+ responseObj[:writerFormat] = 'html'
21
+ responseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Html::VERSION
19
22
 
20
23
  # create new HTML document
21
24
  html = Builder::XmlMarkup.new(indent: 3)
22
- metadataWriter = $WriterNS::MdHtmlWriter.new(html)
23
- metadata = metadataWriter.writeHtml(intObj)
25
+ metadataWriter = MdHtmlWriter.new(html, intObj, paramsObj)
26
+ metadata = metadataWriter.writeHtml()
24
27
 
25
28
  # set writer pass to true if no messages
26
29
  # false or warning will be set by code that places the message
27
- if $response[:writerMessages].length == 0
28
- $response[:writerPass] = true
30
+ if responseObj[:writerMessages].length == 0
31
+ responseObj[:writerPass] = true
29
32
  end
30
33
 
31
34
  return metadata
@@ -4,12 +4,11 @@
4
4
  # Stan Smith 2015-03-23 original script
5
5
  # Stan Smith 2015-04-07 replaced instruct! with declare! and html to
6
6
  # ... conform with w3 html encoding declarations
7
+ # Stan Smith 2015-06-23 replace global ($response) with passed in object (responseObj)
8
+ # Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
7
9
 
8
-
9
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), './sections'))
10
-
11
- require 'html_head'
12
- require 'html_body'
10
+ require_relative 'sections/html_head'
11
+ require_relative 'sections/html_body'
13
12
 
14
13
  module ADIWG
15
14
  module Mdtranslator
@@ -17,37 +16,41 @@ module ADIWG
17
16
  module Html
18
17
 
19
18
  class MdHtmlWriter
20
- def initialize(html)
19
+ def initialize(html,intObj, paramsObj)
21
20
  @html = html
21
+ @@intObj = intObj
22
+ @paramsObj = paramsObj
22
23
  end
23
24
 
24
- def writeHtml(intObj)
25
-
26
- # set html section namespace
27
- $HtmlNS = ADIWG::Mdtranslator::Writers::Html
28
-
29
- # set contact array in a global
30
- $aContacts = intObj[:contacts]
25
+ def writeHtml()
31
26
 
32
27
  # classes used
33
- htmlHead = $HtmlNS::MdHtmlHead.new(@html)
34
- htmlBody = $HtmlNS::MdHtmlBody.new(@html)
28
+ htmlHead = MdHtmlHead.new(@html, @paramsObj)
29
+ htmlBody = MdHtmlBody.new(@html)
35
30
 
36
31
  # page
37
32
  metadata = @html.declare! :DOCTYPE, :html
38
33
  @html.html(:lang=>'en') do
39
- @html.comment!('Report from mdTranslator HTML writer v1.0')
40
-
41
34
  # head
42
35
  htmlHead.writeHtml()
43
36
 
44
37
  # body
45
- htmlBody.writeHtml(intObj)
38
+ htmlBody.writeHtml(@@intObj)
46
39
  end
47
40
 
48
41
  return metadata
49
42
 
50
43
  end
44
+
45
+ def self.getContact(contactId)
46
+ @@intObj[:contacts].each do |hCont|
47
+ if hCont[:contactId] == contactId
48
+ return hCont
49
+ end
50
+ end
51
+ return nil
52
+ end
53
+
51
54
  end
52
55
 
53
56
  end