adiwg-mdtranslator 2.20.0.pre.beta.5 → 2.21.0.pre.beta.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +3 -3
- data/README.md +0 -21
- data/Rakefile +0 -1
- data/adiwg-mdtranslator.gemspec +1 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +45 -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/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_cli.rb +1 -1
- metadata +45 -36
- data/DCAT-US.md +0 -67
- data/lib/adiwg/mdtranslator/writers/dcat_us/dcat_us_writer.rb +0 -98
- data/lib/adiwg/mdtranslator/writers/dcat_us/readme.md +0 -10
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_level.rb +0 -55
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_access_url.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_accrualPeriodicity.rb +0 -45
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_bureau_code.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_contact_point.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_dcat_us.rb +0 -104
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_described_by_type.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_description.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_distribution.rb +0 -59
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_download_url.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_identifier.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_is_part_of.rb +0 -27
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_issued.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_keyword.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_landing_page.rb +0 -27
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_language.rb +0 -23
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_license.rb +0 -18
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_media_type.rb +0 -17
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_modified.rb +0 -29
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_primaryITInvestmentUII.rb +0 -19
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_program_code.rb +0 -33
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_publisher.rb +0 -74
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_references.rb +0 -50
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_rights.rb +0 -32
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_spatial.rb +0 -32
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_system_of_records.rb +0 -28
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_temporal.rb +0 -40
- data/lib/adiwg/mdtranslator/writers/dcat_us/sections/dcat_us_theme.rb +0 -28
- data/lib/adiwg/mdtranslator/writers/dcat_us/version.rb +0 -14
@@ -0,0 +1,98 @@
|
|
1
|
+
require_relative 'module_citation'
|
2
|
+
require_relative 'module_identifier'
|
3
|
+
require_relative 'module_requestedDate'
|
4
|
+
require_relative 'module_plan'
|
5
|
+
require_relative 'module_responsibleParty'
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Readers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module Requirement
|
13
|
+
def self.unpack(hRequirement, responseObj, inContext = nil)
|
14
|
+
|
15
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
16
|
+
|
17
|
+
outContext = 'requirement'
|
18
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
19
|
+
|
20
|
+
# return nil object if input is empty
|
21
|
+
if hRequirement.empty?
|
22
|
+
@MessagePath.issueWarning(41, responseObj, outContext)
|
23
|
+
return nil
|
24
|
+
end
|
25
|
+
|
26
|
+
intMetadataClass = InternalMetadata.new
|
27
|
+
intRequirement = intMetadataClass.newRequirement
|
28
|
+
|
29
|
+
if hRequirement.has_key?('requirementId')
|
30
|
+
intRequirement[:requirementId] = hRequirement['requirementId']
|
31
|
+
end
|
32
|
+
|
33
|
+
if hRequirement.has_key?('citation')
|
34
|
+
hReturn = Citation.unpack(hRequirement['citation'], responseObj, outContext)
|
35
|
+
unless hReturn.nil?
|
36
|
+
intRequirement[:citation] = hReturn
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
if hRequirement.has_key?('identifier')
|
41
|
+
hReturn = Identifier.unpack(hRequirement['identifier'], responseObj, outContext)
|
42
|
+
unless hReturn.nil?
|
43
|
+
intRequirement[:identifier] = hReturn
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
if hRequirement.has_key?('requestor')
|
48
|
+
hRequirement['requestor'].each do |requestor|
|
49
|
+
hReturn = ResponsibleParty.unpack(requestor, responseObj, outContext)
|
50
|
+
unless hReturn.nil?
|
51
|
+
intRequirement[:requestors] << hReturn
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
if hRequirement.has_key?('recipient')
|
57
|
+
hRequirement['recipient'].each do |recipient|
|
58
|
+
hReturn = ResponsibleParty.unpack(recipient, responseObj, outContext)
|
59
|
+
unless hReturn.nil?
|
60
|
+
intRequirement[:recipients] << hReturn
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
if hRequirement.has_key?('priority')
|
66
|
+
intRequirement[:priority] = hRequirement['priority']
|
67
|
+
end
|
68
|
+
|
69
|
+
if hRequirement.has_key?('requestedDate')
|
70
|
+
hReturn = RequestedDate.unpack(hRequirement['requestedDate'], responseObj, outContext)
|
71
|
+
unless hReturn.nil?
|
72
|
+
intRequirement[:requestedDate] = hReturn
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
if hRequirement.has_key?('expiryDate')
|
77
|
+
intRequirement[:expiryDate] = hRequirement['expiryDate']
|
78
|
+
end
|
79
|
+
|
80
|
+
if hRequirement.has_key?('satisfiedPlan')
|
81
|
+
aItems = hRequirement['satisfiedPlan']
|
82
|
+
aItems.each do |item|
|
83
|
+
hReturn = Plan.unpack(item, responseObj, outContext)
|
84
|
+
unless hReturn.nil?
|
85
|
+
intRequirement[:satisfiedPlans] << hReturn
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
intRequirement
|
91
|
+
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
require_relative 'module_responsibleParty'
|
2
|
+
require_relative 'module_dateTime'
|
3
|
+
|
4
|
+
module ADIWG
|
5
|
+
module Mdtranslator
|
6
|
+
module Readers
|
7
|
+
module MdJson
|
8
|
+
|
9
|
+
module Revision
|
10
|
+
def self.unpack(hRevision, responseObj, inContext = nil)
|
11
|
+
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
|
12
|
+
|
13
|
+
intMetadataClass = InternalMetadata.new
|
14
|
+
intRevision = intMetadataClass.newRevision
|
15
|
+
|
16
|
+
outContext = 'revision'
|
17
|
+
outContext = inContext + ' > ' + outContext unless inContext.nil?
|
18
|
+
|
19
|
+
if hRevision.has_key?('description')
|
20
|
+
intRevision[:description] = hRevision['description']
|
21
|
+
else
|
22
|
+
@MessagePath.issueWarning(40, responseObj, outContext)
|
23
|
+
end
|
24
|
+
|
25
|
+
if hRevision.has_key?('responsibleParty')
|
26
|
+
intRevision[:responsibleParty] = ResponsibleParty.unpack(hRevision['responsibleParty'], responseObj, outContext)
|
27
|
+
else
|
28
|
+
@MessagePath.issueWarning(41, responseObj, outContext)
|
29
|
+
end
|
30
|
+
|
31
|
+
if hRevision.has_key?('dateInfo')
|
32
|
+
hRevision['dateInfo'].each do |item|
|
33
|
+
hReturn = DateTime.unpack(item, responseObj, outContext)
|
34
|
+
unless hReturn.nil?
|
35
|
+
intRevision[:dateInfo] << hReturn
|
36
|
+
end
|
37
|
+
end
|
38
|
+
else
|
39
|
+
@MessagePath.issueWarning(41, responseObj, outContext)
|
40
|
+
end
|
41
|
+
|
42
|
+
intRevision
|
43
|
+
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -0,0 +1,199 @@
|
|
1
|
+
require_relative 'html_scope'
|
2
|
+
require_relative 'html_plan'
|
3
|
+
require_relative 'html_requirement'
|
4
|
+
require_relative 'html_objective'
|
5
|
+
require_relative 'html_platform'
|
6
|
+
require_relative 'html_instrument'
|
7
|
+
require_relative 'html_operation'
|
8
|
+
require_relative 'html_event'
|
9
|
+
require_relative 'html_pass'
|
10
|
+
require_relative 'html_environment'
|
11
|
+
|
12
|
+
module ADIWG
|
13
|
+
module Mdtranslator
|
14
|
+
module Writers
|
15
|
+
module Html
|
16
|
+
class Html_Acquisition
|
17
|
+
def initialize(html)
|
18
|
+
@html = html
|
19
|
+
end
|
20
|
+
|
21
|
+
def writeHtml(hAcquisition)
|
22
|
+
scopeClass = Html_Scope.new(@html)
|
23
|
+
planClass = Html_Plan.new(@html)
|
24
|
+
requirementClass = Html_Requirement.new(@html)
|
25
|
+
objectiveClass = Html_Objective.new(@html)
|
26
|
+
platformClass = Html_Platform.new(@html)
|
27
|
+
instrumentClass = Html_Instrument.new(@html)
|
28
|
+
operationClass = Html_Operation.new(@html)
|
29
|
+
eventClass = Html_Event.new(@html)
|
30
|
+
passClass = Html_Pass.new(@html)
|
31
|
+
environmentClass = Html_Environment.new(@html)
|
32
|
+
|
33
|
+
# scope
|
34
|
+
unless hAcquisition[:scope].empty?
|
35
|
+
@html.section(:class => 'block') do
|
36
|
+
@html.details do
|
37
|
+
@html.summary('Scope', {'class' => 'h4'})
|
38
|
+
@html.section(:class => 'block') do
|
39
|
+
scopeClass.writeHtml(hAcquisition[:scope])
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# plan
|
46
|
+
unless hAcquisition[:plans].empty?
|
47
|
+
@html.section(:class => 'block') do
|
48
|
+
@html.details do
|
49
|
+
@html.summary('Plans', {'class' => 'h4'})
|
50
|
+
hAcquisition[:plans].each do |plan|
|
51
|
+
@html.section(:class => 'block') do
|
52
|
+
@html.details do
|
53
|
+
@html.summary('Plan', {'class' => 'h5'})
|
54
|
+
planClass.writeHtml(plan)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# requirement
|
63
|
+
unless hAcquisition[:requirements].empty?
|
64
|
+
@html.section(:class => 'block') do
|
65
|
+
@html.details do
|
66
|
+
@html.summary('Requirements', {'class' => 'h4'})
|
67
|
+
hAcquisition[:requirements].each do |requirement|
|
68
|
+
@html.section(:class => 'block') do
|
69
|
+
@html.details do
|
70
|
+
@html.summary('Requirement', {'class' => 'h5'})
|
71
|
+
requirementClass.writeHtml(requirement)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# objective
|
80
|
+
unless hAcquisition[:objectives].empty?
|
81
|
+
@html.section(:class => 'block') do
|
82
|
+
@html.details do
|
83
|
+
@html.summary('Objectives', {'class' => 'h4'})
|
84
|
+
hAcquisition[:objectives].each do |objective|
|
85
|
+
@html.section(:class => 'block') do
|
86
|
+
@html.details do
|
87
|
+
@html.summary('Objective', {'class' => 'h5'})
|
88
|
+
objectiveClass.writeHtml(objective)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
|
97
|
+
# platform
|
98
|
+
unless hAcquisition[:platforms].empty?
|
99
|
+
@html.section(:class => 'block') do
|
100
|
+
@html.details do
|
101
|
+
@html.summary('Platforms', {'class' => 'h4'})
|
102
|
+
hAcquisition[:platforms].each do |platform|
|
103
|
+
@html.section(:class => 'block') do
|
104
|
+
@html.details do
|
105
|
+
@html.summary('Platform', {'class' => 'h5'})
|
106
|
+
platformClass.writeHtml(platform)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
# Instrument
|
115
|
+
unless hAcquisition[:instruments].empty?
|
116
|
+
@html.section(:class => 'block') do
|
117
|
+
@html.details do
|
118
|
+
@html.summary('Instruments', {'class' => 'h4'})
|
119
|
+
hAcquisition[:instruments].each do |instrument|
|
120
|
+
@html.section(:class => 'block') do
|
121
|
+
@html.details do
|
122
|
+
@html.summary('Instrument', {'class' => 'h5'})
|
123
|
+
instrumentClass.writeHtml(instrument)
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# operation
|
132
|
+
unless hAcquisition[:operations].empty?
|
133
|
+
@html.section(:class => 'block') do
|
134
|
+
@html.details do
|
135
|
+
@html.summary('Operations', {'class' => 'h4'})
|
136
|
+
hAcquisition[:operations].each do |operation|
|
137
|
+
@html.section(:class => 'block') do
|
138
|
+
@html.details do
|
139
|
+
@html.summary('Operation', {'class' => 'h5'})
|
140
|
+
operationClass.writeHtml(operation)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Event
|
149
|
+
unless hAcquisition[:events].empty?
|
150
|
+
@html.section(:class => 'block') do
|
151
|
+
@html.details do
|
152
|
+
@html.summary('Events', {'class' => 'h4'})
|
153
|
+
hAcquisition[:events].each do |event|
|
154
|
+
@html.section(:class => 'block') do
|
155
|
+
@html.details do
|
156
|
+
@html.summary('Event', {'class' => 'h5'})
|
157
|
+
eventClass.writeHtml(event)
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Pass
|
166
|
+
unless hAcquisition[:passes].empty?
|
167
|
+
@html.section(:class => 'block') do
|
168
|
+
@html.details do
|
169
|
+
@html.summary('Passes', {'class' => 'h4'})
|
170
|
+
hAcquisition[:passes].each do |pass|
|
171
|
+
@html.section(:class => 'block') do
|
172
|
+
@html.details do
|
173
|
+
@html.summary('Pass', {'class' => 'h5'})
|
174
|
+
passClass.writeHtml(pass)
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
178
|
+
end
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# Environment
|
183
|
+
unless hAcquisition[:environment].empty?
|
184
|
+
@html.section(:class => 'block') do
|
185
|
+
@html.details do
|
186
|
+
@html.summary('Environment', {'class' => 'h4'})
|
187
|
+
@html.section(:class => 'block') do
|
188
|
+
environmentClass.writeHtml(hAcquisition[:environment])
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
end
|
195
|
+
end
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
@@ -20,6 +20,7 @@ require_relative 'html_additionalDocumentation'
|
|
20
20
|
require_relative 'html_funding'
|
21
21
|
require_relative 'html_dataDictionary'
|
22
22
|
require_relative 'html_metadataRepository'
|
23
|
+
require_relative 'html_acquisition'
|
23
24
|
|
24
25
|
module ADIWG
|
25
26
|
module Mdtranslator
|
@@ -47,6 +48,7 @@ module ADIWG
|
|
47
48
|
fundingClass = Html_Funding.new(@html)
|
48
49
|
dictionaryClass = Html_DataDictionary.new(@html)
|
49
50
|
repositoryClass = Html_Repository.new(@html)
|
51
|
+
acquisitionClass = Html_Acquisition.new(@html)
|
50
52
|
|
51
53
|
# make sections of the internal data store convenient
|
52
54
|
hSchema = intObj[:schema]
|
@@ -61,6 +63,7 @@ module ADIWG
|
|
61
63
|
aFunding = intObj[:metadata][:funding]
|
62
64
|
aDictionaries = intObj[:dataDictionaries]
|
63
65
|
aRepositories = intObj[:metadataRepositories]
|
66
|
+
aAcquisitions = intObj[:metadata][:acquisitions]
|
64
67
|
|
65
68
|
# set page title and logo
|
66
69
|
# side navigation
|
@@ -72,6 +75,7 @@ module ADIWG
|
|
72
75
|
@html.a(' Metadata', {'href' => '#body-metadataInfo', 'class' => 'btn navBtn', 'id' => 'metadataButton'})
|
73
76
|
@html.a(' Resource', {'href' => '#body-resourceInfo', 'class' => 'btn navBtn', 'id' => 'resourceButton'})
|
74
77
|
@html.a(' Quality', {'href' => '#body-dataQuality', 'class' => 'btn navBtn', 'id' => 'qualityButton'})
|
78
|
+
@html.a(' Acquistion', {'href' => '#body-acquisition', 'class' => 'btn navBtn', 'id' => 'acquisitionButton'})
|
75
79
|
@html.a(' Lineage', {'href' => '#body-lineage', 'class' => 'btn navBtn', 'id' => 'lineageButton'})
|
76
80
|
@html.a(' Distribution', {'href' => '#body-distribution', 'class' => 'btn navBtn', 'id' => 'distributionButton'})
|
77
81
|
@html.a(' Associated', {'href' => '#body-associatedResource', 'class' => 'btn navBtn', 'id' => 'associatedButton'})
|
@@ -215,6 +219,21 @@ module ADIWG
|
|
215
219
|
end
|
216
220
|
end
|
217
221
|
|
222
|
+
# acquisition section
|
223
|
+
unless aAcquisitions.empty?
|
224
|
+
@html.details do
|
225
|
+
@html.summary('Acquisition', {'id' => 'body-acquisition', 'class' => 'h2'})
|
226
|
+
aAcquisitions.each do |hAcquisition|
|
227
|
+
@html.section(:class => 'block') do
|
228
|
+
@html.details do
|
229
|
+
@html.summary('Acquisition', {'class' => 'h3'})
|
230
|
+
acquisitionClass.writeHtml(hAcquisition)
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
218
237
|
# associated resource section
|
219
238
|
unless aAssociated.empty?
|
220
239
|
@html.details do
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module ADIWG
|
2
|
+
module Mdtranslator
|
3
|
+
module Writers
|
4
|
+
module Html
|
5
|
+
class Html_Environment
|
6
|
+
def initialize(html)
|
7
|
+
@html = html
|
8
|
+
end
|
9
|
+
|
10
|
+
def writeHtml(hEnvironment)
|
11
|
+
# averageAirTemperature
|
12
|
+
unless hEnvironment[:averageAirTemperature].nil?
|
13
|
+
@html.em('Average Air Temperature: ')
|
14
|
+
@html.text!(hEnvironment[:averageAirTemperature].to_s)
|
15
|
+
@html.br
|
16
|
+
end
|
17
|
+
|
18
|
+
# maxRelativeHumidity
|
19
|
+
unless hEnvironment[:maxRelativeHumidity].nil?
|
20
|
+
@html.em('Maximum Relative Humidity: ')
|
21
|
+
@html.text!(hEnvironment[:maxRelativeHumidity].to_s)
|
22
|
+
@html.br
|
23
|
+
end
|
24
|
+
|
25
|
+
# maxAltitude
|
26
|
+
unless hEnvironment[:maxAltitude].nil?
|
27
|
+
@html.em('Maximum Altitude: ')
|
28
|
+
@html.text!(hEnvironment[:maxAltitude].to_s)
|
29
|
+
@html.br
|
30
|
+
end
|
31
|
+
|
32
|
+
# meteorologicalConditions
|
33
|
+
unless hEnvironment[:meteorologicalConditions].nil?
|
34
|
+
@html.em('Meteorological Conditions: ')
|
35
|
+
@html.text!(hEnvironment[:meteorologicalConditions])
|
36
|
+
@html.br
|
37
|
+
end
|
38
|
+
|
39
|
+
# solarAzimuth
|
40
|
+
unless hEnvironment[:solarAzimuth].nil?
|
41
|
+
@html.em('Solar Azimuth: ')
|
42
|
+
@html.text!(hEnvironment[:solarAzimuth].to_s)
|
43
|
+
@html.br
|
44
|
+
end
|
45
|
+
|
46
|
+
# solarElevation
|
47
|
+
unless hEnvironment[:solarElevation].nil?
|
48
|
+
@html.em('Solar Elevation: ')
|
49
|
+
@html.text!(hEnvironment[:solarElevation].to_s)
|
50
|
+
@html.br
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require_relative 'html_pass'
|
2
|
+
require_relative 'html_instrument'
|
3
|
+
require_relative 'html_extent'
|
4
|
+
require_relative 'html_identifier'
|
5
|
+
|
6
|
+
module ADIWG
|
7
|
+
module Mdtranslator
|
8
|
+
module Writers
|
9
|
+
module Html
|
10
|
+
class Html_Event
|
11
|
+
def initialize(html)
|
12
|
+
@html = html
|
13
|
+
end
|
14
|
+
|
15
|
+
def writeHtml(hEvent)
|
16
|
+
passClass = Html_Pass.new(@html)
|
17
|
+
instrumentClass = Html_Instrument.new(@html)
|
18
|
+
extentClass = Html_Extent.new(@html)
|
19
|
+
identifierClass = Html_Identifier.new(@html)
|
20
|
+
|
21
|
+
# eventId
|
22
|
+
unless hEvent[:eventId].nil?
|
23
|
+
@html.em('Event ID: ')
|
24
|
+
@html.text!(hEvent[:eventId])
|
25
|
+
@html.br
|
26
|
+
end
|
27
|
+
|
28
|
+
# identifier
|
29
|
+
unless hEvent[:identifier].empty?
|
30
|
+
@html.section(:class => 'block') do
|
31
|
+
@html.details do
|
32
|
+
@html.summary('Identifier', {'class' => 'h4'})
|
33
|
+
@html.section(:class => 'block') do
|
34
|
+
identifierClass.writeHtml(hEvent[:identifier])
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# trigger
|
41
|
+
unless hEvent[:trigger].nil?
|
42
|
+
@html.em('Trigger: ')
|
43
|
+
@html.text!(hEvent[:trigger])
|
44
|
+
@html.br
|
45
|
+
end
|
46
|
+
|
47
|
+
# context
|
48
|
+
unless hEvent[:context].nil?
|
49
|
+
@html.em('Context: ')
|
50
|
+
@html.text!(hEvent[:context])
|
51
|
+
@html.br
|
52
|
+
end
|
53
|
+
|
54
|
+
# sequence
|
55
|
+
unless hEvent[:sequence].nil?
|
56
|
+
@html.em('Sequence: ')
|
57
|
+
@html.text!(hEvent[:sequence])
|
58
|
+
@html.br
|
59
|
+
end
|
60
|
+
|
61
|
+
# time
|
62
|
+
unless hEvent[:dateTime].nil? || hEvent[:dateTime].empty?
|
63
|
+
@html.em('Datetime: ')
|
64
|
+
@html.section(:class => 'block') do
|
65
|
+
@html.text!.writeHtml(hEvent[:dateTime][:dateTime].to_s)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# expectedObjective
|
70
|
+
unless hEvent[:expectedObjectives].empty?
|
71
|
+
@html.section(:class => 'block') do
|
72
|
+
@html.details do
|
73
|
+
@html.summary('Expected Objective', {'class' => 'h4'})
|
74
|
+
hEvent[:expectedObjectives].each do |objective|
|
75
|
+
@html.section(:class => 'block') do
|
76
|
+
@html.details do
|
77
|
+
@html.summary('Objective', {'class' => 'h5'})
|
78
|
+
objectiveClass.writeHtml(objective)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# relatedPass
|
87
|
+
unless hEvent[:relatedPass].empty?
|
88
|
+
@html.section(:class => 'block') do
|
89
|
+
@html.details do
|
90
|
+
@html.summary('Related Pass', {'class' => 'h4'})
|
91
|
+
@html.section(:class => 'block') do
|
92
|
+
passClass.writeHtml(hEvent[:relatedPass])
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
#relatedSensor
|
99
|
+
unless hEvent[:relatedSensors].empty?
|
100
|
+
@html.section(:class => 'block') do
|
101
|
+
@html.details do
|
102
|
+
@html.summary('Related Sensors', {'class' => 'h4'})
|
103
|
+
hEvent[:relatedSensors].each do |instrument|
|
104
|
+
@html.section(:class => 'block') do
|
105
|
+
@html.details do
|
106
|
+
@html.summary('Instrument', {'class' => 'h5'})
|
107
|
+
instrumentClass.writeHtml(instrument)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
end # writeHtml
|
116
|
+
end # Html_Event
|
117
|
+
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|