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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +23 -24
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_identification.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_localSystem.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_taxonClass.rb +4 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_allocation.rb +13 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_contactPostprocess.rb +38 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +2 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_mdJson.rb +5 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_projectionParameters.rb +2 -1
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_resourceInfo.rb +17 -6
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_spatialResolution.rb +1 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_taxonomicClassification.rb +24 -5
- data/lib/adiwg/mdtranslator/version.rb +8 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_address.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_attribute.rb +21 -16
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_browse.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_citation.rb +11 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_constraint.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_contact.rb +14 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dataDomain.rb +18 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateRange.rb +10 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dateSingle.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_description.rb +10 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_dictionary.rb +7 -9
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_digitalForm.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_distribution.rb +9 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityDetail.rb +15 -11
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_entityOverview.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_fgdc.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geodeticReference.rb +7 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geographicResolution.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicAge.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_geologicRange.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_identification.rb +22 -18
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_keyword.rb +32 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_lineage.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_localSystem.rb +17 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/{class_mapProjection.rb → class_mapProjectionTags.rb} +33 -57
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_metadataInfo.rb +9 -12
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_method.rb +7 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_methodKeywords.rb +16 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_offlineOption.rb +24 -19
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_onlineOption.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb +8 -5
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_phone.rb +6 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarGrid.rb +146 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarInfo.rb +168 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarLocal.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarMap.rb +294 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_planarReference.rb +47 -328
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_process.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_publisher.rb +6 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_quality.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_security.rb +5 -6
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_series.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_source.rb +11 -14
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialDomain.rb +8 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialOrganization.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_spatialReference.rb +22 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_status.rb +8 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomy.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyClassification.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomyKeywords.rb +17 -10
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_taxonomySystem.rb +11 -15
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_timePeriod.rb +9 -7
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_transferInfo.rb +4 -2
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_verticalDatum.rb +11 -17
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer.rb +53 -3
- data/lib/adiwg/mdtranslator/writers/fgdc/fgdc_writer_messages_eng.yml +213 -0
- data/lib/adiwg/mdtranslator/writers/fgdc/version.rb +3 -2
- data/lib/adiwg/mdtranslator/writers/html/sections/html_allocation.rb +13 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_resourceInfo.rb +11 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomy.rb +10 -10
- data/lib/adiwg/mdtranslator/writers/html/sections/html_taxonomyClass.rb +4 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_baseUnit.rb +27 -27
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_codelist.rb +38 -38
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_contact.rb +79 -79
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_conventionalUnit.rb +49 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionUnit.rb +24 -24
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_derivedUnit.rb +36 -36
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +28 -21
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +12 -9
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +9 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +8 -3
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +7 -4
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_locale.rb +52 -49
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +4 -1
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_multiplicity.rb +15 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_onlineResource.rb +79 -76
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_phone.rb +67 -67
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_responsibleParty.rb +117 -108
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_unitsOfMeasure.rb +246 -246
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb +44 -6
- data/lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer_messages_eng.yml +40 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/version.rb +6 -5
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_dataIdentification.rb +13 -6
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_extension.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_allocation.rb +3 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_resourceInfo.rb +5 -4
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_taxonomicClassification.rb +6 -4
- data/lib/adiwg/mdtranslator_cli.rb +18 -8
- metadata +14 -8
- data/lib/adiwg/mdtranslator/writers/fgdc/classes/class_mapCoordinateInfo.rb +0 -167
@@ -2,97 +2,100 @@
|
|
2
2
|
# 19110 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# Stan Smith 2018-04-02 refactored error and warning messaging
|
6
|
+
# Stan Smith 2017-01-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-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-08-14 added protocol to onlineResource
|
13
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
13
14
|
# Stan Smith 2013-08-14 original script.
|
14
15
|
|
16
|
+
require_relative '../iso19110_writer'
|
15
17
|
require_relative 'class_codelist'
|
16
18
|
|
17
19
|
module ADIWG
|
18
|
-
|
19
|
-
|
20
|
-
|
20
|
+
module Mdtranslator
|
21
|
+
module Writers
|
22
|
+
module Iso19110
|
21
23
|
|
22
|
-
|
24
|
+
class CI_OnlineResource
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
def initialize(xml, hResponseObj)
|
27
|
+
@xml = xml
|
28
|
+
@hResponseObj = hResponseObj
|
29
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
30
|
+
end
|
28
31
|
|
29
|
-
|
32
|
+
def writeXML(hOlResource)
|
30
33
|
|
31
|
-
|
32
|
-
|
34
|
+
# classes used
|
35
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
33
36
|
|
34
|
-
|
37
|
+
@xml.tag! 'gmd:CI_OnlineResource' do
|
35
38
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
39
|
+
# online resource - link (required)
|
40
|
+
s = hOlResource[:olResURI]
|
41
|
+
unless s.nil?
|
42
|
+
@xml.tag!('gmd:linkage') do
|
43
|
+
@xml.tag!('gmd:URL', s)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
if s.nil?
|
47
|
+
@NameSpace.issueError(10)
|
48
|
+
end
|
46
49
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
# online resource - protocol
|
51
|
+
s = hOlResource[:olResProtocol]
|
52
|
+
unless s.nil?
|
53
|
+
@xml.tag!('gmd:protocol') do
|
54
|
+
@xml.tag!('gco:CharacterString', s)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
58
|
+
@xml.tag!('gmd:protocol')
|
59
|
+
end
|
57
60
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
61
|
+
# online resource - link name
|
62
|
+
s = hOlResource[:olResName]
|
63
|
+
unless s.nil?
|
64
|
+
@xml.tag!('gmd:name') do
|
65
|
+
@xml.tag!('gco:CharacterString', s)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
69
|
+
@xml.tag!('gmd:name')
|
70
|
+
end
|
68
71
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
72
|
+
# online resource - link description
|
73
|
+
s = hOlResource[:olResDesc]
|
74
|
+
unless s.nil?
|
75
|
+
@xml.tag!('gmd:description') do
|
76
|
+
@xml.tag!('gco:CharacterString', s)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
80
|
+
@xml.tag!('gmd:description')
|
81
|
+
end
|
79
82
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
83
|
+
# online resource - link function {CI_OnLineFunctionCode}
|
84
|
+
s = hOlResource[:olResFunction]
|
85
|
+
unless s.nil?
|
86
|
+
@xml.tag!('gmd:function') do
|
87
|
+
codelistClass.writeXML('gmd', 'iso_onlineFunction', s)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
91
|
+
@xml.tag!('gmd:function')
|
92
|
+
end
|
90
93
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
+
end # CI_OnlineResource tag
|
95
|
+
end # write XML
|
96
|
+
end # CI_OnlineResource class
|
94
97
|
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
98
101
|
end
|
@@ -2,82 +2,82 @@
|
|
2
2
|
# 19110 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2017-01-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 2014-12-12 refactored to handle namespacing readers and writers
|
10
|
+
# Stan Smith 2014-05-14 reorganized for JSON schema 0.4.0
|
11
11
|
# Stan Smith 2013-08-12 original script.
|
12
12
|
|
13
13
|
module ADIWG
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module Iso19110
|
17
17
|
|
18
|
-
|
18
|
+
class CI_Telephone
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
def initialize(xml, hResponseObj)
|
21
|
+
@xml = xml
|
22
|
+
@hResponseObj = hResponseObj
|
23
|
+
end
|
24
24
|
|
25
|
-
|
25
|
+
def writeXML(aPhones)
|
26
26
|
|
27
|
-
|
28
|
-
|
27
|
+
# ISO requires phones to be grouped in order (voice, fax)
|
28
|
+
@xml.tag!('gmd:CI_Telephone') do
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
30
|
+
# voice phones
|
31
|
+
voiceCount = 0
|
32
|
+
aPhones.each do |hPhone|
|
33
|
+
if hPhone[:phoneServiceTypes].empty?
|
34
|
+
hPhone[:phoneServiceTypes] << 'voice'
|
35
|
+
end
|
36
|
+
if hPhone[:phoneServiceTypes].include?('voice')
|
37
|
+
pName = hPhone[:phoneName]
|
38
|
+
pNumber = hPhone[:phoneNumber]
|
39
|
+
if pName.nil?
|
40
|
+
s = pNumber
|
41
|
+
else
|
42
|
+
s = pName + ': ' + pNumber
|
43
|
+
end
|
44
|
+
@xml.tag!('gmd:voice') do
|
45
|
+
@xml.tag!('gco:CharacterString', s)
|
46
|
+
voiceCount += 1
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
if voiceCount == 0 && @hResponseObj[:writerShowTags]
|
51
|
+
@xml.tag!('gmd:voice')
|
52
|
+
end
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
54
|
+
# fax phones
|
55
|
+
faxCount = 0
|
56
|
+
aPhones.each do |hPhone|
|
57
|
+
if hPhone[:phoneServiceTypes].include?('fax') ||
|
58
|
+
hPhone[:phoneServiceTypes].include?('facsimile')
|
59
|
+
pName = hPhone[:phoneName]
|
60
|
+
pNumber = hPhone[:phoneNumber]
|
61
|
+
if pName.nil?
|
62
|
+
s = pNumber
|
63
|
+
else
|
64
|
+
s = pName + ': ' + pNumber
|
65
|
+
end
|
66
|
+
@xml.tag!('gmd:facsimile') do
|
67
|
+
@xml.tag!('gco:CharacterString', s)
|
68
|
+
faxCount += 1
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
if faxCount == 0 && @hResponseObj[:writerShowTags]
|
73
|
+
@xml.tag!('gmd:facsimile')
|
74
|
+
end
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
76
|
+
end # CI_Telephone tag
|
77
|
+
end # write XML
|
78
|
+
end # CI_Telephone class
|
79
79
|
|
80
|
-
|
81
|
-
|
82
|
-
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
83
|
end
|
@@ -2,118 +2,127 @@
|
|
2
2
|
# 19110 writer output in XML
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
5
|
+
# Stan Smith 2018-04-03 refactored error and warning messaging
|
6
|
+
# Stan Smith 2017-01-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-12 refactored to handle namespacing readers and writers
|
12
|
+
# Stan Smith 2014-07-08 modify require statements to function in RubyGem structure
|
13
|
+
# Stan Smith 2014-05-14 modified for JSON schema 0.4.0
|
13
14
|
# Stan Smith 2013-08-13 original script.
|
14
15
|
|
16
|
+
require_relative '../iso19110_writer'
|
15
17
|
require_relative 'class_codelist'
|
16
18
|
require_relative 'class_contact'
|
17
19
|
|
18
20
|
module ADIWG
|
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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
21
|
+
module Mdtranslator
|
22
|
+
module Writers
|
23
|
+
module Iso19110
|
24
|
+
|
25
|
+
class CI_ResponsibleParty
|
26
|
+
|
27
|
+
def initialize(xml, hResponseObj)
|
28
|
+
@xml = xml
|
29
|
+
@hResponseObj = hResponseObj
|
30
|
+
@NameSpace = ADIWG::Mdtranslator::Writers::Iso19110
|
31
|
+
end
|
32
|
+
|
33
|
+
def writeXML(role, hParty)
|
34
|
+
|
35
|
+
# classes used
|
36
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
37
|
+
contactClass = CI_Contact.new(@xml, @hResponseObj)
|
38
|
+
|
39
|
+
contactId = hParty[:contactId]
|
40
|
+
hContact = ADIWG::Mdtranslator::Writers::Iso19110.getContact(contactId)
|
41
|
+
unless hContact.empty?
|
42
|
+
isOrg = hContact[:isOrganization]
|
43
|
+
@xml.tag!('gmd:CI_ResponsibleParty') do
|
44
|
+
|
45
|
+
# ISO19110 follows ISO19115-2 rules and requires either an individual
|
46
|
+
# or organization name and allows for both. Since mdJson 2+ patterns
|
47
|
+
# after ISO19115-3 only one name is maintained. So individual name
|
48
|
+
# becomes required for individual and organization name for organization.
|
49
|
+
|
50
|
+
# responsible party - (if individual)
|
51
|
+
unless isOrg
|
52
|
+
|
53
|
+
# individual name (required)
|
54
|
+
s = hContact[:name]
|
55
|
+
unless s.nil?
|
56
|
+
@xml.tag!('gmd:individualName') do
|
57
|
+
@xml.tag!('gco:CharacterString', s)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
if s.nil?
|
61
|
+
@NameSpace.issueWarning(22, 'gmd:individualName')
|
62
|
+
end
|
63
|
+
|
64
|
+
# position name
|
65
|
+
s = hContact[:positionName]
|
66
|
+
unless s.nil?
|
67
|
+
@xml.tag!('gmd:positionName') do
|
68
|
+
@xml.tag!('gco:CharacterString', s)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
if s.nil? && @hResponseObj[:writerShowTags]
|
72
|
+
@xml.tag!('gmd:positionName')
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
# responsible party - (if organization)
|
78
|
+
if isOrg
|
79
|
+
|
80
|
+
# organization name (required)
|
81
|
+
s = hContact[:name]
|
82
|
+
unless s.nil?
|
83
|
+
@xml.tag!('gmd:organisationName') do
|
84
|
+
@xml.tag!('gco:CharacterString', s)
|
85
|
+
end
|
86
|
+
end
|
87
|
+
if s.nil?
|
88
|
+
@NameSpace.issueWarning(21, 'gmd:organisationName')
|
89
|
+
end
|
90
|
+
|
91
|
+
end
|
92
|
+
|
93
|
+
# responsible party - contact info
|
94
|
+
haveInfo = false
|
95
|
+
haveInfo = true unless hContact[:phones].empty?
|
96
|
+
haveInfo = true unless hContact[:addresses].empty?
|
97
|
+
haveInfo = true unless hContact[:eMailList].empty?
|
98
|
+
haveInfo = true unless hContact[:onlineResources].empty?
|
99
|
+
haveInfo = true unless hContact[:hoursOfService].empty?
|
100
|
+
haveInfo = true unless hContact[:contactInstructions].nil?
|
101
|
+
if haveInfo
|
102
|
+
@xml.tag!('gmd:contactInfo') do
|
103
|
+
contactClass.writeXML(hContact)
|
104
|
+
end
|
105
|
+
elsif @hResponseObj[:writerShowTags]
|
106
|
+
@xml.tag!('gmd:contactInfo')
|
107
|
+
end
|
108
|
+
|
109
|
+
# responsible party - role (required)
|
110
|
+
s = role
|
111
|
+
unless s.nil?
|
112
|
+
@xml.tag! 'gmd:role' do
|
113
|
+
codelistClass.writeXML('gmd', 'iso_role', s)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
if s.nil?
|
117
|
+
@NameSpace.issueWarning(20, 'gmd:role')
|
118
|
+
end
|
119
|
+
|
120
|
+
end # CI_ResponsibleParty tag
|
121
|
+
end # valid contact returned
|
122
|
+
end # write XML
|
123
|
+
end # CI_ResponsibleParty class
|
124
|
+
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
119
128
|
end
|