adiwg-mdtranslator 2.10.0 → 2.12.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +20 -1
  3. data/adiwg-mdtranslator.gemspec +1 -1
  4. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
  8. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
  9. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
  10. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
  11. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
  16. data/lib/adiwg/mdtranslator/version.rb +8 -1
  17. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
  18. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
  19. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
  20. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
  21. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
  22. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
  23. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
  24. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
  25. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
  26. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
  27. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
  28. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
  29. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
  30. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
  31. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
  32. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
  33. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
  34. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
  35. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
  36. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
  37. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
  38. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
  39. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
  40. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
  41. data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
  42. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
  43. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
  44. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
  45. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
  46. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
  47. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
  48. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
  49. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
  50. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
  51. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
  52. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
  53. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
  54. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
  55. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
  56. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
  57. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
  58. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
  59. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
  60. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
  61. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
  62. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
  63. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
  64. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
  65. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
  66. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
  67. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
  68. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
  69. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
  70. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
  71. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
  72. data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
  73. data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
  74. data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
  75. data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
  76. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
  77. data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
  78. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
  79. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
  80. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
  81. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
  82. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
  83. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
  84. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
  85. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
  86. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
  87. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
  88. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
  89. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
  90. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
  91. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
  92. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
  93. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
  94. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
  95. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
  96. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
  97. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
  98. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
  99. data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
  100. data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
  101. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
  102. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
  103. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
  104. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
  105. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
  106. data/lib/adiwg/mdtranslator_cli.rb +18 -8
  107. metadata +14 -8
  108. data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -2,18 +2,22 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-20 refactored error and warning messaging
5
6
  # Stan Smith 2018-01-02 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
10
13
  module Fgdc
11
14
 
12
- class MapProjection
15
+ class MapProjectionTags
13
16
 
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
23
  # map projection 4.1.2.1.1 (mapprojn) - projection name (required)
@@ -22,8 +26,7 @@ module ADIWG
22
26
  @xml.tag!('mapprojn', projectionName)
23
27
  end
24
28
  if projectionName.nil?
25
- @hResponseObj[:writerPass] = false
26
- @hResponseObj[:writerMessages] << 'Map Projection is missing projection name'
29
+ @NameSpace.issueWarning(280, 'mapprojn')
27
30
  end
28
31
  end
29
32
 
@@ -44,15 +47,13 @@ module ADIWG
44
47
  @xml.tag!('feast', hProjection[:falseEasting].to_s)
45
48
  end
46
49
  if hProjection[:falseEasting].nil?
47
- @hResponseObj[:writerPass] = false
48
- @hResponseObj[:writerMessages] << 'Map Projection is missing false easting'
50
+ @NameSpace.issueError(281, "#{hProjection[:projectionName]} projection")
49
51
  end
50
52
  unless hProjection[:falseNorthing].nil?
51
53
  @xml.tag!('fnorth', hProjection[:falseNorthing].to_s)
52
54
  end
53
55
  if hProjection[:falseNorthing].nil?
54
- @hResponseObj[:writerPass] = false
55
- @hResponseObj[:writerMessages] << 'Map Projection is missing false northing'
56
+ @NameSpace.issueError(282, "#{hProjection[:projectionName]} projection")
56
57
  end
57
58
  end
58
59
 
@@ -68,8 +69,7 @@ module ADIWG
68
69
  haveParallel = true
69
70
  end
70
71
  unless haveParallel
71
- @hResponseObj[:writerPass] = false
72
- @hResponseObj[:writerMessages] << 'Map Projection is missing standard parallel'
72
+ @NameSpace.issueError(283, "#{hProjection[:projectionName]} projection")
73
73
  end
74
74
  end
75
75
 
@@ -79,8 +79,7 @@ module ADIWG
79
79
  @xml.tag!('longcm', hProjection[:longitudeOfCentralMeridian].to_s)
80
80
  end
81
81
  if hProjection[:longitudeOfCentralMeridian].nil?
82
- @hResponseObj[:writerPass] = false
83
- @hResponseObj[:writerMessages] << 'Map Projection is missing longitude of central meridian'
82
+ @NameSpace.issueError(284, "#{hProjection[:projectionName]} projection")
84
83
  end
85
84
  end
86
85
 
@@ -90,8 +89,7 @@ module ADIWG
90
89
  @xml.tag!('latprjo', hProjection[:latitudeOfProjectionOrigin].to_s)
91
90
  end
92
91
  if hProjection[:latitudeOfProjectionOrigin].nil?
93
- @hResponseObj[:writerPass] = false
94
- @hResponseObj[:writerMessages] << 'Map Projection is missing latitude of projection origin'
92
+ @NameSpace.issueError(285, "#{hProjection[:projectionName]} projection")
95
93
  end
96
94
  end
97
95
 
@@ -101,8 +99,7 @@ module ADIWG
101
99
  @xml.tag!('heightpt', hProjection[:heightOfProspectivePointAboveSurface].to_s)
102
100
  end
103
101
  if hProjection[:heightOfProspectivePointAboveSurface].nil?
104
- @hResponseObj[:writerPass] = false
105
- @hResponseObj[:writerMessages] << 'Map Projection is missing height of perspective point above surface'
102
+ @NameSpace.issueError(286, "#{hProjection[:projectionName]} projection")
106
103
  end
107
104
  end
108
105
 
@@ -112,8 +109,7 @@ module ADIWG
112
109
  @xml.tag!('longpc', hProjection[:longitudeOfProjectionCenter].to_s)
113
110
  end
114
111
  if hProjection[:longitudeOfProjectionCenter].nil?
115
- @hResponseObj[:writerPass] = false
116
- @hResponseObj[:writerMessages] << 'Map Projection is missing longitude of projection center'
112
+ @NameSpace.issueError(287, "#{hProjection[:projectionName]} projection")
117
113
  end
118
114
  end
119
115
 
@@ -123,8 +119,7 @@ module ADIWG
123
119
  @xml.tag!('latprjc', hProjection[:latitudeOfProjectionCenter].to_s)
124
120
  end
125
121
  if hProjection[:latitudeOfProjectionCenter].nil?
126
- @hResponseObj[:writerPass] = false
127
- @hResponseObj[:writerMessages] << 'Map Projection is missing latitude of projection center'
122
+ @NameSpace.issueError(288, "#{hProjection[:projectionName]} projection")
128
123
  end
129
124
  end
130
125
 
@@ -134,8 +129,7 @@ module ADIWG
134
129
  @xml.tag!('sfequat', hProjection[:scaleFactorAtEquator].to_s)
135
130
  end
136
131
  if hProjection[:scaleFactorAtEquator].nil?
137
- @hResponseObj[:writerPass] = false
138
- @hResponseObj[:writerMessages] << 'Map Projection is missing scale factor at equator'
132
+ @NameSpace.issueError(289, "#{hProjection[:projectionName]} projection")
139
133
  end
140
134
  end
141
135
 
@@ -145,8 +139,7 @@ module ADIWG
145
139
  @xml.tag!('sfctrlin', hProjection[:scaleFactorAtCenterLine].to_s)
146
140
  end
147
141
  if hProjection[:scaleFactorAtCenterLine].nil?
148
- @hResponseObj[:writerPass] = false
149
- @hResponseObj[:writerMessages] << 'Map Projection is missing scale factor at center line'
142
+ @NameSpace.issueError(290, "#{hProjection[:projectionName]} projection")
150
143
  end
151
144
  end
152
145
 
@@ -156,8 +149,7 @@ module ADIWG
156
149
  @xml.tag!('sfprjorg', hProjection[:scaleFactorAtProjectionOrigin].to_s)
157
150
  end
158
151
  if hProjection[:scaleFactorAtProjectionOrigin].nil?
159
- @hResponseObj[:writerPass] = false
160
- @hResponseObj[:writerMessages] << 'Map Projection is missing scale factor at projection origin'
152
+ @NameSpace.issueError(291, "#{hProjection[:projectionName]} projection")
161
153
  end
162
154
  end
163
155
 
@@ -167,8 +159,7 @@ module ADIWG
167
159
  @xml.tag!('sfctrmer', hProjection[:scaleFactorAtCentralMeridian].to_s)
168
160
  end
169
161
  if hProjection[:scaleFactorAtCentralMeridian].nil?
170
- @hResponseObj[:writerPass] = false
171
- @hResponseObj[:writerMessages] << 'Map Projection is missing scale factor at central meridian'
162
+ @NameSpace.issueError(292, "#{hProjection[:projectionName]} projection")
172
163
  end
173
164
  end
174
165
 
@@ -183,21 +174,18 @@ module ADIWG
183
174
  @xml.tag!('azimangl', hProjection[:azimuthAngle].to_s)
184
175
  end
185
176
  if hProjection[:azimuthAngle].nil?
186
- @hResponseObj[:writerPass] = false
187
- @hResponseObj[:writerMessages] << 'Map Projection is missing oblique line azimuth angle'
177
+ @NameSpace.issueError(293, "#{hProjection[:projectionName]} projection")
188
178
  end
189
179
  unless hProjection[:azimuthMeasurePointLongitude].nil?
190
180
  @xml.tag!('azimptl', hProjection[:azimuthMeasurePointLongitude].to_s)
191
181
  end
192
182
  if hProjection[:azimuthMeasurePointLongitude].nil?
193
- @hResponseObj[:writerPass] = false
194
- @hResponseObj[:writerMessages] << 'Map Projection is missing oblique line measure point longitude'
183
+ @NameSpace.issueError(294, "#{hProjection[:projectionName]} projection")
195
184
  end
196
185
  end
197
186
  end
198
187
  unless haveLA
199
- @hResponseObj[:writerPass] = false
200
- @hResponseObj[:writerMessages] << 'Map Projection is missing oblique line azimuth information'
188
+ @NameSpace.issueError(295, "#{hProjection[:projectionName]} projection")
201
189
  end
202
190
  end
203
191
 
@@ -207,15 +195,13 @@ module ADIWG
207
195
  @xml.tag!('obqllat', hLinePt[:azimuthLineLatitude])
208
196
  end
209
197
  if hLinePt[:azimuthLineLatitude].nil?
210
- @hResponseObj[:writerPass] = false
211
- @hResponseObj[:writerMessages] << 'Map Projection is missing oblique line point latitude'
198
+ @NameSpace.issueError(296, 'oblique line-point projection')
212
199
  end
213
200
  unless hLinePt[:azimuthLineLongitude].nil?
214
201
  @xml.tag!('obqllong', hLinePt[:azimuthLineLongitude])
215
202
  end
216
203
  if hLinePt[:azimuthLineLongitude].nil?
217
- @hResponseObj[:writerPass] = false
218
- @hResponseObj[:writerMessages] << 'Map Projection is missing oblique line point longitude'
204
+ @NameSpace.issueError(297, 'oblique line-point projection')
219
205
  end
220
206
  end
221
207
 
@@ -225,8 +211,7 @@ module ADIWG
225
211
  @xml.tag!('svlong', hProjection[:straightVerticalLongitudeFromPole].to_s)
226
212
  end
227
213
  if hProjection[:straightVerticalLongitudeFromPole].nil?
228
- @hResponseObj[:writerPass] = false
229
- @hResponseObj[:writerMessages] << 'Map Projection is missing straight vertical longitude from pole'
214
+ @NameSpace.issueError(298, "#{hProjection[:projectionName]} projection")
230
215
  end
231
216
  end
232
217
 
@@ -236,8 +221,7 @@ module ADIWG
236
221
  @xml.tag!('landsat', hProjection[:landsatNumber].to_s)
237
222
  end
238
223
  if hProjection[:landsatNumber].nil?
239
- @hResponseObj[:writerPass] = false
240
- @hResponseObj[:writerMessages] << 'Map Projection is missing Landsat number'
224
+ @NameSpace.issueError(299, "#{hProjection[:projectionName]} projection")
241
225
  end
242
226
  end
243
227
 
@@ -247,8 +231,7 @@ module ADIWG
247
231
  @xml.tag!('pathnum', hProjection[:landsatPath].to_s)
248
232
  end
249
233
  if hProjection[:landsatPath].nil?
250
- @hResponseObj[:writerPass] = false
251
- @hResponseObj[:writerMessages] << 'Map Projection is missing Landsat path number'
234
+ @NameSpace.issueError(300, "#{hProjection[:projectionName]} projection")
252
235
  end
253
236
  end
254
237
 
@@ -258,8 +241,7 @@ module ADIWG
258
241
  @xml.tag!('otherprj', hProjection[:otherProjectionDescription])
259
242
  end
260
243
  if hProjection[:otherProjectionDescription].nil?
261
- @hResponseObj[:writerPass] = false
262
- @hResponseObj[:writerMessages] << 'Map Projection is missing other projection description'
244
+ @NameSpace.issueError(301, "#{hProjection[:projectionName]} projection")
263
245
  end
264
246
  end
265
247
 
@@ -306,8 +288,7 @@ module ADIWG
306
288
  @xml.tag!('utmzone', hProjection[:gridZone])
307
289
  end
308
290
  if hProjection[:gridZone].nil?
309
- @hResponseObj[:writerPass] = false
310
- @hResponseObj[:writerMessages] << 'UTM Projection is missing zone number'
291
+ @NameSpace.issueError(310, 'grid system')
311
292
  end
312
293
  end
313
294
 
@@ -317,8 +298,7 @@ module ADIWG
317
298
  @xml.tag!('upszone', hProjection[:gridZone])
318
299
  end
319
300
  if hProjection[:gridZone].nil?
320
- @hResponseObj[:writerPass] = false
321
- @hResponseObj[:writerMessages] << 'UPS Projection is missing zone number'
301
+ @NameSpace.issueError(311, 'grid system')
322
302
  end
323
303
  end
324
304
 
@@ -328,8 +308,7 @@ module ADIWG
328
308
  @xml.tag!('spcszone', hProjection[:gridZone])
329
309
  end
330
310
  if hProjection[:gridZone].nil?
331
- @hResponseObj[:writerPass] = false
332
- @hResponseObj[:writerMessages] << 'State Plane Coordinate System is missing zone number'
311
+ @NameSpace.issueError(312, 'grid system')
333
312
  end
334
313
  end
335
314
 
@@ -339,8 +318,7 @@ module ADIWG
339
318
  @xml.tag!('arczone', hProjection[:gridZone])
340
319
  end
341
320
  if hProjection[:gridZone].nil?
342
- @hResponseObj[:writerPass] = false
343
- @hResponseObj[:writerMessages] << 'Equal arc-second Coordinate System is missing zone number'
321
+ @NameSpace.issueError(313, 'grid system')
344
322
  end
345
323
  end
346
324
 
@@ -350,8 +328,7 @@ module ADIWG
350
328
  @xml.tag!('localpd', hProjection[:localPlanarDescription])
351
329
  end
352
330
  if hProjection[:localPlanarDescription].nil?
353
- @hResponseObj[:writerPass] = false
354
- @hResponseObj[:writerMessages] << 'Local Planar Coordinate System is missing description'
331
+ @NameSpace.issueError(302, "#{hProjection[:projectionName]}")
355
332
  end
356
333
  end
357
334
 
@@ -361,8 +338,7 @@ module ADIWG
361
338
  @xml.tag!('localpgi', hProjection[:localPlanarGeoreference])
362
339
  end
363
340
  if hProjection[:localPlanarGeoreference].nil?
364
- @hResponseObj[:writerPass] = false
365
- @hResponseObj[:writerMessages] << 'Local Planar Coordinate System is missing georeference information'
341
+ @NameSpace.issueError(303, "#{hProjection[:projectionName]}")
366
342
  end
367
343
  end
368
344
 
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-23 refactored error and warning messaging
5
6
  # Stan Smith 2018-01-26 original script
6
7
 
7
8
  require_relative '../fgdc_writer'
@@ -17,6 +18,7 @@ module ADIWG
17
18
  def initialize(xml, hResponseObj)
18
19
  @xml = xml
19
20
  @hResponseObj = hResponseObj
21
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
20
22
  end
21
23
 
22
24
  def writeXML(hMetadataInfo)
@@ -44,8 +46,7 @@ module ADIWG
44
46
  end
45
47
  end
46
48
  unless haveCreation
47
- @hResponseObj[:writerPass] = false
48
- @hResponseObj[:writerMessages] << 'Metadata Information section is missing creation date'
49
+ @NameSpace.issueWarning(320, nil, 'metadata information section')
49
50
  end
50
51
 
51
52
  # metadata information 7.2 (metrd) - metadata review date
@@ -98,9 +99,9 @@ module ADIWG
98
99
  # <- metadataInfo.metadataContacts[] role = 'pointOfContact'
99
100
  unless hMetadataInfo[:metadataContacts].empty?
100
101
  aRParties = hMetadataInfo[:metadataContacts]
101
- aParties = ADIWG::Mdtranslator::Writers::Fgdc.find_responsibility(aRParties, 'pointOfContact')
102
+ aParties = @NameSpace.find_responsibility(aRParties, 'pointOfContact')
102
103
  unless aParties.empty?
103
- hContact = ADIWG::Mdtranslator::Writers::Fgdc.get_contact(aParties[0])
104
+ hContact = @NameSpace.get_contact(aParties[0])
104
105
  unless hContact.empty?
105
106
  @xml.tag!('metc') do
106
107
  contactClass.writeXML(hContact)
@@ -109,8 +110,7 @@ module ADIWG
109
110
  end
110
111
  end
111
112
  if hMetadataInfo[:metadataContacts].empty?
112
- @hResponseObj[:writerPass] = false
113
- @hResponseObj[:writerMessages] << 'Metadata Information section is missing metadata contact'
113
+ @NameSpace.issueWarning(321, nil, 'metadata information section')
114
114
  end
115
115
 
116
116
  # metadata information 7.5 (metstdn) - metadata standard name (required)
@@ -174,8 +174,7 @@ module ADIWG
174
174
  @xml.tag!('metscs', hSecurity[:classSystem])
175
175
  end
176
176
  if hSecurity[:classSystem].nil?
177
- @hResponseObj[:writerPass] = false
178
- @hResponseObj[:writerMessages] << 'Metadata Security Information section is missing classification system'
177
+ @NameSpace.issueWarning(340, 'metscs', 'metadata information section')
179
178
  end
180
179
 
181
180
  # security information 10.7.2 (metsc) - metadata security classification (required)
@@ -184,8 +183,7 @@ module ADIWG
184
183
  @xml.tag!('metsc', hSecurity[:classCode])
185
184
  end
186
185
  if hSecurity[:classCode].nil?
187
- @hResponseObj[:writerPass] = false
188
- @hResponseObj[:writerMessages] << 'Metadata Security Information section is missing classification'
186
+ @NameSpace.issueWarning(341, 'metsc', 'metadata information section')
189
187
  end
190
188
 
191
189
  # security information 10.7.3 (metshd) - metadata security classification (required)
@@ -194,8 +192,7 @@ module ADIWG
194
192
  @xml.tag!('metshd', hSecurity[:handling])
195
193
  end
196
194
  if hSecurity[:handling].nil?
197
- @hResponseObj[:writerPass] = false
198
- @hResponseObj[:writerMessages] << 'Metadata Security Information section is missing handling instructions'
195
+ @NameSpace.issueWarning(342, 'metshd', 'metadata information section')
199
196
  end
200
197
 
201
198
  end
@@ -2,6 +2,7 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-19 refactored error and warning messaging
5
6
  # Stan Smith 2017-12-20 original script
6
7
 
7
8
  require_relative '../fgdc_writer'
@@ -18,15 +19,16 @@ module ADIWG
18
19
  def initialize(xml, hResponseObj)
19
20
  @xml = xml
20
21
  @hResponseObj = hResponseObj
22
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
21
23
  end
22
24
 
23
25
  def writeXML(hLineage)
24
-
26
+
25
27
  # classes used
26
28
  keywordClass = MethodKeyword.new(@xml, @hResponseObj)
27
29
  citationClass = Citation.new(@xml, @hResponseObj)
28
30
 
29
- hIntObj = ADIWG::Mdtranslator::Writers::Fgdc.get_intObj
31
+ hIntObj = @NameSpace.get_intObj
30
32
  haveMethod = false
31
33
  haveMethod = true unless hLineage[:statement].nil?
32
34
  haveMethod = true unless hLineage[:lineageCitation].empty?
@@ -46,8 +48,7 @@ module ADIWG
46
48
  @xml.tag!('methtype', hLineage[:statement])
47
49
  end
48
50
  if hLineage[:statement].nil?
49
- @hResponseObj[:writerPass] = false
50
- @hResponseObj[:writerMessages] << 'Lineage Method is missing type and/or description'
51
+ @NameSpace.issueWarning(210, 'methtype')
51
52
  end
52
53
 
53
54
  # methodology bio (methodid) - method id [] {keywords} (required)
@@ -60,8 +61,7 @@ module ADIWG
60
61
  @xml.tag!('methdesc', hLineage[:statement])
61
62
  end
62
63
  if hLineage[:statement].nil?
63
- @hResponseObj[:writerPass] = false
64
- @hResponseObj[:writerMessages] << 'Lineage Method is missing type and/or description'
64
+ @NameSpace.issueWarning(211, 'methdesc')
65
65
  end
66
66
 
67
67
  # methodology bio (methcite) - method citation [] (required)
@@ -74,8 +74,7 @@ module ADIWG
74
74
  end
75
75
  end
76
76
  if hLineage[:lineageCitation].empty?
77
- @hResponseObj[:writerPass] = false
78
- @hResponseObj[:writerMessages] << 'Lineage Method is missing citation'
77
+ @NameSpace.issueWarning(212, nil)
79
78
  end
80
79
 
81
80
  end
@@ -2,8 +2,11 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-19 refactored error and warning messaging
5
6
  # Stan Smith 2017-12-20 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
@@ -14,23 +17,29 @@ module ADIWG
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
23
  def writeXML(aKeywords)
20
-
24
+
21
25
  # method bio (methodid) - lineage method keywords (required)
22
26
  haveMethod = false
23
27
  aKeywords.each do |hKeySet|
24
28
  type = hKeySet[:keywordType]
25
29
  if type == 'method'
26
30
  aKeywords = hKeySet[:keywords]
27
- thesaurus = hKeySet[:thesaurus]
28
- if thesaurus.empty?
29
- @hResponseObj[:writerPass] = false
30
- @hResponseObj[:writerMessages] << 'Lineage Method Keyword Set is missing thesaurus'
31
+ hThesaurus = hKeySet[:thesaurus]
32
+ thesaurusName = nil
33
+ unless hThesaurus.empty?
34
+ thesaurusName = hThesaurus[:title]
31
35
  end
32
36
  @xml.tag!('methodid') do
33
- @xml.tag!('methkt', thesaurus[:title])
37
+ unless thesaurusName.empty?
38
+ @xml.tag!('methkt', thesaurusName)
39
+ end
40
+ if thesaurusName.empty?
41
+ @NameSpace.issueWarning(221, 'methkt')
42
+ end
34
43
  aKeywords.each do |hKeyword|
35
44
  keyword = hKeyword[:keyword]
36
45
  unless keyword.nil?
@@ -42,8 +51,7 @@ module ADIWG
42
51
  end
43
52
  end
44
53
  unless haveMethod
45
- @hResponseObj[:writerPass] = false
46
- @hResponseObj[:writerMessages] << 'Lineage Method is missing keyword set'
54
+ @NameSpace.issueWarning(220, nil)
47
55
  end
48
56
 
49
57
  end # writeXML
@@ -2,8 +2,11 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-16 refactored error and warning messaging
5
6
  # Stan Smith 2018-01-31 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
@@ -14,9 +17,10 @@ module ADIWG
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
- def writeXML(hOffline)
23
+ def writeXML(hOffline, inContext)
20
24
 
21
25
  # offline option 6.4.2.2.2.1 (offmedia) - offline media name (required)
22
26
  # <- hOffline.mediaSpecification.title
@@ -28,8 +32,7 @@ module ADIWG
28
32
  end
29
33
  end
30
34
  unless haveTitle
31
- @hResponseObj[:writerPass] = false
32
- @hResponseObj[:writerMessages] << 'Offline Option is missing media name'
35
+ @NameSpace.issueWarning(120,'offmedia', inContext)
33
36
  end
34
37
 
35
38
  # offline option 6.4.2.2.2.2 (reccap) - recording capacity (compound)
@@ -38,26 +41,28 @@ module ADIWG
38
41
  haveCapacity = true unless hOffline[:density].nil?
39
42
  haveCapacity = true unless hOffline[:units].nil?
40
43
  if haveCapacity
44
+ @xml.tag!('reccap') do
41
45
 
42
- # recording capacity 6.4.2.2.2.2.1 (recden) - recording density
43
- unless hOffline[:density].nil?
44
- @xml.tag!('recden', hOffline[:density])
45
- end
46
- if hOffline[:density].nil? && @hResponseObj[:writerShowTags]
47
- @xml.tag!('recden')
48
- end
46
+ # recording capacity 6.4.2.2.2.2.1 (recden) - recording density (required)
47
+ unless hOffline[:density].nil?
48
+ @xml.tag!('recden', hOffline[:density])
49
+ end
50
+ if hOffline[:density].nil?
51
+ @NameSpace.issueWarning(121,'recden', inContext)
52
+ end
49
53
 
50
- # recording capacity 6.4.2.2.2.2.2 (recdenu) - recording density units
51
- unless hOffline[:units].nil?
52
- @xml.tag!('recdenu', hOffline[:units])
53
- end
54
- if hOffline[:units].nil? && @hResponseObj[:writerShowTags]
55
- @xml.tag!('recdenu')
56
- end
54
+ # recording capacity 6.4.2.2.2.2.2 (recdenu) - recording density units (required)
55
+ unless hOffline[:units].nil?
56
+ @xml.tag!('recdenu', hOffline[:units])
57
+ end
58
+ if hOffline[:units].nil?
59
+ @NameSpace.issueWarning(122,'recdenu', inContext)
60
+ end
57
61
 
62
+ end
58
63
  end
59
64
 
60
- # offline option 6.4.2.2.2.3 (recfmt) - recording format []
65
+ # offline option 6.4.2.2.2.3 (recfmt) - recording format [] (required)
61
66
  # <- hOffline.mediumFormat[]
62
67
  hOffline[:mediumFormat].each do |format|
63
68
  unless format == ''
@@ -65,7 +70,7 @@ module ADIWG
65
70
  end
66
71
  end
67
72
  if hOffline[:mediumFormat].empty?
68
- @xml.tag!('recfmt')
73
+ @NameSpace.issueWarning(123,'recfmt', inContext)
69
74
  end
70
75
 
71
76
  # offline option 6.4.2.2.2.4 (compat) - compatibility information
@@ -2,8 +2,11 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-16 refactored error and warning messaging
5
6
  # Stan Smith 2018-01-31 original script
6
7
 
8
+ require_relative '../fgdc_writer'
9
+
7
10
  module ADIWG
8
11
  module Mdtranslator
9
12
  module Writers
@@ -14,10 +17,11 @@ module ADIWG
14
17
  def initialize(xml, hResponseObj)
15
18
  @xml = xml
16
19
  @hResponseObj = hResponseObj
20
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
17
21
  end
18
22
 
19
- def writeXML(hOnline)
20
-
23
+ def writeXML(hOnline, inContext)
24
+
21
25
  # online option 6.4.2.2.1.1 (computer) - computer contact information (compound)
22
26
  @xml.tag!('computer') do
23
27
 
@@ -30,8 +34,7 @@ module ADIWG
30
34
  @xml.tag!('networkr', hOnline[:olResURI])
31
35
  end
32
36
  if hOnline[:olResURI].nil?
33
- @hResponseObj[:writerPass] = false
34
- @hResponseObj[:writerMessages] << 'Online Option is missing network address'
37
+ @NameSpace.issueWarning(130,'networkr', 'distribution')
35
38
  end
36
39
 
37
40
  end
@@ -2,8 +2,10 @@
2
2
  # FGDC CSDGM writer output in XML
3
3
 
4
4
  # History:
5
+ # Stan Smith 2018-03-16 refactored error and warning messaging
5
6
  # Stan Smith 2018-01-31 original script
6
7
 
8
+ require_relative '../fgdc_writer'
7
9
  require_relative 'class_digitalForm'
8
10
 
9
11
  module ADIWG
@@ -16,9 +18,10 @@ module ADIWG
16
18
  def initialize(xml, hResponseObj)
17
19
  @xml = xml
18
20
  @hResponseObj = hResponseObj
21
+ @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc
19
22
  end
20
23
 
21
- def writeXML(hDistributor)
24
+ def writeXML(hDistributor, inContext)
22
25
 
23
26
  # classes used
24
27
  digiClass = DigitalFormat.new(@xml, @hResponseObj)
@@ -60,19 +63,19 @@ module ADIWG
60
63
  # handles transferOptions for online and offline options
61
64
  aTransfer.each do |hTransOpt|
62
65
  @xml.tag!('digform') do
63
- digiClass.writeXML(hTransOpt)
66
+ digiClass.writeXML(hTransOpt, inContext)
64
67
  end
65
68
  end
66
69
  if aTransfer.empty? && @hResponseObj[:writerShowTags]
67
70
  @xml.tag!('digform')
68
71
  end
69
72
 
70
- # order process 6.4.3 (fees) - fees
73
+ # order process 6.4.3 (fees) - fees (required)
71
74
  unless hOrder[:fees].nil?
72
75
  @xml.tag!('fees', hOrder[:fees])
73
76
  end
74
- if hOrder[:fees].nil? && @hResponseObj[:writerShowTags]
75
- @xml.tag!('fees')
77
+ if hOrder[:fees].nil?
78
+ @NameSpace.issueWarning(140,'fees', 'distribution')
76
79
  end
77
80
 
78
81
  # order process 6.4.4 (ordering) - order instructions