adiwg-mdtranslator 2.8.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +552 -500
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +1 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_contact.rb +63 -16
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_distribution.rb +7 -16
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +1 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +1 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_fgdc.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +4 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_metadataInfo.rb +4 -3
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +15 -11
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_constraint.rb +134 -134
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_dataDictionary.rb +9 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_distribution.rb +52 -36
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domainItem.rb +65 -51
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataInfo.rb +133 -121
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +1 -1
- data/lib/adiwg/mdtranslator/version.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +122 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +66 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +81 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +156 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +78 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +48 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +41 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +215 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +86 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +77 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +100 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +135 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/html/sections/html_distribution.rb +18 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_domainItem.rb +18 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_metadataInfo.rb +20 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +14 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +21 -2
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_distribution.rb +44 -44
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_legalConstraints.rb +67 -66
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_mdIdentifier.rb +53 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +51 -23
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_dictionary.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_distribution.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domainItem.rb +4 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadataInfo.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_rights.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_sbJson.rb +12 -1
- metadata +16 -4
@@ -5,6 +5,8 @@
|
|
5
5
|
# Stan Smith 2017-04-05 refactored for mdTranslator 2.0
|
6
6
|
# Stan Smith 2015-03-26 original script
|
7
7
|
|
8
|
+
require_relative 'html_citation'
|
9
|
+
|
8
10
|
module ADIWG
|
9
11
|
module Mdtranslator
|
10
12
|
module Writers
|
@@ -18,21 +20,24 @@ module ADIWG
|
|
18
20
|
|
19
21
|
def writeHtml(hItem)
|
20
22
|
|
21
|
-
#
|
23
|
+
# classes used
|
24
|
+
citationClass = Html_Citation.new(@html)
|
25
|
+
|
26
|
+
# domain item - common name
|
22
27
|
unless hItem[:itemName].nil?
|
23
28
|
@html.em('Name: ')
|
24
29
|
@html.text!(hItem[:itemName])
|
25
30
|
@html.br
|
26
31
|
end
|
27
32
|
|
28
|
-
# domain
|
33
|
+
# domain item - value
|
29
34
|
unless hItem[:itemValue].nil?
|
30
35
|
@html.em('Value: ')
|
31
36
|
@html.text!(hItem[:itemValue])
|
32
37
|
@html.br
|
33
38
|
end
|
34
39
|
|
35
|
-
# domain
|
40
|
+
# domain item - definition
|
36
41
|
unless hItem[:itemDefinition].nil?
|
37
42
|
@html.em('Definition: ')
|
38
43
|
@html.section(:class => 'block') do
|
@@ -40,6 +45,16 @@ module ADIWG
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
48
|
+
# domain item - reference {citation}
|
49
|
+
unless hItem[:itemReference].empty?
|
50
|
+
@html.details do
|
51
|
+
@html.summary('Reference', {'class' => 'h5'})
|
52
|
+
@html.section(:class => 'block') do
|
53
|
+
citationClass.writeHtml(hItem[:itemReference])
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
43
58
|
end # writeHtml
|
44
59
|
end # Html_DomainItem
|
45
60
|
|
@@ -2,6 +2,7 @@
|
|
2
2
|
# metadata information section
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2018-01-27 add metadata constraints
|
5
6
|
# Stan Smith 2017-03-23 refactored for mdTranslator 2.0
|
6
7
|
# Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
|
7
8
|
# Stan Smith 2016-06-12 added metadata character set
|
@@ -13,6 +14,7 @@ require_relative 'html_locale'
|
|
13
14
|
require_relative 'html_responsibility'
|
14
15
|
require_relative 'html_date'
|
15
16
|
require_relative 'html_onlineResource'
|
17
|
+
require_relative 'html_constraint'
|
16
18
|
require_relative 'html_maintenance'
|
17
19
|
|
18
20
|
module ADIWG
|
@@ -35,6 +37,7 @@ module ADIWG
|
|
35
37
|
responsibilityClass = Html_Responsibility.new(@html)
|
36
38
|
dateClass = Html_Date.new(@html)
|
37
39
|
onlineClass = Html_OnlineResource.new(@html)
|
40
|
+
constraintClass = Html_Constraint.new(@html)
|
38
41
|
maintClass = Html_Maintenance.new(@html)
|
39
42
|
|
40
43
|
# metadataInfo - metadata status
|
@@ -142,6 +145,23 @@ module ADIWG
|
|
142
145
|
end
|
143
146
|
end
|
144
147
|
|
148
|
+
# metadataInfo - constraints [] {constraint}
|
149
|
+
unless hMetaInfo[:metadataConstraints].empty?
|
150
|
+
@html.details do
|
151
|
+
@html.summary('Metadata Constraints', {'id' => 'metadataInfo-constraint', 'class' => 'h3'})
|
152
|
+
@html.section(:class => 'block') do
|
153
|
+
hMetaInfo[:metadataConstraints].each do |hConstraint|
|
154
|
+
@html.details do
|
155
|
+
@html.summary(hConstraint[:type].capitalize+' Constraint', {'class' => 'h5'})
|
156
|
+
@html.section(:class => 'block') do
|
157
|
+
constraintClass.writeHtml(hConstraint)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
145
165
|
# metadataInfo - maintenance {maintenance}
|
146
166
|
unless hMetaInfo[:metadataMaintenance].empty?
|
147
167
|
@html.details do
|
@@ -168,7 +168,7 @@ module ADIWG
|
|
168
168
|
end
|
169
169
|
|
170
170
|
# feature catalogue - functional language
|
171
|
-
s = hDictionary[:
|
171
|
+
s = hDictionary[:dictionaryFunctionalLanguage]
|
172
172
|
unless s.nil?
|
173
173
|
@xml.tag!('gfc:functionalLanguage') do
|
174
174
|
@xml.tag!('gco:CharacterString', s)
|
@@ -2,7 +2,10 @@
|
|
2
2
|
# writer output in XML
|
3
3
|
# to define the domain of an attribute
|
4
4
|
|
5
|
+
require_relative 'class_definitionReference'
|
6
|
+
|
5
7
|
# History:
|
8
|
+
# Stan Smith 2018-01-25 add support for domain itemReference
|
6
9
|
# Stan Smith 2017-02-03 refactored for mdJson/mdTranslator 2.0
|
7
10
|
# Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
|
8
11
|
# Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
|
@@ -24,6 +27,9 @@ module ADIWG
|
|
24
27
|
|
25
28
|
def writeXML(hItem)
|
26
29
|
|
30
|
+
# classes used
|
31
|
+
defRefClass = FC_DefinitionReference.new(@xml, @hResponseObj)
|
32
|
+
|
27
33
|
@xml.tag!('gfc:FC_ListedValue') do
|
28
34
|
|
29
35
|
# listed value - label (required)
|
@@ -61,6 +67,14 @@ module ADIWG
|
|
61
67
|
@xml.tag!('gfc:definition')
|
62
68
|
end
|
63
69
|
|
70
|
+
# listed value - definition reference
|
71
|
+
unless hItem[:itemReference].empty?
|
72
|
+
hCitation = hItem[:itemReference]
|
73
|
+
@xml.tag!('gfc:definitionReference') do
|
74
|
+
defRefClass.writeXML(hCitation)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
64
78
|
end # gfc:FC_ListedValue tag
|
65
79
|
end # writeXML
|
66
80
|
end # FC_ListedValue class
|
@@ -55,7 +55,7 @@ module ADIWG
|
|
55
55
|
@hResponseObj = hResponseObj
|
56
56
|
end
|
57
57
|
|
58
|
-
def writeXML(hData, aAssocRes)
|
58
|
+
def writeXML(hData, aAssocRes, aDistInfo)
|
59
59
|
|
60
60
|
# classes used
|
61
61
|
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
@@ -204,6 +204,7 @@ module ADIWG
|
|
204
204
|
end
|
205
205
|
|
206
206
|
# data identification - resource constraints {}
|
207
|
+
haveCon = false
|
207
208
|
aCons = hData[:constraints]
|
208
209
|
aCons.each do |hCon|
|
209
210
|
@xml.tag!('gmd:resourceConstraints') do
|
@@ -217,9 +218,27 @@ module ADIWG
|
|
217
218
|
if type == 'security'
|
218
219
|
sConClass.writeXML(hCon)
|
219
220
|
end
|
221
|
+
haveCon = true
|
220
222
|
end
|
221
223
|
end
|
222
|
-
|
224
|
+
|
225
|
+
# data identification - resource constraints {} from distribution liability statement
|
226
|
+
aDistInfo.each do |hDistribution|
|
227
|
+
unless hDistribution.empty?
|
228
|
+
unless hDistribution[:liabilityStatement].nil?
|
229
|
+
@xml.tag!('gmd:resourceConstraints') do
|
230
|
+
@xml.tag!('gmd:MD_LegalConstraints') do
|
231
|
+
@xml.tag!('gmd:otherConstraints') do
|
232
|
+
@xml.tag!('gco:CharacterString', hDistribution[:liabilityStatement])
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
haveCon = true
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
|
241
|
+
if !haveCon && @hResponseObj[:writerShowTags]
|
223
242
|
@xml.tag!('gmd:resourceConstraints')
|
224
243
|
end
|
225
244
|
|
@@ -2,53 +2,53 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2016-12-07 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-12 refactored to handle namespacing readers and writers
|
10
|
+
# Stan Smith 2014-07-09 modify require statements to function in RubyGem structure
|
11
11
|
# Stan Smith 2013-09-25 original script
|
12
12
|
|
13
13
|
require_relative 'class_distributor'
|
14
14
|
|
15
15
|
module ADIWG
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
16
|
+
module Mdtranslator
|
17
|
+
module Writers
|
18
|
+
module Iso19115_2
|
19
|
+
|
20
|
+
class MD_Distribution
|
21
|
+
|
22
|
+
def initialize(xml, hResponseObj)
|
23
|
+
@xml = xml
|
24
|
+
@hResponseObj = hResponseObj
|
25
|
+
end
|
26
|
+
|
27
|
+
def writeXML(hDistribution)
|
28
|
+
|
29
|
+
# classes used
|
30
|
+
distributorClass = MD_Distributor.new(@xml, @hResponseObj)
|
31
|
+
|
32
|
+
@xml.tag!('gmd:MD_Distribution') do
|
33
|
+
|
34
|
+
# distribution - distributor (required)
|
35
|
+
aDistributors = hDistribution[:distributor]
|
36
|
+
unless aDistributors.empty?
|
37
|
+
aDistributors.each do |hDistributor|
|
38
|
+
@xml.tag!('gmd:distributor') do
|
39
|
+
distributorClass.writeXML(hDistributor)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
if aDistributors.empty? && @hResponseObj[:writerShowTags]
|
44
|
+
@xml.tag!('gmd:distributor')
|
45
|
+
end
|
46
|
+
|
47
|
+
end # gmd:MD_Distribution tag
|
48
|
+
end # writeXML
|
49
|
+
end # MD_Distribution class
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
54
|
end
|
@@ -2,87 +2,88 @@
|
|
2
2
|
# 19115-2 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
5
|
+
# Stan Smith 2018-01-29 add legal constraint for distribution liability statement
|
6
|
+
# Stan Smith 2016-12-13 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-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
12
13
|
# Stan Smith 2013-11-01 original script.
|
13
14
|
|
14
15
|
require_relative 'class_codelist'
|
15
16
|
|
16
17
|
module ADIWG
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
module Mdtranslator
|
19
|
+
module Writers
|
20
|
+
module Iso19115_2
|
20
21
|
|
21
|
-
|
22
|
+
class MD_LegalConstraints
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
def initialize(xml, hResponseObj)
|
25
|
+
@xml = xml
|
26
|
+
@hResponseObj = hResponseObj
|
27
|
+
end
|
27
28
|
|
28
|
-
|
29
|
+
def writeXML(hConstraint)
|
29
30
|
|
30
|
-
|
31
|
-
|
31
|
+
# classes used
|
32
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
32
33
|
|
33
|
-
|
34
|
+
@xml.tag!('gmd:MD_LegalConstraints') do
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
36
|
+
# constraints - use limitation []
|
37
|
+
aUse = hConstraint[:useLimitation]
|
38
|
+
aUse.each do |useCon|
|
39
|
+
@xml.tag!('gmd:useLimitation') do
|
40
|
+
@xml.tag!('gco:CharacterString', useCon)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
if aUse.empty? && @hResponseObj[:writerShowTags]
|
44
|
+
@xml.tag!('gmd:useLimitation')
|
45
|
+
end
|
45
46
|
|
46
|
-
|
47
|
+
hLegalCon = hConstraint[:legalConstraint]
|
47
48
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
49
|
+
# legal constraints - access constraints
|
50
|
+
aAccess = hLegalCon[:accessCodes]
|
51
|
+
aAccess.each do |code|
|
52
|
+
@xml.tag!('gmd:accessConstraints') do
|
53
|
+
codelistClass.writeXML('gmd', 'iso_restriction', code)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
if aAccess.empty? && @hResponseObj[:writerShowTags]
|
57
|
+
@xml.tag!('gmd:accessConstraints')
|
58
|
+
end
|
58
59
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
# legal constraints - use constraints
|
61
|
+
aUse = hLegalCon[:useCodes]
|
62
|
+
aUse.each do |code|
|
63
|
+
@xml.tag!('gmd:useConstraints') do
|
64
|
+
codelistClass.writeXML('gmd', 'iso_restriction', code)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
if aUse.empty? && @hResponseObj[:writerShowTags]
|
68
|
+
@xml.tag!('gmd:useConstraints')
|
69
|
+
end
|
69
70
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
71
|
+
# legal constraints - other constraints
|
72
|
+
aOther = hLegalCon[:otherCons]
|
73
|
+
aOther.each do |con|
|
74
|
+
@xml.tag!('gmd:otherConstraints') do
|
75
|
+
@xml.tag!('gco:CharacterString', con)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
if aOther.empty? && @hResponseObj[:writerShowTags]
|
79
|
+
@xml.tag!('gmd:otherConstraints')
|
80
|
+
end
|
80
81
|
|
81
|
-
|
82
|
-
|
83
|
-
|
82
|
+
end # gmd:MD_LegalConstraints tag
|
83
|
+
end # writeXML
|
84
|
+
end # MD_LegalConstraints class
|
84
85
|
|
85
|
-
|
86
|
-
|
87
|
-
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
88
89
|
end
|
@@ -1,64 +1,63 @@
|
|
1
|
-
|
2
1
|
# ISO <<Class>> MD_Identifier
|
3
2
|
# 19115-2 output for ISO 19115-2 XML
|
4
3
|
|
5
4
|
# History:
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# Stan Smith 2016-11-29 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-12 refactored to handle namespacing readers and writers
|
10
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
11
|
+
# Stan Smith 2014-05-28 revised for json schema 0.5.0
|
13
12
|
# Stan Smith 2014-05-16 original script
|
14
13
|
|
15
14
|
require_relative 'class_citation'
|
16
15
|
|
17
16
|
module ADIWG
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
17
|
+
module Mdtranslator
|
18
|
+
module Writers
|
19
|
+
module Iso19115_2
|
20
|
+
|
21
|
+
class MD_Identifier
|
22
|
+
|
23
|
+
def initialize(xml, hResponseObj)
|
24
|
+
@xml = xml
|
25
|
+
@hResponseObj = hResponseObj
|
26
|
+
end
|
27
|
+
|
28
|
+
def writeXML(hIdentifier)
|
29
|
+
|
30
|
+
# classes used in MD_Metadata
|
31
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
32
|
+
|
33
|
+
@xml.tag!('gmd:MD_Identifier') do
|
34
|
+
|
35
|
+
# identifier - authority
|
36
|
+
hCitation = hIdentifier[:citation]
|
37
|
+
unless hCitation.empty?
|
38
|
+
@xml.tag!('gmd:authority') do
|
39
|
+
citationClass.writeXML(hCitation)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
if hCitation.empty? && @hResponseObj[:writerShowTags]
|
43
|
+
@xml.tag!('gmd:authority')
|
44
|
+
end
|
45
|
+
|
46
|
+
# identifier - code (required)
|
47
|
+
s = hIdentifier[:identifier]
|
48
|
+
if s.nil?
|
49
|
+
@xml.tag!('gmd:code', {'gco:nilReason' => 'missing'})
|
50
|
+
else
|
51
|
+
@xml.tag!('gmd:code') do
|
52
|
+
@xml.tag!('gco:CharacterString', s)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
end # MD_Identifier tag
|
57
|
+
end # writeXML
|
58
|
+
end # MD_Identifier class
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
64
63
|
end
|