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,102 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_identifier'
|
3
|
+
require_relative 'class_responsibility'
|
4
|
+
require_relative 'class_instrument'
|
5
|
+
require_relative 'class_instrumentationEventList'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module Iso19115_3
|
11
|
+
|
12
|
+
class MI_Platform
|
13
|
+
def initialize(xml, hResponseObj)
|
14
|
+
@xml = xml
|
15
|
+
@hResponseObj = hResponseObj
|
16
|
+
end
|
17
|
+
|
18
|
+
def writeXML(hPlatform)
|
19
|
+
|
20
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
21
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
22
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
23
|
+
responsibilityClass = CI_Responsibility.new(@xml, @hResponseObj)
|
24
|
+
instrumentClass = MI_Instrument.new(@xml, @hResponseObj)
|
25
|
+
instrumentationEventListClass = MI_InstrumentationEventList.new(@xml, @hResponseObj)
|
26
|
+
|
27
|
+
@xml.tag!('mac:MI_Platform', id: hPlatform[:platformId]) do
|
28
|
+
|
29
|
+
unless hPlatform[:citation].empty?
|
30
|
+
@xml.tag!('mac:citation') do
|
31
|
+
citationClass.writeXML(hPlatform[:citation])
|
32
|
+
end
|
33
|
+
else
|
34
|
+
if @hResponseObj[:writerShowTags]
|
35
|
+
@xml.tag!('mac:citation')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
unless hPlatform[:identifier].empty?
|
40
|
+
@xml.tag!('mac:identifier') do
|
41
|
+
identifierClass.writeXML(hPlatform[:identifier])
|
42
|
+
end
|
43
|
+
else
|
44
|
+
if @hResponseObj[:writerShowTags]
|
45
|
+
@xml.tag!('mac:identifier')
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
unless hPlatform[:description].nil?
|
50
|
+
@xml.tag!('mac:description') do
|
51
|
+
@xml.tag!('gco:CharacterString', hPlatform[:description])
|
52
|
+
end
|
53
|
+
else
|
54
|
+
if @hResponseObj[:writerShowTags]
|
55
|
+
@xml.tag!('mac:description')
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
unless hPlatform[:sponsors].empty?
|
60
|
+
hPlatform[:sponsors].each do |hResponsibility|
|
61
|
+
@xml.tag!('mac:sponsor') do
|
62
|
+
responsibilityClass.writeXML(hResponsibility)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
else
|
66
|
+
if @hResponseObj[:writerShowTags]
|
67
|
+
@xml.tag!('mac:sponsor')
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
unless hPlatform[:instruments].empty?
|
72
|
+
hPlatform[:instruments].each do |hInstrument|
|
73
|
+
@xml.tag!('mac:instrument') do
|
74
|
+
instrumentClass.writeXML(hInstrument)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
else
|
78
|
+
if @hResponseObj[:writerShowTags]
|
79
|
+
@xml.tag!('mac:instrument')
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
unless hPlatform[:history].empty?
|
84
|
+
@xml.tag!('mac:history') do
|
85
|
+
hPlatform[:history].each do |history|
|
86
|
+
instrumentationEventListClass.writeXML(history)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
else
|
90
|
+
if @hResponseObj[:writerShowTags]
|
91
|
+
@xml.tag!('mac:history')
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module ADIWG
|
2
|
+
module Mdtranslator
|
3
|
+
module Writers
|
4
|
+
module Iso19115_3
|
5
|
+
|
6
|
+
class MI_RequestedDate
|
7
|
+
def initialize(xml, hResponseObj)
|
8
|
+
@xml = xml
|
9
|
+
@hResponseObj = hResponseObj
|
10
|
+
end
|
11
|
+
|
12
|
+
def writeXML(hRequestedDate)
|
13
|
+
|
14
|
+
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
|
15
|
+
|
16
|
+
@xml.tag!('mac:MI_RequestedDate') do
|
17
|
+
unless hRequestedDate[:requestedDateOfCollection].empty?
|
18
|
+
@xml.tag!('mac:requestedDateOfCollection') do
|
19
|
+
gcoDateTimeClass.writeXML(hRequestedDate[:requestedDateOfCollection])
|
20
|
+
end
|
21
|
+
else
|
22
|
+
if @hResponseObj[:writerShowTags]
|
23
|
+
@xml.tag!('mac:requestedDateOfCollection')
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
unless hRequestedDate[:latestAcceptableDate].empty?
|
28
|
+
@xml.tag!('mac:latestAcceptableDate') do
|
29
|
+
gcoDateTimeClass.writeXML(hRequestedDate[:latestAcceptableDate])
|
30
|
+
end
|
31
|
+
else
|
32
|
+
if @hResponseObj[:writerShowTags]
|
33
|
+
@xml.tag!('mac:latestAcceptableDate')
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
|
@@ -0,0 +1,111 @@
|
|
1
|
+
require_relative 'class_citation'
|
2
|
+
require_relative 'class_identifier'
|
3
|
+
require_relative 'class_responsibility'
|
4
|
+
require_relative 'class_codelist'
|
5
|
+
require_relative 'class_requestedDate'
|
6
|
+
require_relative 'class_gcoDateTime'
|
7
|
+
require_relative 'class_plan'
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module Iso19115_3
|
13
|
+
|
14
|
+
class MI_Requirement
|
15
|
+
def initialize(xml, hResponseObj)
|
16
|
+
@xml = xml
|
17
|
+
@hResponseObj = hResponseObj
|
18
|
+
end
|
19
|
+
|
20
|
+
def writeXML(hRequirement)
|
21
|
+
|
22
|
+
citationClass = CI_Citation.new(@xml, @hResponseObj)
|
23
|
+
identifierClass = MD_Identifier.new(@xml, @hResponseObj)
|
24
|
+
responsibilityClass = CI_Responsibility.new(@xml, @hResponseObj)
|
25
|
+
codelistClass = MD_Codelist.new(@xml, @hResponseObj)
|
26
|
+
requestedDateClass = MI_RequestedDate.new(@xml, @hResponseObj)
|
27
|
+
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
|
28
|
+
planClass = MI_Plan.new(@xml, @hResponseObj)
|
29
|
+
|
30
|
+
@xml.tag!('mac:MI_Requirement', id: hRequirement[:requirementId]) do
|
31
|
+
unless hRequirement[:citation].empty?
|
32
|
+
@xml.tag!('mac:citation') do
|
33
|
+
citationClass.writeXML(hRequirement[:citation])
|
34
|
+
end
|
35
|
+
else
|
36
|
+
if @hResponseObj[:writerShowTags]
|
37
|
+
@xml.tag!('mac:citation')
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
unless hRequirement[:identifier].empty?
|
42
|
+
@xml.tag!('mac:identifier') do
|
43
|
+
identifierClass.writeXML(hRequirement[:identifier])
|
44
|
+
end
|
45
|
+
else
|
46
|
+
if @hResponseObj[:writerShowTags]
|
47
|
+
@xml.tag!('mac:identifier')
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
unless hRequirement[:requestors].empty?
|
52
|
+
hRequirement[:requestors].each do |hResponsibility|
|
53
|
+
@xml.tag!('mac:requestor') do
|
54
|
+
responsibilityClass.writeXML(hResponsibility)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
unless hRequirement[:recipients].empty?
|
60
|
+
hRequirement[:recipients].each do |hResponsibility|
|
61
|
+
@xml.tag!('mac:recipient') do
|
62
|
+
responsibilityClass.writeXML(hResponsibility)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
unless hRequirement[:priority].nil?
|
68
|
+
@xml.tag!('mac:priority') do
|
69
|
+
codelistClass.writeXML('mac', 'iso_priorityCode', hRequirement[:priority])
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
unless hRequirement[:requestedDate].nil?
|
74
|
+
@xml.tag!('mac:requestedDate') do
|
75
|
+
requestedDateClass.writeXML(hRequirement[:requestedDate])
|
76
|
+
end
|
77
|
+
else
|
78
|
+
if @hResponseObj[:writerShowTags]
|
79
|
+
@xml.tag!('mac:requestedDate')
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
# unless hRequirement[:expiryDate].nil?
|
84
|
+
# @xml.tag!('mac:expiryDate') do
|
85
|
+
# gcoDateTimeClass.writeXML(hRequirement[:expiryDate])
|
86
|
+
# end
|
87
|
+
# else
|
88
|
+
# if @hResponseObj[:writerShowTags]
|
89
|
+
# @xml.tag!('mac:expiryDate')
|
90
|
+
# end
|
91
|
+
# end
|
92
|
+
|
93
|
+
unless hRequirement[:satisfiedPlans].empty?
|
94
|
+
hRequirement[:satisfiedPlans].each do |hPlan|
|
95
|
+
@xml.tag!('mac:satisifiedPlan') do
|
96
|
+
planClass.writeXML(hPlan)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
else
|
100
|
+
if @hResponseObj[:writerShowTags]
|
101
|
+
@xml.tag!('mac:satisifiedPlan')
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
require_relative 'class_responsibility'
|
2
|
+
require_relative 'class_gcoDateTime'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Writers
|
7
|
+
module Iso19115_3
|
8
|
+
|
9
|
+
class MI_Revision
|
10
|
+
def initialize(xml, hResponseObj)
|
11
|
+
@xml = xml
|
12
|
+
@hResponseObj = hResponseObj
|
13
|
+
end
|
14
|
+
|
15
|
+
def writeXML(hRevision)
|
16
|
+
|
17
|
+
responsibilityClass = CI_Responsibility.new(@xml, @hResponseObj)
|
18
|
+
gcoDateTimeClass = GcoDateTime.new(@xml, @hResponseObj)
|
19
|
+
|
20
|
+
@xml.tag!('mac:MI_Revision') do
|
21
|
+
unless hRevision[:description].nil?
|
22
|
+
@xml.tag!('mac:description') do
|
23
|
+
@xml.tag!('gco:CharacterString', hRevision[:description])
|
24
|
+
end
|
25
|
+
else
|
26
|
+
if @hResponseObj[:writerShowTags]
|
27
|
+
@xml.tag!('mac:description')
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
unless hRevision[:responsibleParty].empty?
|
32
|
+
@xml.tag!('mac:author') do
|
33
|
+
responsibilityClass.writeXML(hRevision[:responsibleParty])
|
34
|
+
end
|
35
|
+
else
|
36
|
+
@xml.tag!('mac:author')
|
37
|
+
end
|
38
|
+
|
39
|
+
unless hRevision[:dateInfo].empty?
|
40
|
+
@xml.tag!('mac:dateInfo') do
|
41
|
+
hRevision[:dateInfo].each do |hDate|
|
42
|
+
gcoDateTimeClass.writeXML(hDate)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
else
|
46
|
+
@xml.tag!('mac:dateInfo')
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_scope'
|
3
|
+
require_relative 'mdJson_plan'
|
4
|
+
require_relative 'mdJson_requirement'
|
5
|
+
require_relative 'mdJson_objective'
|
6
|
+
require_relative 'mdJson_platform'
|
7
|
+
require_relative 'mdJson_instrument'
|
8
|
+
require_relative 'mdJson_operation'
|
9
|
+
require_relative 'mdJson_event'
|
10
|
+
require_relative 'mdJson_pass'
|
11
|
+
require_relative 'mdJson_environment'
|
12
|
+
|
13
|
+
module ADIWG
|
14
|
+
module Mdtranslator
|
15
|
+
module Writers
|
16
|
+
module MdJson
|
17
|
+
|
18
|
+
module Acquisition
|
19
|
+
|
20
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
21
|
+
|
22
|
+
def self.build(hAcquisition)
|
23
|
+
|
24
|
+
Jbuilder.new do |json|
|
25
|
+
json.scope Scope.build(hAcquisition[:scope])
|
26
|
+
json.plan @Namespace.json_map(hAcquisition[:plans], Plan)
|
27
|
+
json.requirement @Namespace.json_map(hAcquisition[:requirements], Requirement)
|
28
|
+
json.objective @Namespace.json_map(hAcquisition[:objectives], Objective)
|
29
|
+
json.platform @Namespace.json_map(hAcquisition[:platforms], Platform)
|
30
|
+
json.instrument @Namespace.json_map(hAcquisition[:instruments], Instrument)
|
31
|
+
json.operation @Namespace.json_map(hAcquisition[:operations], Operation)
|
32
|
+
json.event @Namespace.json_map(hAcquisition[:events], Event)
|
33
|
+
json.pass @Namespace.json_map(hAcquisition[:passes], Pass)
|
34
|
+
json.environment Environment.build(hAcquisition[:environment])
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end # Acquisition
|
39
|
+
end # Event
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
|
8
|
+
module Environment
|
9
|
+
|
10
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
11
|
+
|
12
|
+
def self.build(hEnvironment)
|
13
|
+
|
14
|
+
Jbuilder.new do |json|
|
15
|
+
json.averageAirTemperature hEnvironment[:averageAirTemperature] unless hEnvironment[:averageAirTemperature].nil?
|
16
|
+
json.maxRelativeHumidity hEnvironment[:maxRelativeHumidity] unless hEnvironment[:maxRelativeHumidity].nil?
|
17
|
+
json.maxAltitude hEnvironment[:maxAltitude] unless hEnvironment[:maxAltitude].nil?
|
18
|
+
json.meteorologicalConditions hEnvironment[:meteorologicalConditions] unless hEnvironment[:meteorologicalConditions].nil?
|
19
|
+
json.solarAzimuth hEnvironment[:solarAzimuth] unless hEnvironment[:solarAzimuth].nil?
|
20
|
+
json.solarElevation hEnvironment[:solarElevation] unless hEnvironment[:solarElevation].nil?
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
end # Environment
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_identifier'
|
3
|
+
require_relative 'mdJson_dateTime'
|
4
|
+
require_relative 'mdJson_objective'
|
5
|
+
require_relative 'mdJson_pass'
|
6
|
+
require_relative 'mdJson_instrument'
|
7
|
+
|
8
|
+
|
9
|
+
module ADIWG
|
10
|
+
module Mdtranslator
|
11
|
+
module Writers
|
12
|
+
module MdJson
|
13
|
+
|
14
|
+
module Event
|
15
|
+
|
16
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
17
|
+
|
18
|
+
def self.build(hEvent)
|
19
|
+
|
20
|
+
Jbuilder.new do |json|
|
21
|
+
json.eventId hEvent[:eventId]
|
22
|
+
json.identifier Identifier.build(hEvent[:identifier])
|
23
|
+
json.trigger hEvent[:trigger]
|
24
|
+
json.context hEvent[:context]
|
25
|
+
json.sequence hEvent[:sequence]
|
26
|
+
json.time DateTime.build(hEvent[:time])
|
27
|
+
json.expectedObjective @Namespace.json_map(hEvent[:expectedObjectives], Objective)
|
28
|
+
json.relatedPass Pass.build(hEvent[:relatedPass])
|
29
|
+
json.relatedSensor @Namespace.json_map(hEvent[:relatedSensors], Instrument)
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end # Event
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_citation'
|
3
|
+
require_relative 'mdJson_identifier'
|
4
|
+
require_relative 'mdJson_platform'
|
5
|
+
require_relative 'mdJson_instrumentationEventList'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module Instrument
|
13
|
+
|
14
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
15
|
+
|
16
|
+
def self.build(hInstrument)
|
17
|
+
|
18
|
+
Jbuilder.new do |json|
|
19
|
+
json.instrumentId hInstrument[:instrumentId]
|
20
|
+
json.citation Citation.build(hInstrument[:citation]) unless hInstrument[:citation].empty?
|
21
|
+
json.identifier Identifier.build(hInstrument[:identifier])
|
22
|
+
json.instrumentType hInstrument[:instrumentType]
|
23
|
+
json.description hInstrument[:description] unless hInstrument[:description].nil?
|
24
|
+
json.mountedOn Platform.build(hInstrument[:mountedOn]) unless hInstrument[:mountedOn].empty?
|
25
|
+
json.history @Namespace.json_map(hInstrument[:histories], InstrumentationEventList) unless hInstrument[:histories].empty?
|
26
|
+
json.hostId Identifier.build(hInstrument[:hostId]) unless hInstrument[:hostId].empty?
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end # Instrument
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_citation'
|
3
|
+
require_relative 'mdJson_revision'
|
4
|
+
|
5
|
+
module ADIWG
|
6
|
+
module Mdtranslator
|
7
|
+
module Writers
|
8
|
+
module MdJson
|
9
|
+
|
10
|
+
module InstrumentationEvent
|
11
|
+
|
12
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
13
|
+
|
14
|
+
def self.build(hInstrumentationEvent)
|
15
|
+
# "required": ["description","eventType"],
|
16
|
+
Jbuilder.new do |json|
|
17
|
+
json.citation @Namespace.json_map(hInstrumentationEvent[:citations], Citation) unless hInstrumentationEvent[:citations].empty?
|
18
|
+
json.description hInstrumentationEvent[:description]
|
19
|
+
json.extent hInstrumentationEvent[:extent] unless hInstrumentationEvent[:extent].empty?
|
20
|
+
json.eventType hInstrumentationEvent[:eventType]
|
21
|
+
json.revisionHistory @Namespace.json_map(hInstrumentationEvent[:revisionHistories], Revision) unless hInstrumentationEvent[:revisionHistories].empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end # InstrumentationEvent
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_citation'
|
3
|
+
require_relative 'mdJson_locale'
|
4
|
+
require_relative 'mdJson_constraint'
|
5
|
+
require_relative 'mdJson_instrumentationEvent'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Writers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module InstrumentationEventList
|
13
|
+
|
14
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
15
|
+
|
16
|
+
def self.build(hInstrumentationEventList)
|
17
|
+
|
18
|
+
Jbuilder.new do |json|
|
19
|
+
json.citation Citation.build(hInstrumentationEventList[:citation]) unless hInstrumentationEventList[:citation].empty?
|
20
|
+
json.description hInstrumentationEventList[:description]
|
21
|
+
json.locale Locale.build(hInstrumentationEventList[:locale]) unless hInstrumentationEventList[:locale].empty?
|
22
|
+
json.constraints @Namespace.json_map(hInstrumentationEventList[:constraints], Constraint) unless hInstrumentationEventList[:constraints].empty?
|
23
|
+
json.instrumentationEvent @Namespace.json_map(hInstrumentationEventList[:instrumentationEvents], InstrumentationEvent) unless hInstrumentationEventList[:instrumentationEvents].empty?
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
end # InstrumentationEventList
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -13,6 +13,7 @@ require_relative 'mdJson_associatedResource'
|
|
13
13
|
require_relative 'mdJson_additionalDocumentation'
|
14
14
|
require_relative 'mdJson_funding'
|
15
15
|
require_relative 'mdJson_dataQuality'
|
16
|
+
require_relative 'mdJson_acquisition'
|
16
17
|
|
17
18
|
module ADIWG
|
18
19
|
module Mdtranslator
|
@@ -34,6 +35,7 @@ module ADIWG
|
|
34
35
|
json.associatedResource @Namespace.json_map(hMetadata[:associatedResources], AssociatedResource)
|
35
36
|
json.additionalDocumentation @Namespace.json_map(hMetadata[:additionalDocuments], AdditionalDocument)
|
36
37
|
json.funding @Namespace.json_map(hMetadata[:funding], Funding)
|
38
|
+
json.acquisition @Namespace.json_map(hMetadata[:acquisitions], Acquisition)
|
37
39
|
end
|
38
40
|
|
39
41
|
end # build
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_identifier'
|
3
|
+
require_relative 'mdJson_extent'
|
4
|
+
require_relative 'mdJson_event'
|
5
|
+
require_relative 'mdJson_pass'
|
6
|
+
require_relative 'mdJson_instrument'
|
7
|
+
|
8
|
+
module ADIWG
|
9
|
+
module Mdtranslator
|
10
|
+
module Writers
|
11
|
+
module MdJson
|
12
|
+
|
13
|
+
module Objective
|
14
|
+
|
15
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
16
|
+
|
17
|
+
def self.build(hObjective)
|
18
|
+
|
19
|
+
Jbuilder.new do |json|
|
20
|
+
json.objectiveId hObjective[:objectiveId]
|
21
|
+
json.identifier @Namespace.json_map(hObjective[:identifiers], Identifier)
|
22
|
+
json.priority hObjective[:priority] unless hObjective[:priority].nil?
|
23
|
+
json.objectiveType hObjective[:objectiveTypes] unless hObjective[:objectiveTypes].empty?
|
24
|
+
json.function hObjective[:functions] unless hObjective[:functions].empty?
|
25
|
+
json.extent @Namespace.json_map(hObjective[:extents], Extent) unless hObjective[:extents].empty?
|
26
|
+
json.objectiveOccurence @Namespace.json_map(hObjective[:occurrences], Event) unless hObjective[:occurrences].empty?
|
27
|
+
json.pass @Namespace.json_map(hObjective[:passes], Pass) unless hObjective[:passes].empty?
|
28
|
+
json.sensingInstrument @Namespace.json_map(hObjective[:sensingInstruments], Instrument) unless hObjective[:sensingInstruments].empty?
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
end # Objective
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
|
3
|
+
module ADIWG
|
4
|
+
module Mdtranslator
|
5
|
+
module Writers
|
6
|
+
module MdJson
|
7
|
+
|
8
|
+
module Operation
|
9
|
+
|
10
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
11
|
+
|
12
|
+
def self.build(hOperation)
|
13
|
+
|
14
|
+
Jbuilder.new do |json|
|
15
|
+
json.operationId hOperation[:operationId]
|
16
|
+
json.description hOperation[:description] unless hOperation[:description].nil?
|
17
|
+
json.citation Citation.build(hOperation[:citation]) unless hOperation[:citation].empty?
|
18
|
+
json.identifier Identifier.build(hOperation[:identifier])
|
19
|
+
json.status hOperation[:status]
|
20
|
+
json.operationType hOperation[:operationType] unless hOperation[:operationType].nil?
|
21
|
+
json.objective @Namespace.json_map(hOperation[:objectives], Objective) unless hOperation[:objectives].empty?
|
22
|
+
json.parentOperation Operation.build(hOperation[:parentOperation]) unless hOperation[:parentOperation].empty?
|
23
|
+
json.childOperation @Namespace.json_map(hOperation[:childOperations], Operation) unless hOperation[:childOperations].empty?
|
24
|
+
json.plan Plan.build(hOperation[:plan]) unless hOperation[:plan].empty?
|
25
|
+
json.platform @Namespace.json_map(hOperation[:platforms], Platform) unless hOperation[:platforms].empty?
|
26
|
+
json.significantEvent @Namespace.json_map(hOperation[:significantEvents], Event) unless hOperation[:significantEvents].empty?
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
end # Operation
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'jbuilder'
|
2
|
+
require_relative 'mdJson_identifier'
|
3
|
+
require_relative 'mdJson_extent'
|
4
|
+
require_relative 'mdJson_event'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module MdJson
|
10
|
+
|
11
|
+
module Pass
|
12
|
+
|
13
|
+
@Namespace = ADIWG::Mdtranslator::Writers::MdJson
|
14
|
+
|
15
|
+
def self.build(hPass)
|
16
|
+
|
17
|
+
Jbuilder.new do |json|
|
18
|
+
json.passId hPass[:passId]
|
19
|
+
json.identifier Identifier.build(hPass[:identifier])
|
20
|
+
json.extent Extent.build(hPass[:extent]) unless hPass[:extent].empty?
|
21
|
+
json.relatedEvent @Namespace.json_map(hPass[:relatedEvents], Event) unless hPass[:relatedEvents].empty?
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end # Pass
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|