adiwg-mdtranslator 2.20.0.pre.beta.10 → 2.21.0.pre.beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +46 -7
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_acquisition.rb +133 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_environment.rb +47 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_event.rb +88 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrument.rb +73 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEvent.rb +77 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_instrumentationEventList.rb +62 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadata.rb +11 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_objective.rb +104 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_operation.rb +119 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb +53 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_plan.rb +80 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb +87 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requestedDate.rb +51 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_requirement.rb +98 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_revision.rb +50 -0
- data/lib/adiwg/mdtranslator/version.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_acquisition.rb +199 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +19 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_acquisition.rb +103 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_environment.rb +82 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_event.rb +123 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrument.rb +92 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEvent.rb +83 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_instrumentationEventList.rb +73 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_mdMetadata.rb +11 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_objective.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_operation.rb +131 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_pass.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_plan.rb +76 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_platform.rb +102 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requestedDate.rb +44 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_requirement.rb +111 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_revision.rb +55 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_acquisition.rb +42 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_environment.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_event.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrument.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEvent.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_instrumentationEventList.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_metadata.rb +2 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_objective.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_operation.rb +34 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_pass.rb +30 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_plan.rb +32 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_platform.rb +35 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requestedDate.rb +26 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_requirement.rb +36 -0
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_revision.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_acquisition.rb +195 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_body.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_environment.rb +58 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_event.rb +121 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrument.rb +98 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEvent.rb +84 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_instrumentationEventList.rb +90 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_objective.rb +155 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_operation.rb +178 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_pass.rb +72 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_plan.rb +93 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_platform.rb +117 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requestedDate.rb +33 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_requirement.rb +139 -0
- data/lib/adiwg/mdtranslator/writers/simple_html/sections/html_revision.rb +55 -0
- metadata +72 -2
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_identifier'
|
3
|
+
require_relative 'class_platform'
|
4
|
+
require_relative 'class_instrumentationEventList'
|
5
|
+
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_3
|
11
|
+
|
12
|
+
class MI_Instrument
|
13
|
+
def initialize(xml, hResponseObj)
|
14
|
+
@xml = xml
|
15
|
+
@hResponseObj = hResponseObj
|
16
|
+
end
|
17
|
+
|
18
|
+
def writeXML(hInstrument)
|
19
|
+
|
20
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
21
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
22
|
+
platformClass = MI_Platform.new(@xml, @hResponseObj)
|
23
|
+
instrumentationEventListClass = MI_InstrumentationEventList.new(@xml, @hResponseObj)
|
24
|
+
|
25
|
+
@xml.tag!('mac:MI_Instrument', id: hInstrument[:instrumentId]) do
|
26
|
+
unless hInstrument[:citation].empty?
|
27
|
+
@xml.tag!('mac:citation') do
|
28
|
+
citationClass.writeXML(hInstrument[:citation])
|
29
|
+
end
|
30
|
+
else
|
31
|
+
if @hResponseObj[:writerShowTags]
|
32
|
+
@xml.tag!('mac:citation')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
unless hInstrument[:identifier].empty?
|
37
|
+
@xml.tag!('mac:identifier') do
|
38
|
+
identifierClass.writeXML(hInstrument[:identifier])
|
39
|
+
end
|
40
|
+
else
|
41
|
+
if @hResponseObj[:writerShowTags]
|
42
|
+
@xml.tag!('mac:identifier')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
unless hInstrument[:instrumentType].empty?
|
47
|
+
@xml.tag!('mac:type') do
|
48
|
+
@xml.tag!('gco:CharacterString', hInstrument[:instrumentType])
|
49
|
+
end
|
50
|
+
else
|
51
|
+
if @hResponseObj[:writerShowTags]
|
52
|
+
@xml.tag!('mac:type')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
unless hInstrument[:description].nil?
|
57
|
+
@xml.tag!('mac:description') do
|
58
|
+
@xml.tag!('gco:CharacterString', hInstrument[:description])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
if @hResponseObj[:writerShowTags]
|
62
|
+
@xml.tag!('mac:description')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
unless hInstrument[:mountedOn].empty?
|
67
|
+
@xml.tag!('mac:mountedOn') do
|
68
|
+
platformClass.writeXML(hInstrument[:mountedOn])
|
69
|
+
end
|
70
|
+
else
|
71
|
+
if @hResponseObj[:writerShowTags]
|
72
|
+
@xml.tag!('mac:mountedOn')
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
unless hInstrument[:histories].empty?
|
77
|
+
@xml.tag!('mac:history') do
|
78
|
+
hInstrument[:histories].each do |history|
|
79
|
+
instrumentationEventListClass.writeXML(history)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_extent'
|
3
|
+
require_relative 'class_revision'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module Iso19115_3
|
9
|
+
|
10
|
+
class MI_InstrumentationEvent
|
11
|
+
def initialize(xml, hResponseObj)
|
12
|
+
@xml = xml
|
13
|
+
@hResponseObj = hResponseObj
|
14
|
+
end
|
15
|
+
|
16
|
+
def writeXML(hInstrumentationEvent)
|
17
|
+
|
18
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
19
|
+
extentClass = EX_Extent.new(@xml, @hResponseObj)
|
20
|
+
revisionClass = MI_Revision.new(@xml, @hResponseObj)
|
21
|
+
codeListClass = MD_Codelist.new(@xml, @hResponseObj)
|
22
|
+
|
23
|
+
@xml.tag!('mac:MI_InstrumentationEvent') do
|
24
|
+
unless hInstrumentationEvent[:citations].empty?
|
25
|
+
hInstrumentationEvent[:citations].each do |hCitation|
|
26
|
+
@xml.tag!('mac:citation') do
|
27
|
+
citationClass.writeXML(hCitation)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
else
|
31
|
+
if @hResponseObj[:writerShowTags]
|
32
|
+
@xml.tag!('mac:citation')
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
unless hInstrumentationEvent[:description].nil?
|
37
|
+
@xml.tag!('mac:description') do
|
38
|
+
@xml.tag!('gco:CharacterString', hInstrumentationEvent[:description])
|
39
|
+
end
|
40
|
+
else
|
41
|
+
if @hResponseObj[:writerShowTags]
|
42
|
+
@xml.tag!('mac:description')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
unless hInstrumentationEvent[:extent].empty?
|
47
|
+
@xml.tag!('mac:extent') do
|
48
|
+
extentClass.writeXML(hInstrumentationEvent[:extent])
|
49
|
+
end
|
50
|
+
else
|
51
|
+
if @hResponseObj[:writerShowTags]
|
52
|
+
@xml.tag!('mac:extent')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
unless hInstrumentationEvent[:eventType].nil?
|
57
|
+
@xml.tag!('mac:type') do
|
58
|
+
codeListClass.writeXML('mac', 'iso_eventTypeCode', hInstrumentationEvent[:eventType])
|
59
|
+
end
|
60
|
+
else
|
61
|
+
if @hResponseObj[:writerShowTags]
|
62
|
+
@xml.tag!('mac:type')
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
unless hInstrumentationEvent[:revisionHistories].empty?
|
67
|
+
hInstrumentationEvent[:revisionHistories].each do |hRevision|
|
68
|
+
@xml.tag!('mac:revisionHistory') do
|
69
|
+
revisionClass.writeXML(hRevision)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
else
|
73
|
+
if @hResponseObj[:writerShowTags]
|
74
|
+
@xml.tag!('mac:revisionHistory')
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_locale'
|
3
|
+
require_relative 'class_constraint'
|
4
|
+
require_relative 'class_instrumentationEvent'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module Iso19115_3
|
10
|
+
|
11
|
+
class MI_InstrumentationEventList
|
12
|
+
def initialize(xml, hResponseObj)
|
13
|
+
@xml = xml
|
14
|
+
@hResponseObj = hResponseObj
|
15
|
+
end
|
16
|
+
|
17
|
+
def writeXML(hInstrumentationEventList)
|
18
|
+
|
19
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
20
|
+
localeClass = PT_Locale.new(@xml, @hResponseObj)
|
21
|
+
constraintClass = Constraint.new(@xml, @hResponseObj)
|
22
|
+
instrumentationEventClass = MI_InstrumentationEvent.new(@xml, @hResponseObj)
|
23
|
+
|
24
|
+
@xml.tag!('mac:MI_InstrumentationEventList') do
|
25
|
+
unless hInstrumentationEventList[:citation].empty?
|
26
|
+
@xml.tag!('mac:citation') do
|
27
|
+
citationClass.writeXML(hInstrumentationEventList[:citation])
|
28
|
+
end
|
29
|
+
else
|
30
|
+
if @hResponseObj[:writerShowTags]
|
31
|
+
@xml.tag!('mac:citation')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
unless hInstrumentationEventList[:description].nil?
|
36
|
+
@xml.tag!('mac:description') do
|
37
|
+
@xml.tag!('gco:CharacterString', hInstrumentationEventList[:description])
|
38
|
+
end
|
39
|
+
else
|
40
|
+
@xml.tag!('mac:description')
|
41
|
+
end
|
42
|
+
|
43
|
+
unless hInstrumentationEventList[:locale].empty?
|
44
|
+
@xml.tag!('mac:locale') do
|
45
|
+
localeClass.writeXML(hInstrumentationEventList[:locale])
|
46
|
+
end
|
47
|
+
else
|
48
|
+
if @hResponseObj[:writerShowTags]
|
49
|
+
@xml.tag!('mac:locale')
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
unless hInstrumentationEventList[:instrumentationEvents].empty?
|
54
|
+
hInstrumentationEventList[:instrumentationEvents].each do |hEvent|
|
55
|
+
@xml.tag!('mac:instrumentationEvent') do
|
56
|
+
instrumentationEventClass.writeXML(hEvent)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
else
|
60
|
+
if @hResponseObj[:writerShowTags]
|
61
|
+
@xml.tag!('mac:instrumentationEvent')
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -27,6 +27,7 @@ require_relative 'class_spatialRepresentation'
|
|
27
27
|
require_relative 'class_referenceSystem'
|
28
28
|
require_relative 'class_featureCatalog'
|
29
29
|
require_relative 'class_extension'
|
30
|
+
require_relative 'class_acquisition'
|
30
31
|
|
31
32
|
module ADIWG
|
32
33
|
module Mdtranslator
|
@@ -64,6 +65,7 @@ module ADIWG
|
|
64
65
|
referenceSystemClass = MD_ReferenceSystem.new(@xml, @hResponseObj)
|
65
66
|
mdCatalogClass = MD_FeatureCatalogue.new(@xml, @hResponseObj)
|
66
67
|
extensionClass = MD_MetadataExtensionInformation.new(@xml, @hResponseObj)
|
68
|
+
acquisitionClass = MI_AcquisitionInformation.new(@xml, @hResponseObj)
|
67
69
|
|
68
70
|
# create shortcuts to sections of internal object
|
69
71
|
hMetadata = intObj[:metadata]
|
@@ -73,6 +75,7 @@ module ADIWG
|
|
73
75
|
aDataQuality = hMetadata[:dataQuality]
|
74
76
|
aLineage = hMetadata[:lineageInfo]
|
75
77
|
aDictionaries = intObj[:dataDictionaries]
|
78
|
+
aAcquisition = hMetadata[:acquisitions]
|
76
79
|
version = @hResponseObj[:translatorVersion]
|
77
80
|
|
78
81
|
# document head
|
@@ -417,6 +420,14 @@ module ADIWG
|
|
417
420
|
@xml.tag!('mdb:metadataMaintenance')
|
418
421
|
end
|
419
422
|
|
423
|
+
aAcquisition.each do |hAcquisition|
|
424
|
+
unless hAcquisition.empty?
|
425
|
+
@xml.tag!('mdb:acquisitionInformation') do
|
426
|
+
acquisitionClass.writeXML(hAcquisition)
|
427
|
+
end
|
428
|
+
end
|
429
|
+
end
|
430
|
+
|
420
431
|
end # mdb:MD_Metadata tag
|
421
432
|
|
422
433
|
return metadata
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require_relative 'class_identifier'
|
2
|
+
require_relative 'class_codelist'
|
3
|
+
require_relative 'class_extent'
|
4
|
+
require_relative 'class_event'
|
5
|
+
require_relative 'class_pass'
|
6
|
+
require_relative 'class_instrument'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module Iso19115_3
|
12
|
+
|
13
|
+
class MI_Objective
|
14
|
+
def initialize(xml, hResponseObj)
|
15
|
+
@xml = xml
|
16
|
+
@hResponseObj = hResponseObj
|
17
|
+
end
|
18
|
+
|
19
|
+
def writeXML(hObjective)
|
20
|
+
|
21
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
22
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
23
|
+
extentClass = EX_Extent.new(@xml, @hResponseObj)
|
24
|
+
eventClass = MI_Event.new(@xml, @hResponseObj)
|
25
|
+
passClass = MI_Pass.new(@xml, @hResponseObj)
|
26
|
+
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)
|
27
|
+
|
28
|
+
@xml.tag!('mac:MI_Objective', id: hObjective[:objectiveId]) do
|
29
|
+
unless hObjective[:identifiers].empty?
|
30
|
+
hObjective[:identifiers].each do |hIdentifier|
|
31
|
+
@xml.tag!('mac:identifier') do
|
32
|
+
identifierClass.writeXML(hIdentifier)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
else
|
36
|
+
if @hResponseObj[:writerShowTags]
|
37
|
+
@xml.tag!('mac:identifier')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
unless hObjective[:priority].nil?
|
42
|
+
@xml.tag!('mac:priority') do
|
43
|
+
@xml.tag!('gco:CharacterString', hObjective[:priority])
|
44
|
+
end
|
45
|
+
else
|
46
|
+
if @hResponseObj[:writerShowTags]
|
47
|
+
@xml.tag!('mac:priority')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
unless hObjective[:type].nil?
|
52
|
+
@xml.tag!('mac:type') do
|
53
|
+
codelistClass.writeXML('mac', 'iso_objectiveTypeCode', hObjective[:type])
|
54
|
+
end
|
55
|
+
else
|
56
|
+
@xml.tag!('mac:type')
|
57
|
+
end
|
58
|
+
|
59
|
+
unless hObjective[:function].nil?
|
60
|
+
@xml.tag!('mac:function') do
|
61
|
+
@xml.tag!('gco:CharacterString', hObjective[:function])
|
62
|
+
end
|
63
|
+
else
|
64
|
+
if @hResponseObj[:writerShowTags]
|
65
|
+
@xml.tag!('mac:function')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
unless hObjective[:extent].nil?
|
70
|
+
@xml.tag!('mac:extent') do
|
71
|
+
extentClass.writeXML(hObjective[:extent])
|
72
|
+
end
|
73
|
+
else
|
74
|
+
if @hResponseObj[:writerShowTags]
|
75
|
+
@xml.tag!('mac:extent')
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
unless hObjective[:occurrences].empty?
|
80
|
+
hObjective[:occurrences].each do |hOccurrence|
|
81
|
+
@xml.tag!('mac:occurrence') do
|
82
|
+
eventClass.writeXML(hOccurrence)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
else
|
86
|
+
if @hResponseObj[:writerShowTags]
|
87
|
+
@xml.tag!('mac:occurrence')
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
unless hObjective[:passes].empty?
|
92
|
+
hObjective[:passes].each do |hPass|
|
93
|
+
@xml.tag!('mac:pass') do
|
94
|
+
passClass.writeXML(hPass)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
else
|
98
|
+
if @hResponseObj[:writerShowTags]
|
99
|
+
@xml.tag!('mac:pass')
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
unless hObjective[:sensingInstruments].empty?
|
104
|
+
hObjective[:sensingInstruments].each do |hInstrument|
|
105
|
+
@xml.tag!('mac:sensingInstrument') do
|
106
|
+
instrumentClass.writeXML(hInstrument)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
else
|
110
|
+
if @hResponseObj[:writerShowTags]
|
111
|
+
@xml.tag!('mac:sensingInstrument')
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_identifier'
|
3
|
+
require_relative 'class_objective'
|
4
|
+
require_relative 'class_plan'
|
5
|
+
require_relative 'class_platform'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_3
|
11
|
+
|
12
|
+
class MI_Operation
|
13
|
+
def initialize(xml, hResponseObj)
|
14
|
+
@xml = xml
|
15
|
+
@hResponseObj = hResponseObj
|
16
|
+
end
|
17
|
+
|
18
|
+
def writeXML(hOperation)
|
19
|
+
|
20
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
21
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
22
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
23
|
+
objectiveClass = MI_Objective.new(@xml, @hResponseObj)
|
24
|
+
planClass = MI_Plan.new(@xml, @hResponseObj)
|
25
|
+
platformClass = MI_Platform.new(@xml, @hResponseObj)
|
26
|
+
operationClass = MI_Operation.new(@xml, @hResponseObj)
|
27
|
+
|
28
|
+
@xml.tag!('mac:MI_Operation', id: hOperation[:operationId]) do
|
29
|
+
|
30
|
+
unless hOperation[:description].nil?
|
31
|
+
@xml.tag!('mac:description') do
|
32
|
+
@xml.tag!('gco:CharacterString', hOperation[:description])
|
33
|
+
end
|
34
|
+
else
|
35
|
+
if @hResponseObj[:writerShowTags]
|
36
|
+
@xml.tag!('mac:description')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
unless hOperation[:citation].empty?
|
41
|
+
@xml.tag!('mac:citation') do
|
42
|
+
citationClass.writeXML(hOperation[:citation])
|
43
|
+
end
|
44
|
+
else
|
45
|
+
if @hResponseObj[:writerShowTags]
|
46
|
+
@xml.tag!('mac:citation')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
unless hOperation[:identifier].empty?
|
51
|
+
@xml.tag!('mac:identifier') do
|
52
|
+
identifierClass.writeXML(hOperation[:identifier])
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
unless hOperation[:status].nil?
|
57
|
+
@xml.tag!('mac:status') do
|
58
|
+
codelistClass.writeXML('mac', 'iso_progress', hOperation[:status])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
unless hOperation[:operationType].nil?
|
63
|
+
@xml.tag!('mac:type') do
|
64
|
+
codelistClass.writeXML('mac', 'iso_operationTypeCode', hOperation[:operationType])
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
unless hOperation[:platforms].empty?
|
69
|
+
hOperation[:platforms].each do |hPlatform|
|
70
|
+
@xml.tag!('mac:platform') do
|
71
|
+
platformClass.writeXML(hPlatform)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
else
|
75
|
+
if @hResponseObj[:writerShowTags]
|
76
|
+
@xml.tag!('mac:platform')
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
unless hOperation[:childOperations].empty?
|
81
|
+
hOperation[:childOperations].each do |hChildOp|
|
82
|
+
@xml.tag!('mac:childOperation') do
|
83
|
+
operationClass.writeXML(hChildOp)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
else
|
87
|
+
if @hResponseObj[:writerShowTags]
|
88
|
+
@xml.tag!('mac:childOperation')
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
unless hOperation[:objectives].empty?
|
93
|
+
hOperation[:objectives].each do |hObjective|
|
94
|
+
@xml.tag!('mac:objective') do
|
95
|
+
objectiveClass.writeXML(hObjective)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
else
|
99
|
+
if @hResponseObj[:writerShowTags]
|
100
|
+
@xml.tag!('mac:objective')
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
unless hOperation[:parentOperation].empty?
|
105
|
+
@xml.tag!('mac:parentOperation') do
|
106
|
+
operationClass.writeXML(hOperation[:parentOperation])
|
107
|
+
end
|
108
|
+
else
|
109
|
+
if @hResponseObj[:writerShowTags]
|
110
|
+
@xml.tag!('mac:parentOperation')
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
unless hOperation[:plan].empty?
|
115
|
+
@xml.tag!('mac:plan') do
|
116
|
+
planClass.writeXML(hOperation[:plan])
|
117
|
+
end
|
118
|
+
else
|
119
|
+
if @hResponseObj[:writerShowTags]
|
120
|
+
@xml.tag!('mac:plan')
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
require_relative 'class_identifier'
|
2
|
+
require_relative 'class_extent'
|
3
|
+
require_relative 'class_event'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module Iso19115_3
|
9
|
+
|
10
|
+
class MI_Pass
|
11
|
+
def initialize(xml, hResponseObj)
|
12
|
+
@xml = xml
|
13
|
+
@hResponseObj = hResponseObj
|
14
|
+
end
|
15
|
+
|
16
|
+
def writeXML(hPass)
|
17
|
+
|
18
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
19
|
+
extentClass = EX_Extent.new(@xml, @hResponseObj)
|
20
|
+
eventClass = MI_Event.new(@xml, @hResponseObj)
|
21
|
+
|
22
|
+
@xml.tag!('mac:MI_Pass') do
|
23
|
+
|
24
|
+
unless hPass[:identifier].empty?
|
25
|
+
@xml.tag!('mac:identifier') do
|
26
|
+
identifierClass.writeXML(hPass[:identifier])
|
27
|
+
end
|
28
|
+
else
|
29
|
+
if @hResponseObj[:writerShowTags]
|
30
|
+
@xml.tag!('mac:identifier')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
unless hPass[:extent].empty?
|
35
|
+
@xml.tag!('mac:extent') do
|
36
|
+
extentClass.writeXML(hPass[:extent])
|
37
|
+
end
|
38
|
+
else
|
39
|
+
if @hResponseObj[:writerShowTags]
|
40
|
+
@xml.tag!('mac:extent')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
unless hPass[:relatedEvents].empty?
|
45
|
+
hPass[:relatedEvents].each do |hEvent|
|
46
|
+
@xml.tag!('mac:relatedEvent') do
|
47
|
+
eventClass.writeXML(hEvent)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
else
|
51
|
+
if @hResponseObj[:writerShowTags]
|
52
|
+
@xml.tag!('mac:related')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_operation'
|
3
|
+
require_relative 'class_requirement'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module Iso19115_3
|
9
|
+
|
10
|
+
class MI_Plan
|
11
|
+
def initialize(xml, hResponseObj)
|
12
|
+
@xml = xml
|
13
|
+
@hResponseObj = hResponseObj
|
14
|
+
end
|
15
|
+
|
16
|
+
def writeXML(hPlan)
|
17
|
+
|
18
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
19
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
20
|
+
operationClass = MI_Operation.new(@xml, @hResponseObj)
|
21
|
+
requirementClass = MI_Requirement.new(@xml, @hResponseObj)
|
22
|
+
|
23
|
+
@xml.tag!('mac:MI_Plan', id: hPlan[:planId]) do
|
24
|
+
unless hPlan[:planType].nil?
|
25
|
+
@xml.tag!('mac:type') do
|
26
|
+
codelistClass.writeXML('mac', 'iso_geometryTypeCode', hPlan[:planType])
|
27
|
+
end
|
28
|
+
else
|
29
|
+
if @hResponseObj[:writerShowTags]
|
30
|
+
@xml.tag!('mac:type')
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
unless hPlan[:status].nil?
|
35
|
+
@xml.tag!('mac:status') do
|
36
|
+
codelistClass.writeXML('mac', 'iso_progress', hPlan[:status])
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
unless hPlan[:citation].empty?
|
41
|
+
@xml.tag!('mac:citation') do
|
42
|
+
citationClass.writeXML(hPlan[:citation])
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
unless hPlan[:planOperations].empty?
|
47
|
+
hPlan[:planOperations].each do |hOperation|
|
48
|
+
@xml.tag!('mac:operation') do
|
49
|
+
operationClass.writeXML(hOperation)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
else
|
53
|
+
if @hResponseObj[:writerShowTags]
|
54
|
+
@xml.tag!('mac:operation')
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
unless hPlan[:satisfiedRequirements].empty?
|
59
|
+
hPlan[:satisfiedRequirements].each do |hRequirement|
|
60
|
+
@xml.tag!('mac:satisfiedRequirement') do
|
61
|
+
requirementClass.writeXML(hRequirement)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
else
|
65
|
+
if @hResponseObj[:writerShowTags]
|
66
|
+
@xml.tag!('mac:satisfiedRequirement')
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|