adiwg-mdtranslator 0.10.2 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (216) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -4
  3. data/Rakefile +4 -1
  4. data/adiwg-mdtranslator.gemspec +10 -8
  5. data/bin/mdtranslator +8 -2
  6. data/lib/adiwg/mdtranslator.rb +72 -147
  7. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +538 -538
  8. data/lib/adiwg/mdtranslator/internal/module_dateTimeFun.rb +78 -78
  9. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +153 -74
  10. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_validator.rb +41 -108
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_additionalDocumentation.rb +54 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_address.rb +89 -0
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_associatedResource.rb +82 -0
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_boundingBox.rb +62 -0
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_browseGraphic.rb +69 -0
  16. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_citation.rb +122 -0
  17. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_contacts.rb +150 -0
  18. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_coordinates.rb +63 -0
  19. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataDictionary.rb +63 -0
  20. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dataQuality.rb +51 -0
  21. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dateTime.rb +38 -0
  22. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_descriptiveKeyword.rb +60 -0
  23. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_dictionaryInfo.rb +63 -0
  24. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_distributionInfo.rb +161 -0
  25. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domain.rb +73 -0
  26. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_domainItem.rb +53 -0
  27. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entity.rb +103 -0
  28. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityAttribute.rb +102 -0
  29. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityForeignKey.rb +54 -0
  30. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_entityIndex.rb +53 -0
  31. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_extent.rb +73 -0
  32. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoCoordSystem.rb +57 -0
  33. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geoProperties.rb +100 -0
  34. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_geographicElement.rb +179 -0
  35. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_legalConstraint.rb +56 -0
  36. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineString.rb +36 -0
  37. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_lineage.rb +61 -0
  38. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_mdJson.rb +69 -0
  39. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadata.rb +88 -0
  40. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataExtension.rb +51 -0
  41. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_metadataInfo.rb +123 -0
  42. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_onlineResource.rb +79 -0
  43. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_phone.rb +79 -0
  44. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_point.rb +36 -0
  45. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_polygon.rb +66 -0
  46. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_processStep.rb +75 -0
  47. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resolution.rb +53 -0
  48. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceFormat.rb +46 -0
  49. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceIdentifier.rb +60 -0
  50. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceInfo.rb +328 -0
  51. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceMaintenance.rb +61 -0
  52. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_resourceSpecificUsage.rb +61 -0
  53. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_responsibleParty.rb +48 -0
  54. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_securityConstraint.rb +63 -0
  55. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_source.rb +59 -0
  56. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_spatialReference.rb +59 -0
  57. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonClass.rb +54 -0
  58. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_taxonomy.rb +94 -0
  59. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_temporalElement.rb +82 -0
  60. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timeInstant.rb +56 -0
  61. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_timePeriod.rb +64 -0
  62. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_verticalElement.rb +64 -0
  63. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9/module_voucher.rb +49 -0
  64. data/lib/adiwg/mdtranslator/readers/mdJson/readme.md +1 -1
  65. data/lib/adiwg/mdtranslator/readers/mdJson/validator.rb +43 -0
  66. data/lib/adiwg/mdtranslator/readers/mdReaders.rb +55 -0
  67. data/lib/adiwg/mdtranslator/version.rb +15 -4
  68. data/lib/adiwg/mdtranslator/writers/iso/classes/class_address.rb +107 -86
  69. data/lib/adiwg/mdtranslator/writers/iso/classes/class_aggregateInformation.rb +68 -57
  70. data/lib/adiwg/mdtranslator/writers/iso/classes/class_boundingPolygon.rb +59 -48
  71. data/lib/adiwg/mdtranslator/writers/iso/classes/class_browseGraphic.rb +57 -46
  72. data/lib/adiwg/mdtranslator/writers/iso/classes/class_citation.rb +149 -138
  73. data/lib/adiwg/mdtranslator/writers/iso/classes/class_contact.rb +83 -72
  74. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataIdentification.rb +334 -322
  75. data/lib/adiwg/mdtranslator/writers/iso/classes/class_dataQuality.rb +46 -34
  76. data/lib/adiwg/mdtranslator/writers/iso/classes/class_date.rb +47 -36
  77. data/lib/adiwg/mdtranslator/writers/iso/classes/class_digitalTransferOptions.rb +42 -31
  78. data/lib/adiwg/mdtranslator/writers/iso/classes/class_distribution.rb +29 -18
  79. data/lib/adiwg/mdtranslator/writers/iso/classes/class_distributor.rb +77 -66
  80. data/lib/adiwg/mdtranslator/writers/iso/classes/class_extent.rb +87 -76
  81. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureAttribute.rb +113 -102
  82. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureConstraint.rb +44 -33
  83. data/lib/adiwg/mdtranslator/writers/iso/classes/class_featureType.rb +121 -110
  84. data/lib/adiwg/mdtranslator/writers/iso/classes/class_format.rb +45 -34
  85. data/lib/adiwg/mdtranslator/writers/iso/classes/class_genericMetaData.rb +45 -36
  86. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicBoundingBox.rb +78 -67
  87. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicDescription.rb +25 -14
  88. data/lib/adiwg/mdtranslator/writers/iso/classes/class_geographicElement.rb +30 -19
  89. data/lib/adiwg/mdtranslator/writers/iso/classes/class_identifier.rb +41 -30
  90. data/lib/adiwg/mdtranslator/writers/iso/classes/class_keyword.rb +58 -49
  91. data/lib/adiwg/mdtranslator/writers/iso/classes/class_legalConstraints.rb +65 -54
  92. data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineString.rb +77 -66
  93. data/lib/adiwg/mdtranslator/writers/iso/classes/class_lineage.rb +62 -51
  94. data/lib/adiwg/mdtranslator/writers/iso/classes/class_listedValue.rb +70 -59
  95. data/lib/adiwg/mdtranslator/writers/iso/classes/class_maintenanceInformation.rb +54 -43
  96. data/lib/adiwg/mdtranslator/writers/iso/classes/class_medium.rb +58 -47
  97. data/lib/adiwg/mdtranslator/writers/iso/classes/class_metadataExtension.rb +154 -143
  98. data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiGeometry.rb +138 -127
  99. data/lib/adiwg/mdtranslator/writers/iso/classes/class_multiplicity.rb +37 -26
  100. data/lib/adiwg/mdtranslator/writers/iso/classes/class_onlineResource.rb +79 -68
  101. data/lib/adiwg/mdtranslator/writers/iso/classes/class_point.rb +77 -66
  102. data/lib/adiwg/mdtranslator/writers/iso/classes/class_polygon.rb +98 -87
  103. data/lib/adiwg/mdtranslator/writers/iso/classes/class_processStep.rb +80 -69
  104. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceIdentifier.rb +38 -27
  105. data/lib/adiwg/mdtranslator/writers/iso/classes/class_referenceSystem.rb +25 -14
  106. data/lib/adiwg/mdtranslator/writers/iso/classes/class_resolution.rb +51 -40
  107. data/lib/adiwg/mdtranslator/writers/iso/classes/class_responsibleParty.rb +88 -77
  108. data/lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb +70 -59
  109. data/lib/adiwg/mdtranslator/writers/iso/classes/class_source.rb +58 -47
  110. data/lib/adiwg/mdtranslator/writers/iso/classes/class_standardOrderProcess.rb +75 -63
  111. data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonClassification.rb +55 -44
  112. data/lib/adiwg/mdtranslator/writers/iso/classes/class_taxonSystem.rb +98 -87
  113. data/lib/adiwg/mdtranslator/writers/iso/classes/class_telephone.rb +73 -62
  114. data/lib/adiwg/mdtranslator/writers/iso/classes/class_temporalExtent.rb +58 -47
  115. data/lib/adiwg/mdtranslator/writers/iso/classes/class_timeInstant.rb +36 -27
  116. data/lib/adiwg/mdtranslator/writers/iso/classes/class_timePeriod.rb +42 -33
  117. data/lib/adiwg/mdtranslator/writers/iso/classes/class_usage.rb +59 -48
  118. data/lib/adiwg/mdtranslator/writers/iso/classes/class_useConstraints.rb +26 -15
  119. data/lib/adiwg/mdtranslator/writers/iso/classes/class_verticalExtent.rb +52 -41
  120. data/lib/adiwg/mdtranslator/writers/iso/classes/class_vouchers.rb +39 -28
  121. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_associationType.rb +41 -29
  122. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_characterSet.rb +82 -47
  123. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_classification.rb +42 -24
  124. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_datatype.rb +56 -34
  125. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_dateType.rb +34 -19
  126. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_initiativeType.rb +41 -29
  127. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_keywordType.rb +46 -27
  128. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_maintenanceFrequency.rb +55 -36
  129. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumFormat.rb +44 -26
  130. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_mediumName.rb +68 -38
  131. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_obligation.rb +32 -25
  132. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_onlineFunction.rb +42 -25
  133. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_presentationForm.rb +58 -31
  134. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_progress.rb +44 -25
  135. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_restriction.rb +47 -32
  136. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_role.rb +52 -29
  137. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_scope.rb +58 -35
  138. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_spatialRepresentationType.rb +43 -30
  139. data/lib/adiwg/mdtranslator/writers/iso/codelists/code_topicCategory.rb +51 -44
  140. data/lib/adiwg/mdtranslator/writers/iso/units/class_baseUnit.rb +26 -15
  141. data/lib/adiwg/mdtranslator/writers/iso/units/class_conventionalUnit.rb +56 -45
  142. data/lib/adiwg/mdtranslator/writers/iso/units/class_definitionUnit.rb +23 -12
  143. data/lib/adiwg/mdtranslator/writers/iso/units/class_derivedUnit.rb +30 -19
  144. data/lib/adiwg/mdtranslator/writers/iso/units/class_unitsOfMeasure.rb +223 -212
  145. data/lib/adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue.rb +174 -0
  146. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +41 -12
  147. data/lib/adiwg/mdtranslator/writers/iso19115_2/class_MImetadata.rb +347 -0
  148. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +151 -119
  149. data/lib/adiwg/mdtranslator/writers/mdWriters.rb +63 -0
  150. data/test/readers/mdJson/v0_9/tc_reader_mdjson_additionalDocumentation.rb +84 -0
  151. data/test/readers/mdJson/v0_9/tc_reader_mdjson_address.rb +100 -0
  152. data/test/readers/mdJson/v0_9/tc_reader_mdjson_associatedResource.rb +100 -0
  153. data/test/readers/mdJson/v0_9/tc_reader_mdjson_browseGraphic.rb +66 -0
  154. data/test/readers/mdJson/v0_9/tc_reader_mdjson_citation.rb +115 -0
  155. data/test/readers/mdJson/v0_9/tc_reader_mdjson_contact.rb +137 -0
  156. data/test/readers/mdJson/v0_9/tc_reader_mdjson_onlineResource.rb +47 -0
  157. data/test/readers/mdJson/v0_9/tc_reader_mdjson_phone.rb +128 -0
  158. data/test/readers/mdJson/v0_9/tc_translation.rb +82 -0
  159. data/test/writers/iso19115_2/tc_writer_iso19115_2_address.rb +222 -0
  160. metadata +87 -60
  161. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_additionalDocumentation.rb +0 -36
  162. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_address.rb +0 -71
  163. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_associatedResource.rb +0 -66
  164. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_boundingBox.rb +0 -51
  165. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_browseGraphic.rb +0 -52
  166. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_citation.rb +0 -104
  167. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_contacts.rb +0 -121
  168. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_coordinates.rb +0 -52
  169. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataDictionary.rb +0 -53
  170. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dataQuality.rb +0 -40
  171. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dateTime.rb +0 -27
  172. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_descriptiveKeyword.rb +0 -49
  173. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_dictionaryInfo.rb +0 -52
  174. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_distributionInfo.rb +0 -150
  175. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domain.rb +0 -62
  176. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_domainItem.rb +0 -42
  177. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entity.rb +0 -92
  178. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityAttribute.rb +0 -91
  179. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityForeignKey.rb +0 -43
  180. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_entityIndex.rb +0 -42
  181. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_extent.rb +0 -62
  182. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoCoordSystem.rb +0 -46
  183. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geoProperties.rb +0 -89
  184. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_geographicElement.rb +0 -168
  185. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_legalConstraint.rb +0 -45
  186. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineString.rb +0 -25
  187. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_lineage.rb +0 -50
  188. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadata.rb +0 -77
  189. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataExtension.rb +0 -40
  190. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_metadataInfo.rb +0 -112
  191. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_onlineResource.rb +0 -62
  192. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_phone.rb +0 -59
  193. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_point.rb +0 -25
  194. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_polygon.rb +0 -55
  195. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_processStep.rb +0 -64
  196. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resolution.rb +0 -42
  197. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceFormat.rb +0 -35
  198. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceIdentifier.rb +0 -49
  199. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceInfo.rb +0 -317
  200. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceMaintenance.rb +0 -50
  201. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_resourceSpecificUsage.rb +0 -50
  202. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_responsibleParty.rb +0 -37
  203. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_securityConstraint.rb +0 -52
  204. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_source.rb +0 -48
  205. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_spatialReference.rb +0 -48
  206. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonClass.rb +0 -43
  207. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_taxonomy.rb +0 -83
  208. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_temporalElement.rb +0 -71
  209. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timeInstant.rb +0 -45
  210. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_timePeriod.rb +0 -53
  211. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_verticalElement.rb +0 -53
  212. data/lib/adiwg/mdtranslator/readers/mdJson/modules_0.9.0/module_voucher.rb +0 -38
  213. data/lib/adiwg/mdtranslator/validator.rb +0 -43
  214. data/lib/adiwg/mdtranslator/writers/iso/classes/class_FCfeatureCatalogue.rb +0 -171
  215. data/lib/adiwg/mdtranslator/writers/iso/classes/class_MImetadata.rb +0 -333
  216. data/test/tc_translation.rb +0 -73
@@ -4,52 +4,64 @@
4
4
  # History:
5
5
  # Stan Smith 2013-11-20 original script
6
6
  # Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
7
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
8
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
7
9
 
8
10
  require 'code_scope'
9
11
  require 'class_lineage'
10
12
 
11
- class DQ_DataQuality
13
+ module ADIWG
14
+ module Mdtranslator
15
+ module Writers
16
+ module Iso
12
17
 
13
- def initialize(xml)
14
- @xml = xml
15
- end
18
+ class DQ_DataQuality
16
19
 
17
- def writeXML(hDataQ)
20
+ def initialize(xml)
21
+ @xml = xml
22
+ end
18
23
 
19
- # classes used
20
- scopeCode = MD_ScopeCode.new(@xml)
21
- lineClass = LI_Lineage.new(@xml)
24
+ def writeXML(hDataQ)
22
25
 
23
- @xml.tag!('gmd:DQ_DataQuality') do
26
+ # classes used
27
+ scopeCode = $WriterNS::MD_ScopeCode.new(@xml)
28
+ lineClass = $WriterNS::LI_Lineage.new(@xml)
24
29
 
25
- # data quality - scope - required
26
- s = hDataQ[:dataScope]
27
- if s.nil?
28
- @xml.tag!('gmd:scope',{'gco:nilReason'=>'missing'})
29
- else
30
- @xml.tag!('gmd:scope') do
31
- @xml.tag!('gmd:DQ_Scope') do
32
- @xml.tag!('gmd:level') do
33
- scopeCode.writeXML(s)
34
- end
35
- end
36
- end
37
- end
30
+ @xml.tag!('gmd:DQ_DataQuality') do
38
31
 
39
- # date quality - report
32
+ # data quality - scope - required
33
+ s = hDataQ[:dataScope]
34
+ if s.nil?
35
+ @xml.tag!('gmd:scope', {'gco:nilReason' => 'missing'})
36
+ else
37
+ @xml.tag!('gmd:scope') do
38
+ @xml.tag!('gmd:DQ_Scope') do
39
+ @xml.tag!('gmd:level') do
40
+ scopeCode.writeXML(s)
41
+ end
42
+ end
43
+ end
44
+ end
40
45
 
41
- # data quality - lineage
42
- hLineage = hDataQ[:dataLineage]
43
- if !hLineage.empty?
44
- @xml.tag!('gmd:lineage') do
45
- lineClass.writeXML(hLineage)
46
- end
47
- elsif $showAllTags
48
- @xml.tag!('gmd:lineage')
49
- end
46
+ # date quality - report
50
47
 
51
- end
48
+ # data quality - lineage
49
+ hLineage = hDataQ[:dataLineage]
50
+ if !hLineage.empty?
51
+ @xml.tag!('gmd:lineage') do
52
+ lineClass.writeXML(hLineage)
53
+ end
54
+ elsif $showAllTags
55
+ @xml.tag!('gmd:lineage')
56
+ end
52
57
 
53
- end
58
+ end
54
59
 
60
+ end
61
+
62
+ end
63
+
64
+ end
65
+ end
66
+ end
55
67
  end
@@ -5,56 +5,67 @@
5
5
  # Stan Smith 2013-08-26 original script
6
6
  # Stan Smith 2013-11-21 support for date or datetime
7
7
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
8
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
8
9
 
9
10
  require 'module_dateTimeFun'
10
11
  require 'code_dateType'
11
12
 
12
- class CI_Date
13
+ module ADIWG
14
+ module Mdtranslator
15
+ module Writers
16
+ module Iso
13
17
 
14
- def initialize(xml)
15
- @xml = xml
16
- end
18
+ class CI_Date
17
19
 
18
- def writeXML(hDate)
20
+ def initialize(xml)
21
+ @xml = xml
22
+ end
19
23
 
20
- # classes used
21
- dateTypeCode = CI_DateTypeCode.new(@xml)
24
+ def writeXML(hDate)
22
25
 
23
- citDateTime = hDate[:dateTime]
24
- citDateRes = hDate[:dateResolution]
25
- citDateType = hDate[:dateType]
26
+ # classes used
27
+ dateTypeCode = $WriterNS::CI_DateTypeCode.new(@xml)
26
28
 
27
- @xml.tag!('gmd:CI_Date') do
29
+ citDateTime = hDate[:dateTime]
30
+ citDateRes = hDate[:dateResolution]
31
+ citDateType = hDate[:dateType]
28
32
 
29
- # date - date - required
30
- if citDateTime.nil?
31
- @xml.tag!('gmd:date',{'gco:nilReason'=>'missing'})
32
- else
33
- @xml.tag!('gmd:date') do
33
+ @xml.tag!('gmd:CI_Date') do
34
34
 
35
- if citDateRes.length > 3
36
- # if time, requires all time fields
37
- dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(citDateTime,'YMDhmsZ')
38
- @xml.tag!('gco:DateTime',dateStr)
39
- else
40
- dateStr = AdiwgDateTimeFun.stringDateFromDateTime(citDateTime,citDateRes)
41
- @xml.tag!('gco:Date',dateStr)
42
- end
35
+ # date - date - required
36
+ if citDateTime.nil?
37
+ @xml.tag!('gmd:date', {'gco:nilReason' => 'missing'})
38
+ else
39
+ @xml.tag!('gmd:date') do
43
40
 
44
- end
41
+ if citDateRes.length > 3
42
+ # if time, requires all time fields
43
+ dateStr = AdiwgDateTimeFun.stringDateTimeFromDateTime(citDateTime, 'YMDhmsZ')
44
+ @xml.tag!('gco:DateTime', dateStr)
45
+ else
46
+ dateStr = AdiwgDateTimeFun.stringDateFromDateTime(citDateTime, citDateRes)
47
+ @xml.tag!('gco:Date', dateStr)
48
+ end
45
49
 
46
- end
50
+ end
47
51
 
48
- # date - date type - required
49
- if citDateType.nil?
50
- @xml.tag!('gmd:dateType',{'gco:nilReason'=>'missing'})
51
- else
52
- @xml.tag!('gmd:dateType') do
53
- dateTypeCode.writeXML(citDateType)
54
- end
55
- end
56
- end
52
+ end
57
53
 
58
- end
54
+ # date - date type - required
55
+ if citDateType.nil?
56
+ @xml.tag!('gmd:dateType', {'gco:nilReason' => 'missing'})
57
+ else
58
+ @xml.tag!('gmd:dateType') do
59
+ dateTypeCode.writeXML(citDateType)
60
+ end
61
+ end
62
+ end
59
63
 
64
+ end
65
+
66
+ end
67
+
68
+ end
69
+ end
70
+ end
60
71
  end
@@ -4,48 +4,59 @@
4
4
  # History:
5
5
  # Stan Smith 2013-09-26 original script
6
6
  # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
7
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
7
8
 
8
9
  require 'class_onlineResource'
9
10
  require 'class_medium'
10
11
 
11
- class MD_DigitalTransferOptions
12
+ module ADIWG
13
+ module Mdtranslator
14
+ module Writers
15
+ module Iso
12
16
 
13
- def initialize(xml)
14
- @xml = xml
15
- end
17
+ class MD_DigitalTransferOptions
16
18
 
17
- def writeXML(transOption)
19
+ def initialize(xml)
20
+ @xml = xml
21
+ end
18
22
 
19
- # classes used
20
- olResClass = CI_OnlineResource.new(@xml)
21
- medClass = MD_Medium.new(@xml)
23
+ def writeXML(transOption)
22
24
 
23
- @xml.tag!('gmd:MD_DigitalTransferOptions') do
25
+ # classes used
26
+ olResClass = $WriterNS::CI_OnlineResource.new(@xml)
27
+ medClass = $WriterNS::MD_Medium.new(@xml)
24
28
 
25
- # digital transfer options - online [] - CI_OnlineResource
26
- aOnTranOpts = transOption[:online]
27
- if !aOnTranOpts.empty?
28
- aOnTranOpts.each do |olTranOpt|
29
- @xml.tag!('gmd:onLine') do
30
- olResClass.writeXML(olTranOpt)
31
- end
32
- end
33
- elsif $showAllTags
34
- @xml.tag!('gmd:onLine')
35
- end
29
+ @xml.tag!('gmd:MD_DigitalTransferOptions') do
36
30
 
37
- # digital transfer options - offline - MD_Medium
38
- hOffTranOpt = transOption[:offline]
39
- if !hOffTranOpt.empty?
40
- @xml.tag!('gmd:offLine') do
41
- medClass.writeXML(hOffTranOpt)
42
- end
43
- elsif $showAllTags
44
- @xml.tag!('gmd:offLine')
45
- end
31
+ # digital transfer options - online [] - CI_OnlineResource
32
+ aOnTranOpts = transOption[:online]
33
+ if !aOnTranOpts.empty?
34
+ aOnTranOpts.each do |olTranOpt|
35
+ @xml.tag!('gmd:onLine') do
36
+ olResClass.writeXML(olTranOpt)
37
+ end
38
+ end
39
+ elsif $showAllTags
40
+ @xml.tag!('gmd:onLine')
41
+ end
46
42
 
47
- end
43
+ # digital transfer options - offline - MD_Medium
44
+ hOffTranOpt = transOption[:offline]
45
+ if !hOffTranOpt.empty?
46
+ @xml.tag!('gmd:offLine') do
47
+ medClass.writeXML(hOffTranOpt)
48
+ end
49
+ elsif $showAllTags
50
+ @xml.tag!('gmd:offLine')
51
+ end
48
52
 
49
- end
53
+ end
50
54
 
55
+ end
56
+
57
+ end
58
+
59
+ end
60
+ end
61
+ end
51
62
  end
@@ -4,33 +4,44 @@
4
4
  # History:
5
5
  # Stan Smith 2013-09-25 original script
6
6
  # Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
7
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
7
8
 
8
9
  require 'class_distributor'
9
10
 
10
- class MD_Distribution
11
+ module ADIWG
12
+ module Mdtranslator
13
+ module Writers
14
+ module Iso
11
15
 
12
- def initialize(xml)
13
- @xml = xml
14
- end
16
+ class MD_Distribution
15
17
 
16
- def writeXML(aDistributors)
18
+ def initialize(xml)
19
+ @xml = xml
20
+ end
17
21
 
18
- # classes used
19
- distributorClass = MD_Distributor.new(@xml)
22
+ def writeXML(aDistributors)
20
23
 
21
- @xml.tag!('gmd:MD_Distribution') do
24
+ # classes used
25
+ distributorClass = $WriterNS::MD_Distributor.new(@xml)
22
26
 
23
- # distribution - distributor - required
24
- unless aDistributors.empty?
25
- aDistributors.each do |hDistributor|
26
- @xml.tag!('gmd:distributor') do
27
- distributorClass.writeXML(hDistributor)
28
- end
29
- end
30
- end
27
+ @xml.tag!('gmd:MD_Distribution') do
31
28
 
32
- end
29
+ # distribution - distributor - required
30
+ unless aDistributors.empty?
31
+ aDistributors.each do |hDistributor|
32
+ @xml.tag!('gmd:distributor') do
33
+ distributorClass.writeXML(hDistributor)
34
+ end
35
+ end
36
+ end
33
37
 
34
- end
38
+ end
35
39
 
40
+ end
41
+
42
+ end
43
+
44
+ end
45
+ end
46
+ end
36
47
  end
@@ -4,77 +4,88 @@
4
4
  # History:
5
5
  # Stan Smith 2013-09-25 original script
6
6
  # Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
7
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
7
8
 
8
9
  require 'class_responsibleParty'
9
10
  require 'class_standardOrderProcess'
10
11
  require 'class_format'
11
12
  require 'class_digitalTransferOptions'
12
13
 
13
- class MD_Distributor
14
-
15
- def initialize(xml)
16
- @xml = xml
17
- end
18
-
19
- def writeXML(distributor)
20
-
21
- # classes used
22
- rPartyClass = CI_ResponsibleParty.new(@xml)
23
- sOrderProcClass = MD_StandardOrderProcess.new(@xml)
24
- rFormatClass = MD_Format.new(@xml)
25
- dTranOptClass = MD_DigitalTransferOptions.new(@xml)
26
-
27
- @xml.tag!('gmd:MD_Distributor') do
28
-
29
- # distributor - distributor contact - CI_ResponsibleParty - required
30
- hResParty = distributor[:distContact]
31
- if hResParty.empty?
32
- @xml.tag!('gmd:distributorContact', {'gco:nilReason' => 'missing'})
33
- else
34
- @xml.tag!('gmd:distributorContact') do
35
- rPartyClass.writeXML(hResParty)
36
- end
37
- end
38
-
39
- # distributor - distribution order process []
40
- aDistOrderProc = distributor[:distOrderProc]
41
- if !aDistOrderProc.empty?
42
- aDistOrderProc.each do |distOrder|
43
- @xml.tag!('gmd:distributionOrderProcess') do
44
- sOrderProcClass.writeXML(distOrder)
45
- end
46
- end
47
- elsif $showAllTags
48
- @xml.tag!('gmd:distributionOrderProcess')
49
- end
50
-
51
- # distributor - distributor format []
52
- aDistFormats = distributor[:distFormat]
53
- if !aDistFormats.empty?
54
- aDistFormats.each do |dFormat|
55
- @xml.tag!('gmd:distributorFormat') do
56
- rFormatClass.writeXML(dFormat)
57
- end
58
- end
59
- elsif $showAllTags
60
- @xml.tag!('gmd:distributorFormat')
61
- end
62
-
63
- # distributor - distributor transfer options []
64
- aDistTransOpts = distributor[:distTransOption]
65
- if !aDistTransOpts.empty?
66
- aDistTransOpts.each do |dTransOpt|
67
- @xml.tag!('gmd:distributorTransferOptions') do
68
- dTranOptClass.writeXML(dTransOpt)
69
- end
70
- end
71
- elsif $showAllTags
72
- @xml.tag!('gmd:distributorTransferOptions')
73
- end
74
-
75
-
76
- end
77
-
78
- end
14
+ module ADIWG
15
+ module Mdtranslator
16
+ module Writers
17
+ module Iso
79
18
 
19
+ class MD_Distributor
20
+
21
+ def initialize(xml)
22
+ @xml = xml
23
+ end
24
+
25
+ def writeXML(distributor)
26
+
27
+ # classes used
28
+ rPartyClass = $WriterNS::CI_ResponsibleParty.new(@xml)
29
+ sOrderProcClass = $WriterNS::MD_StandardOrderProcess.new(@xml)
30
+ rFormatClass = $WriterNS::MD_Format.new(@xml)
31
+ dTranOptClass = $WriterNS::MD_DigitalTransferOptions.new(@xml)
32
+
33
+ @xml.tag!('gmd:MD_Distributor') do
34
+
35
+ # distributor - distributor contact - CI_ResponsibleParty - required
36
+ hResParty = distributor[:distContact]
37
+ if hResParty.empty?
38
+ @xml.tag!('gmd:distributorContact', {'gco:nilReason' => 'missing'})
39
+ else
40
+ @xml.tag!('gmd:distributorContact') do
41
+ rPartyClass.writeXML(hResParty)
42
+ end
43
+ end
44
+
45
+ # distributor - distribution order process []
46
+ aDistOrderProc = distributor[:distOrderProc]
47
+ if !aDistOrderProc.empty?
48
+ aDistOrderProc.each do |distOrder|
49
+ @xml.tag!('gmd:distributionOrderProcess') do
50
+ sOrderProcClass.writeXML(distOrder)
51
+ end
52
+ end
53
+ elsif $showAllTags
54
+ @xml.tag!('gmd:distributionOrderProcess')
55
+ end
56
+
57
+ # distributor - distributor format []
58
+ aDistFormats = distributor[:distFormat]
59
+ if !aDistFormats.empty?
60
+ aDistFormats.each do |dFormat|
61
+ @xml.tag!('gmd:distributorFormat') do
62
+ rFormatClass.writeXML(dFormat)
63
+ end
64
+ end
65
+ elsif $showAllTags
66
+ @xml.tag!('gmd:distributorFormat')
67
+ end
68
+
69
+ # distributor - distributor transfer options []
70
+ aDistTransOpts = distributor[:distTransOption]
71
+ if !aDistTransOpts.empty?
72
+ aDistTransOpts.each do |dTransOpt|
73
+ @xml.tag!('gmd:distributorTransferOptions') do
74
+ dTranOptClass.writeXML(dTransOpt)
75
+ end
76
+ end
77
+ elsif $showAllTags
78
+ @xml.tag!('gmd:distributorTransferOptions')
79
+ end
80
+
81
+
82
+ end
83
+
84
+ end
85
+
86
+ end
87
+
88
+ end
89
+ end
90
+ end
80
91
  end