adiwg-mdtranslator 2.12.0 → 2.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +2 -0
  5. data/lib/adiwg/mdtranslator/readers/fgdc/fgdc_reader.rb +4 -0
  6. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +1 -1
  7. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_georectifiedRepresentation.rb +7 -12
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +12 -11
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_source.rb +15 -7
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomy.rb +1 -6
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_timePeriod.rb +15 -1
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_transferOption.rb +1 -3
  13. data/lib/adiwg/mdtranslator/version.rb +5 -1
  14. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +1 -1
  15. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +4 -2
  16. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +1 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +1 -1
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +1 -1
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +1 -1
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +4 -4
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +1 -1
  22. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +7 -7
  23. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +6 -5
  24. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_address.rb +104 -104
  25. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb +63 -60
  26. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/{class_attributeGroup.rb → class_attribute.rb} +1 -1
  27. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_baseUnit.rb +23 -23
  28. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_boundingBox.rb +64 -60
  29. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_browseGraphic.rb +55 -51
  30. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +24 -14
  31. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_contact.rb +96 -91
  32. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_conventionalUnit.rb +45 -45
  33. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_coverageDescription.rb +104 -77
  34. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +4 -4
  35. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +23 -8
  36. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataQuality.rb +57 -52
  37. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_date.rb +49 -46
  38. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_definitionUnit.rb +20 -20
  39. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_derivedUnit.rb +32 -32
  40. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dimension.rb +56 -50
  41. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +1 -1
  42. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distributor.rb +77 -74
  43. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_enumerationList.rb +34 -34
  44. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +190 -186
  45. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extent.rb +66 -66
  46. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_feature.rb +50 -45
  47. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureCollection.rb +35 -35
  48. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_featureProperties.rb +43 -43
  49. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_format.rb +73 -69
  50. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_fraction.rb +37 -33
  51. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicElement.rb +59 -54
  52. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geographicExtent.rb +58 -58
  53. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometricObjects.rb +49 -46
  54. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_geometryCollection.rb +68 -63
  55. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georectified.rb +113 -110
  56. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_georeferenceable.rb +78 -75
  57. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gmlIdentifier.rb +17 -17
  58. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_grid.rb +55 -52
  59. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_gridRepresentation.rb +19 -19
  60. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_hierarchy.rb +47 -47
  61. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_image.rb +132 -132
  62. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +5 -2
  63. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineString.rb +70 -70
  64. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_lineage.rb +55 -55
  65. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_locale.rb +51 -48
  66. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_maintenance.rb +114 -105
  67. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdBand.rb +111 -111
  68. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +9 -3
  69. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_measure.rb +58 -41
  70. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_medium.rb +104 -104
  71. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miBand.rb +70 -70
  72. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -16
  73. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiLine.rb +70 -70
  74. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPoint.rb +70 -70
  75. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_multiPolygon.rb +70 -70
  76. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_onlineResource.rb +79 -76
  77. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb +67 -67
  78. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_phone.rb +67 -67
  79. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_point.rb +8 -8
  80. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_polygon.rb +89 -89
  81. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_processStep.rb +9 -3
  82. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rangeDimension.rb +59 -54
  83. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +1 -1
  84. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_resolution.rb +47 -47
  85. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_responsibleParty.rb +111 -105
  86. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_rsIdentifier.rb +71 -65
  87. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scope.rb +54 -50
  88. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_scopeDescription.rb +45 -42
  89. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb +92 -89
  90. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_series.rb +55 -55
  91. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_source.rb +98 -91
  92. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_spatialRepresentation.rb +42 -42
  93. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicClassification.rb +63 -59
  94. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomicSystem.rb +40 -40
  95. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_taxonomy.rb +133 -130
  96. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_temporalExtent.rb +49 -49
  97. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timeInstant.rb +60 -60
  98. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_timePeriod.rb +110 -108
  99. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_transferOptions.rb +71 -69
  100. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_unitsOfMeasure.rb +243 -243
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_usage.rb +98 -95
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_useConstraints.rb +38 -38
  103. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vectorRepresentation.rb +48 -48
  104. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_verticalExtent.rb +74 -70
  105. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_vouchers.rb +56 -53
  106. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer.rb +61 -11
  107. data/lib/adiwg/mdtranslator/writers/iso19115_2/iso19115_2_writer_messages_eng.yml +109 -0
  108. data/lib/adiwg/mdtranslator/writers/iso19115_2/version.rb +3 -2
  109. data/lib/adiwg/mdtranslator_cli.rb +21 -4
  110. metadata +6 -5
@@ -1,6 +1,7 @@
1
1
  # Writer - internal data structure to ISO 19110:2003
2
2
 
3
3
  # History:
4
+ # Stan Smith 2018-03-30 add error/warning/notice message methods
4
5
  # Stan Smith 2017-05-26 allow choice of which dictionary to translate
5
6
  # ... fix bug when no dictionary is provided in mdJson
6
7
  # Stan Smith 2017-01-20 refactor for mdJson/mdTranslator 2.0
@@ -20,7 +21,7 @@ module ADIWG
20
21
  module Writers
21
22
  module Iso19110
22
23
 
23
- def self.startWriter(intObj, responseObj, whichDict: 0)
24
+ def self.startWriter(intObj, hResponseObj, whichDict: 0)
24
25
 
25
26
  # Iso19110 can only output one dictionary at a time
26
27
  # test if requested dictionary is in input file
@@ -33,7 +34,7 @@ module ADIWG
33
34
  # make objects available to the instance
34
35
  @intObj = intObj
35
36
  @contacts = intObj[:contacts]
36
- @hResponseObj = responseObj
37
+ @hResponseObj = hResponseObj
37
38
  dictionary = intObj[:dataDictionaries][whichDict]
38
39
  @domains = dictionary[:domains]
39
40
 
@@ -43,14 +44,14 @@ module ADIWG
43
44
  @aMessagesList = hMessageList['messageList']
44
45
 
45
46
  # set the format of the output file based on the writer specified
46
- responseObj[:writerOutputFormat] = 'xml'
47
- responseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Iso19110::VERSION
47
+ hResponseObj[:writerOutputFormat] = 'xml'
48
+ hResponseObj[:writerVersion] = ADIWG::Mdtranslator::Writers::Iso19110::VERSION
48
49
 
49
50
  # create new XML document
50
51
  @xml = Builder::XmlMarkup.new(indent: 3)
51
52
 
52
53
  # start writing the ISO 19110 XML record
53
- metadataWriter = FC_FeatureCatalogue.new(@xml, responseObj)
54
+ metadataWriter = FC_FeatureCatalogue.new(@xml, hResponseObj)
54
55
  metadata = metadataWriter.writeXML(intObj)
55
56
 
56
57
  return metadata
@@ -2,111 +2,111 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-11-18 refactored for mdTranslator/mdJson 2.0
6
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
9
- # Stan Smith 2014-12-23 refactored to drop physical address elements if no
10
- # ... deliveryPoints are provided
11
- # Stan Smith 2014-12-22 added return if passed nil address objects
12
- # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
5
+ # Stan Smith 2016-11-18 refactored for mdTranslator/mdJson 2.0
6
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
9
+ # Stan Smith 2014-12-23 refactored to drop physical address elements if no
10
+ # ... deliveryPoints are provided
11
+ # Stan Smith 2014-12-22 added return if passed nil address objects
12
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
13
13
  # Stan Smith 2013-08-09 original script
14
14
 
15
15
  module ADIWG
16
- module Mdtranslator
17
- module Writers
18
- module Iso19115_2
19
-
20
- class CI_Address
21
-
22
- def initialize(xml, hResponseObj)
23
- @xml = xml
24
- @hResponseObj = hResponseObj
25
- end
26
-
27
- def writeXML(hAddress, aEmail)
28
-
29
- @xml.tag!('gmd:CI_Address') do
30
-
31
-
32
- unless hAddress.nil?
33
-
34
- # address - address type (not used by ISO 19115-2)
35
-
36
- # address - description (not used by ISO 19115-2)
37
-
38
- # address - delivery points []
39
- aDeliveryPoints = hAddress[:deliveryPoints]
40
- aDeliveryPoints.each do |myPoint|
41
- @xml.tag!('gmd:deliveryPoint') do
42
- @xml.tag!('gco:CharacterString', myPoint)
43
- end
44
- end
45
- if aDeliveryPoints.empty? && @hResponseObj[:writerShowTags]
46
- @xml.tag!('gmd:deliveryPoint')
47
- end
48
-
49
- # address - city
50
- s = hAddress[:city]
51
- unless s.nil?
52
- @xml.tag!('gmd:city') do
53
- @xml.tag!('gco:CharacterString', s)
54
- end
55
- end
56
- if s.nil? && @hResponseObj[:writerShowTags]
57
- @xml.tag!('gmd:city')
58
- end
59
-
60
- # address - administrative area
61
- s = hAddress[:adminArea]
62
- unless s.nil?
63
- @xml.tag!('gmd:administrativeArea') do
64
- @xml.tag!('gco:CharacterString', s)
65
- end
66
- end
67
- if s.nil? && @hResponseObj[:writerShowTags]
68
- @xml.tag!('gmd:administrativeArea')
69
- end
70
-
71
- # address - postal code
72
- s = hAddress[:postalCode]
73
- unless s.nil?
74
- @xml.tag!('gmd:postalCode') do
75
- @xml.tag!('gco:CharacterString', s)
76
- end
77
- end
78
- if s.nil? && @hResponseObj[:writerShowTags]
79
- @xml.tag!('gmd:postalCode')
80
- end
81
-
82
- # address - country
83
- s = hAddress[:country]
84
- unless s.nil?
85
- @xml.tag!('gmd:country') do
86
- @xml.tag!('gco:CharacterString', s)
87
- end
88
- end
89
- if s.nil? && @hResponseObj[:writerShowTags]
90
- @xml.tag!('gmd:country')
91
- end
92
-
93
- end
94
-
95
- # address - email addresses []
96
- aEmail.each do |myEmail|
97
- @xml.tag!('gmd:electronicMailAddress') do
98
- @xml.tag!('gco:CharacterString', myEmail)
99
- end
100
- end
101
- if aEmail.empty? && @hResponseObj[:writerShowTags]
102
- @xml.tag!('gmd:electronicMailAddress')
103
- end
104
-
105
- end # CI_Address tag
106
- end # writeXML
107
- end # CI_Address class
108
-
109
- end
110
- end
111
- end
16
+ module Mdtranslator
17
+ module Writers
18
+ module Iso19115_2
19
+
20
+ class CI_Address
21
+
22
+ def initialize(xml, hResponseObj)
23
+ @xml = xml
24
+ @hResponseObj = hResponseObj
25
+ end
26
+
27
+ def writeXML(hAddress, aEmail)
28
+
29
+ @xml.tag!('gmd:CI_Address') do
30
+
31
+
32
+ unless hAddress.nil?
33
+
34
+ # address - address type (not used by ISO 19115-2)
35
+
36
+ # address - description (not used by ISO 19115-2)
37
+
38
+ # address - delivery points []
39
+ aDeliveryPoints = hAddress[:deliveryPoints]
40
+ aDeliveryPoints.each do |myPoint|
41
+ @xml.tag!('gmd:deliveryPoint') do
42
+ @xml.tag!('gco:CharacterString', myPoint)
43
+ end
44
+ end
45
+ if aDeliveryPoints.empty? && @hResponseObj[:writerShowTags]
46
+ @xml.tag!('gmd:deliveryPoint')
47
+ end
48
+
49
+ # address - city
50
+ s = hAddress[:city]
51
+ unless s.nil?
52
+ @xml.tag!('gmd:city') do
53
+ @xml.tag!('gco:CharacterString', s)
54
+ end
55
+ end
56
+ if s.nil? && @hResponseObj[:writerShowTags]
57
+ @xml.tag!('gmd:city')
58
+ end
59
+
60
+ # address - administrative area
61
+ s = hAddress[:adminArea]
62
+ unless s.nil?
63
+ @xml.tag!('gmd:administrativeArea') do
64
+ @xml.tag!('gco:CharacterString', s)
65
+ end
66
+ end
67
+ if s.nil? && @hResponseObj[:writerShowTags]
68
+ @xml.tag!('gmd:administrativeArea')
69
+ end
70
+
71
+ # address - postal code
72
+ s = hAddress[:postalCode]
73
+ unless s.nil?
74
+ @xml.tag!('gmd:postalCode') do
75
+ @xml.tag!('gco:CharacterString', s)
76
+ end
77
+ end
78
+ if s.nil? && @hResponseObj[:writerShowTags]
79
+ @xml.tag!('gmd:postalCode')
80
+ end
81
+
82
+ # address - country
83
+ s = hAddress[:country]
84
+ unless s.nil?
85
+ @xml.tag!('gmd:country') do
86
+ @xml.tag!('gco:CharacterString', s)
87
+ end
88
+ end
89
+ if s.nil? && @hResponseObj[:writerShowTags]
90
+ @xml.tag!('gmd:country')
91
+ end
92
+
93
+ end
94
+
95
+ # address - email addresses []
96
+ aEmail.each do |myEmail|
97
+ @xml.tag!('gmd:electronicMailAddress') do
98
+ @xml.tag!('gco:CharacterString', myEmail)
99
+ end
100
+ end
101
+ if aEmail.empty? && @hResponseObj[:writerShowTags]
102
+ @xml.tag!('gmd:electronicMailAddress')
103
+ end
104
+
105
+ end # CI_Address tag
106
+ end # writeXML
107
+ end # CI_Address class
108
+
109
+ end
110
+ end
111
+ end
112
112
  end
@@ -2,81 +2,84 @@
2
2
  # 19115-2 writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2016-11-23 refactored for mdTranslator/mdJson 2.0
6
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
9
- # Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
10
- # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
11
- # Stan Smith 2014-11-06 take initiativeType from internal initiativeType
12
- # ... rather than resourceType for 0.9.0
13
- # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
5
+ # Stan Smith 2018-04-09 add error and warning messaging
6
+ # Stan Smith 2016-11-23 refactored for mdTranslator/mdJson 2.0
7
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
8
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
9
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (hResponseObj)
10
+ # Stan Smith 2015-06-11 change all codelists to use 'class_codelist' method
11
+ # Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
12
+ # Stan Smith 2014-11-06 take initiativeType from internal initiativeType
13
+ # ... rather than resourceType for 0.9.0
14
+ # Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
14
15
  # Stan Smith 2014-05-29 original script
15
16
 
17
+ require_relative '../iso19115_2_writer'
16
18
  require_relative 'class_codelist'
17
19
  require_relative 'class_citation'
18
20
 
19
21
  module ADIWG
20
- module Mdtranslator
21
- module Writers
22
- module Iso19115_2
22
+ module Mdtranslator
23
+ module Writers
24
+ module Iso19115_2
23
25
 
24
- class MD_AggregateInformation
26
+ class MD_AggregateInformation
25
27
 
26
- def initialize(xml, hResponseObj)
27
- @xml = xml
28
- @hResponseObj = hResponseObj
29
- end
28
+ def initialize(xml, hResponseObj)
29
+ @xml = xml
30
+ @hResponseObj = hResponseObj
31
+ @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
32
+ end
30
33
 
31
- def writeXML(hAssocRes)
34
+ def writeXML(hAssocRes)
32
35
 
33
- # classes used
34
- codelistClass = MD_Codelist.new(@xml, @hResponseObj)
35
- citationClass = CI_Citation.new(@xml, @hResponseObj)
36
+ # classes used
37
+ codelistClass = MD_Codelist.new(@xml, @hResponseObj)
38
+ citationClass = CI_Citation.new(@xml, @hResponseObj)
36
39
 
37
- @xml.tag!('gmd:MD_AggregateInformation') do
40
+ @xml.tag!('gmd:MD_AggregateInformation') do
38
41
 
39
- # aggregate information - aggregate data set name {citation}
40
- hAssocCit = hAssocRes[:resourceCitation]
41
- unless hAssocCit.empty?
42
- @xml.tag!('gmd:aggregateDataSetName') do
43
- citationClass.writeXML(hAssocCit)
44
- end
45
- end
46
- if hAssocCit.empty? && @hResponseObj[:writerShowTags]
47
- @xml.tag!('gmd:aggregateDataSetName')
48
- end
42
+ # aggregate information - aggregate data set name {citation}
43
+ hAssocCit = hAssocRes[:resourceCitation]
44
+ unless hAssocCit.empty?
45
+ @xml.tag!('gmd:aggregateDataSetName') do
46
+ citationClass.writeXML(hAssocCit, 'associated resource')
47
+ end
48
+ end
49
+ if hAssocCit.empty? && @hResponseObj[:writerShowTags]
50
+ @xml.tag!('gmd:aggregateDataSetName')
51
+ end
49
52
 
50
- # aggregate information - aggregate data set identifier (use citation > identifier)
51
- # data set identifier was dropped from 19115-1
53
+ # aggregate information - aggregate data set identifier (use citation > identifier)
54
+ # data set identifier was dropped from 19115-1 and not carried in mdJson
52
55
 
53
- # aggregate information - association type (required)
54
- s = hAssocRes[:associationType]
55
- unless s.nil?
56
- @xml.tag!('gmd:associationType') do
57
- codelistClass.writeXML('gmd', 'iso_associationType',s)
58
- end
59
- end
60
- if s.nil? && @hResponseObj[:writerShowTags]
61
- @xml.tag!('gmd:associationType')
62
- end
56
+ # aggregate information - association type (required)
57
+ s = hAssocRes[:associationType]
58
+ unless s.nil?
59
+ @xml.tag!('gmd:associationType') do
60
+ codelistClass.writeXML('gmd', 'iso_associationType', s)
61
+ end
62
+ end
63
+ if s.nil?
64
+ @NameSpace.issueWarning(1, 'gmd:associationType')
65
+ end
63
66
 
64
- # aggregate information - initiative type
65
- s = hAssocRes[:initiativeType]
66
- unless s.nil?
67
- @xml.tag!('gmd:initiativeType') do
68
- codelistClass.writeXML('gmd', 'iso_initiativeType',s)
69
- end
70
- end
71
- if s.nil? && @hResponseObj[:writerShowTags]
72
- @xml.tag!('gmd:initiativeType')
73
- end
67
+ # aggregate information - initiative type
68
+ s = hAssocRes[:initiativeType]
69
+ unless s.nil?
70
+ @xml.tag!('gmd:initiativeType') do
71
+ codelistClass.writeXML('gmd', 'iso_initiativeType', s)
72
+ end
73
+ end
74
+ if s.nil? && @hResponseObj[:writerShowTags]
75
+ @xml.tag!('gmd:initiativeType')
76
+ end
74
77
 
75
- end # MD_AggregateInformation tag
76
- end # writeXML
77
- end # MD_AggregateInformation class
78
+ end # MD_AggregateInformation tag
79
+ end # writeXML
80
+ end # MD_AggregateInformation class
78
81
 
79
- end
80
- end
81
- end
82
+ end
83
+ end
84
+ end
82
85
  end
@@ -13,7 +13,7 @@ module ADIWG
13
13
  module Writers
14
14
  module Iso19115_2
15
15
 
16
- class AttributeGroup
16
+ class Attribute
17
17
 
18
18
  def initialize(xml, hResponseObj)
19
19
  @xml = xml
@@ -5,34 +5,34 @@
5
5
  # Stan Smith 2015-08-27 copied from 19110 writer
6
6
 
7
7
  module ADIWG
8
- module Mdtranslator
9
- module Writers
10
- module Iso19115_2
8
+ module Mdtranslator
9
+ module Writers
10
+ module Iso19115_2
11
11
 
12
- class BaseUnit
12
+ class BaseUnit
13
13
 
14
- def initialize(xml, hResponseObj)
15
- @xml = xml
16
- @hResponseObj = hResponseObj
17
- end
14
+ def initialize(xml, hResponseObj)
15
+ @xml = xml
16
+ @hResponseObj = hResponseObj
17
+ end
18
18
 
19
- def writeXML(hBase)
19
+ def writeXML(hBase)
20
20
 
21
- # create and identity for the unit
22
- @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
23
- unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
24
- @xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
25
- @xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
26
- @xml.tag!('gml:name', hBase[:name])
27
- @xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
28
- @xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
29
- end
21
+ # create and identity for the unit
22
+ @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
23
+ unitID = 'unit' + @hResponseObj[:writerMissingIdCount]
24
+ @xml.tag!('gml:BaseUnit', {'gml:id' => unitID}) do
25
+ @xml.tag!('gml:identifier', {'codeSpace' => hBase[:codeSpace]}, hBase[:identifier])
26
+ @xml.tag!('gml:name', hBase[:name])
27
+ @xml.tag!('gml:catalogSymbol', hBase[:catalogSymbol])
28
+ @xml.tag!('gml:unitsSystem', {'xlink:href' => hBase[:unitsSystem]})
29
+ end
30
30
 
31
- end
32
-
33
- end
31
+ end
34
32
 
35
33
  end
36
- end
37
- end
34
+
35
+ end
36
+ end
37
+ end
38
38
  end