adiwg-mdtranslator 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +51 -1
- data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +33 -2
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +68 -35
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +66 -0
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +7 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +10 -1
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +38 -19
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +68 -19
- data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +3 -0
- data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +4 -2
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +87 -79
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +150 -115
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +184 -113
- data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +56 -0
- data/lib/adiwg/mdtranslator/version.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +3 -3
- data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +6 -6
- data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +74 -38
- data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +68 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +130 -76
- data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +78 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +1 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +37 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +229 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +65 -0
- data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +19 -1
- data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +69 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_address.rb +103 -103
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +185 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +60 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionReference.rb +45 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +107 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +187 -187
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +123 -117
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +155 -141
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_gcoDateTime.rb +48 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +54 -55
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +56 -0
- data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_series.rb +63 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_attributeGroup.rb +51 -50
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +181 -180
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +96 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_ellipsoidParameters.rb +62 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +54 -54
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +301 -298
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +53 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +229 -0
- data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +49 -32
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +5 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +7 -1
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +18 -2
- data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_valueRange.rb +28 -0
- data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +33 -13
- metadata +22 -4
- data/lib/adiwg/mdtranslator/readers/mdJson/version.rb +0 -16
@@ -2,129 +2,200 @@
|
|
2
2
|
# Reader - ADIwg JSON V1 to internal data structure
|
3
3
|
|
4
4
|
# History:
|
5
|
-
#
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
5
|
+
# Stan Smith 2017-11-01 added new elements to support fgdc and flat files
|
6
|
+
# Stan Smith 2016-10-05 refactored for mdJson 2.0
|
7
|
+
# Stan Smith 2015-07-24 added error reporting of missing items
|
8
|
+
# Stan Smith 2015-07-14 refactored to remove global namespace constants
|
9
|
+
# Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
|
10
|
+
# Stan Smith 2015-02-17 added support for attribute aliases
|
11
|
+
# Stan Smith 2014-12-15 refactored to handle namespacing readers and writers
|
11
12
|
# Stan Smith 2013-12-01 original script
|
12
13
|
|
13
|
-
module ADIWG
|
14
|
-
module Mdtranslator
|
15
|
-
module Readers
|
16
|
-
module MdJson
|
17
|
-
|
18
|
-
module EntityAttribute
|
19
|
-
|
20
|
-
def self.unpack(hAttribute, responseObj)
|
21
|
-
|
22
|
-
# return nil object if input is empty
|
23
|
-
if hAttribute.empty?
|
24
|
-
responseObj[:readerExecutionMessages] << 'Entity Attribute object is empty'
|
25
|
-
responseObj[:readerExecutionPass] = false
|
26
|
-
return nil
|
27
|
-
end
|
28
|
-
|
29
|
-
# instance classes needed in script
|
30
|
-
intMetadataClass = InternalMetadata.new
|
31
|
-
intAttribute = intMetadataClass.newEntityAttribute
|
32
|
-
|
33
|
-
# attribute - common name
|
34
|
-
if hAttribute.has_key?('commonName')
|
35
|
-
if hAttribute['commonName'] != ''
|
36
|
-
intAttribute[:attributeName] = hAttribute['commonName']
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# attribute - code name (required)
|
41
|
-
if hAttribute.has_key?('codeName')
|
42
|
-
intAttribute[:attributeCode] = hAttribute['codeName']
|
43
|
-
end
|
44
|
-
if intAttribute[:attributeCode].nil? || intAttribute[:attributeCode] == ''
|
45
|
-
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute code name is missing'
|
46
|
-
responseObj[:readerExecutionPass] = false
|
47
|
-
return nil
|
48
|
-
end
|
49
|
-
|
50
|
-
# attribute - alias []
|
51
|
-
if hAttribute.has_key?('alias')
|
52
|
-
hAttribute['alias'].each do |item|
|
53
|
-
if item != ''
|
54
|
-
intAttribute[:attributeAlias] << item
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# attribute - definition (required)
|
60
|
-
if hAttribute.has_key?('definition')
|
61
|
-
intAttribute[:attributeDefinition] = hAttribute['definition']
|
62
|
-
end
|
63
|
-
if intAttribute[:attributeDefinition].nil? || intAttribute[:attributeDefinition] == ''
|
64
|
-
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute definition is missing'
|
65
|
-
responseObj[:readerExecutionPass] = false
|
66
|
-
return nil
|
67
|
-
end
|
68
|
-
|
69
|
-
# attribute - data type (required)
|
70
|
-
if hAttribute.has_key?('dataType')
|
71
|
-
intAttribute[:dataType] = hAttribute['dataType']
|
72
|
-
end
|
73
|
-
if intAttribute[:dataType].nil? || intAttribute[:dataType] == ''
|
74
|
-
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute data type is missing'
|
75
|
-
responseObj[:readerExecutionPass] = false
|
76
|
-
return nil
|
77
|
-
end
|
78
|
-
|
79
|
-
# attribute - minimum cardinality (required)
|
80
|
-
if hAttribute.has_key?('allowNull')
|
81
|
-
if hAttribute['allowNull'] === true
|
82
|
-
intAttribute[:allowNull] = hAttribute['allowNull']
|
83
|
-
end
|
84
|
-
end
|
85
14
|
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
intAttribute[:allowMany] = hAttribute['allowMany']
|
90
|
-
end
|
91
|
-
end
|
15
|
+
require_relative 'module_citation'
|
16
|
+
require_relative 'module_valueRange'
|
17
|
+
require_relative 'module_timePeriod'
|
92
18
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
19
|
+
module ADIWG
|
20
|
+
module Mdtranslator
|
21
|
+
module Readers
|
22
|
+
module MdJson
|
23
|
+
|
24
|
+
module EntityAttribute
|
25
|
+
|
26
|
+
def self.unpack(hAttribute, responseObj)
|
27
|
+
|
28
|
+
# return nil object if input is empty
|
29
|
+
if hAttribute.empty?
|
30
|
+
responseObj[:readerExecutionMessages] << 'Entity Attribute object is empty'
|
31
|
+
responseObj[:readerExecutionPass] = false
|
32
|
+
return nil
|
33
|
+
end
|
34
|
+
|
35
|
+
# instance classes needed in script
|
36
|
+
intMetadataClass = InternalMetadata.new
|
37
|
+
intAttribute = intMetadataClass.newEntityAttribute
|
38
|
+
|
39
|
+
# attribute - common name
|
40
|
+
if hAttribute.has_key?('commonName')
|
41
|
+
if hAttribute['commonName'] != ''
|
42
|
+
intAttribute[:attributeName] = hAttribute['commonName']
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# attribute - code name (required)
|
47
|
+
if hAttribute.has_key?('codeName')
|
48
|
+
intAttribute[:attributeCode] = hAttribute['codeName']
|
49
|
+
end
|
50
|
+
if intAttribute[:attributeCode].nil? || intAttribute[:attributeCode] == ''
|
51
|
+
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute code name is missing'
|
52
|
+
responseObj[:readerExecutionPass] = false
|
53
|
+
return nil
|
54
|
+
end
|
55
|
+
|
56
|
+
# attribute - alias []
|
57
|
+
if hAttribute.has_key?('alias')
|
58
|
+
hAttribute['alias'].each do |item|
|
59
|
+
if item != ''
|
60
|
+
intAttribute[:attributeAlias] << item
|
98
61
|
end
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# attribute - definition (required)
|
66
|
+
if hAttribute.has_key?('definition')
|
67
|
+
intAttribute[:attributeDefinition] = hAttribute['definition']
|
68
|
+
end
|
69
|
+
if intAttribute[:attributeDefinition].nil? || intAttribute[:attributeDefinition] == ''
|
70
|
+
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute definition is missing'
|
71
|
+
responseObj[:readerExecutionPass] = false
|
72
|
+
return nil
|
73
|
+
end
|
74
|
+
|
75
|
+
# attribute - attribute reference
|
76
|
+
if hAttribute.has_key?('attributeReference')
|
77
|
+
hCitation = hAttribute['attributeReference']
|
78
|
+
unless hCitation.empty?
|
79
|
+
hReturn = Citation.unpack(hCitation, responseObj)
|
80
|
+
unless hReturn.nil?
|
81
|
+
intAttribute[:attributeReference] = hReturn
|
105
82
|
end
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# attribute - data type (required)
|
87
|
+
if hAttribute.has_key?('dataType')
|
88
|
+
intAttribute[:dataType] = hAttribute['dataType']
|
89
|
+
end
|
90
|
+
if intAttribute[:dataType].nil? || intAttribute[:dataType] == ''
|
91
|
+
responseObj[:readerExecutionMessages] << 'Data Dictionary attribute data type is missing'
|
92
|
+
responseObj[:readerExecutionPass] = false
|
93
|
+
return nil
|
94
|
+
end
|
95
|
+
|
96
|
+
# attribute - minimum cardinality (required)
|
97
|
+
if hAttribute.has_key?('allowNull')
|
98
|
+
if hAttribute['allowNull'] === true
|
99
|
+
intAttribute[:allowNull] = hAttribute['allowNull']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# attribute - maximum cardinality
|
104
|
+
if hAttribute.has_key?('allowMany')
|
105
|
+
if hAttribute['allowMany'] === true
|
106
|
+
intAttribute[:allowMany] = hAttribute['allowMany']
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
# attribute - units of measure
|
111
|
+
if hAttribute.has_key?('units')
|
112
|
+
if hAttribute['units'] != ''
|
113
|
+
intAttribute[:unitOfMeasure] = hAttribute['units']
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
# attribute - units of measure resolution
|
118
|
+
if hAttribute.has_key?('unitsResolution')
|
119
|
+
if hAttribute['unitsResolution'] != ''
|
120
|
+
intAttribute[:measureResolution] = hAttribute['unitsResolution']
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# attribute - case sensitive {Boolean} (default = false)
|
125
|
+
if hAttribute.has_key?('isCaseSensitive')
|
126
|
+
if hAttribute['unitsResolution'] != ''
|
127
|
+
intAttribute[:isCaseSensitive] = hAttribute['isCaseSensitive']
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
# attribute - field width
|
132
|
+
if hAttribute.has_key?('fieldWidth')
|
133
|
+
if hAttribute['fieldWidth'] != ''
|
134
|
+
intAttribute[:fieldWidth] = hAttribute['fieldWidth']
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# attribute - missing value
|
139
|
+
if hAttribute.has_key?('missingValue')
|
140
|
+
if hAttribute['missingValue'] != ''
|
141
|
+
intAttribute[:missingValue] = hAttribute['missingValue']
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# attribute - domain ID
|
146
|
+
if hAttribute.has_key?('domainId')
|
147
|
+
if hAttribute['domainId'] != ''
|
148
|
+
intAttribute[:domainId] = hAttribute['domainId']
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# attribute - minimum value
|
153
|
+
if hAttribute.has_key?('minValue')
|
154
|
+
if hAttribute['minValue'] != ''
|
155
|
+
intAttribute[:minValue] = hAttribute['minValue']
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# attribute - maximum value
|
160
|
+
if hAttribute.has_key?('maxValue')
|
161
|
+
if hAttribute['maxValue'] != ''
|
162
|
+
intAttribute[:maxValue] = hAttribute['maxValue']
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
# attribute - domain range of values [] {valueRange}
|
167
|
+
if hAttribute.has_key?('rangeOfValues')
|
168
|
+
aValueRange = hAttribute['rangeOfValues']
|
169
|
+
aValueRange.each do |hRange|
|
170
|
+
unless hRange.empty?
|
171
|
+
hReturn = ValueRange.unpack(hRange, responseObj)
|
172
|
+
unless hReturn.nil?
|
173
|
+
intAttribute[:rangeOfValues] << hReturn
|
174
|
+
end
|
112
175
|
end
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# attribute - time period of values [] {timePeriod}
|
180
|
+
if hAttribute.has_key?('timePeriodOfValues')
|
181
|
+
aTimePeriods = hAttribute['timePeriodOfValues']
|
182
|
+
aTimePeriods.each do |hTimePeriod|
|
183
|
+
unless hTimePeriod.empty?
|
184
|
+
hReturn = TimePeriod.unpack(hTimePeriod, responseObj)
|
185
|
+
unless hReturn.nil?
|
186
|
+
intAttribute[:timePeriodOfValues] << hReturn
|
187
|
+
end
|
119
188
|
end
|
189
|
+
end
|
190
|
+
end
|
120
191
|
|
121
|
-
|
122
|
-
|
123
|
-
end
|
192
|
+
return intAttribute
|
124
193
|
|
125
|
-
|
194
|
+
end
|
126
195
|
|
127
196
|
end
|
128
|
-
|
129
|
-
|
197
|
+
|
198
|
+
end
|
199
|
+
end
|
200
|
+
end
|
130
201
|
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# unpack series
|
2
|
+
# Reader - ADIwg JSON to internal data structure
|
3
|
+
|
4
|
+
# History:
|
5
|
+
# Stan Smith 2017-11-01 original script
|
6
|
+
|
7
|
+
module ADIWG
|
8
|
+
module Mdtranslator
|
9
|
+
module Readers
|
10
|
+
module MdJson
|
11
|
+
|
12
|
+
module ValueRange
|
13
|
+
|
14
|
+
def self.unpack(hRange, responseObj)
|
15
|
+
|
16
|
+
# return nil object if input is empty
|
17
|
+
if hRange.empty?
|
18
|
+
responseObj[:readerExecutionMessages] << 'Value Range object is empty'
|
19
|
+
responseObj[:readerExecutionPass] = false
|
20
|
+
return nil
|
21
|
+
end
|
22
|
+
|
23
|
+
# instance classes needed in script
|
24
|
+
intMetadataClass = InternalMetadata.new
|
25
|
+
intRange = intMetadataClass.newValueRange
|
26
|
+
|
27
|
+
# value range - minimum range value (required)
|
28
|
+
if hRange.has_key?('minRangeValue')
|
29
|
+
intRange[:minRangeValue] = hRange['minRangeValue']
|
30
|
+
end
|
31
|
+
if intRange[:minRangeValue].nil? || intRange[:minRangeValue] == ''
|
32
|
+
responseObj[:readerExecutionMessages] << 'Value Range object is missing minimum'
|
33
|
+
responseObj[:readerExecutionPass] = false
|
34
|
+
return nil
|
35
|
+
end
|
36
|
+
|
37
|
+
# value range - maximum range value (required)
|
38
|
+
if hRange.has_key?('maxRangeValue')
|
39
|
+
intRange[:maxRangeValue] = hRange['maxRangeValue']
|
40
|
+
end
|
41
|
+
if intRange[:maxRangeValue].nil? || intRange[:maxRangeValue] == ''
|
42
|
+
responseObj[:readerExecutionMessages] << 'Value Range object is missing maximum'
|
43
|
+
responseObj[:readerExecutionPass] = false
|
44
|
+
return nil
|
45
|
+
end
|
46
|
+
|
47
|
+
return intRange
|
48
|
+
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
@@ -1,6 +1,12 @@
|
|
1
1
|
# adiwg mdTranslator
|
2
2
|
|
3
3
|
# version 2 history
|
4
|
+
# 2.5.0 2017-11-03 bug fix, add test to verify mdJson reader version is compatible with schema version
|
5
|
+
# 2.5.0 2017-11-03 added support for additional fgdc and bio data dictionary element
|
6
|
+
# 2.4.1 2017-11-02 refactored mdJson writer for added entity, attribute, and domain elements
|
7
|
+
# 2.4.1 2017-10-31 fix issue with computation of federal fiscal year in sbJson budget writer
|
8
|
+
# 2.4.1 2017-10-30 refactored fgdc reader for added entity, attribute, and domain elements
|
9
|
+
# 2.4.0 2017-10-25 added html writers for reference system parameter set
|
4
10
|
# 2.4.0 2017-10-24 added mdJson writers for reference system parameter set
|
5
11
|
# 2.4.0 2017-10-19 added mdJson reader for geographicResolution
|
6
12
|
# 2.4.0 2017-10-19 added mdJson reader for bearingDistanceResolution
|
@@ -38,7 +44,7 @@
|
|
38
44
|
module ADIWG
|
39
45
|
module Mdtranslator
|
40
46
|
# current mdtranslator version
|
41
|
-
VERSION = "2.
|
47
|
+
VERSION = "2.5.0"
|
42
48
|
end
|
43
49
|
end
|
44
50
|
|
@@ -90,9 +90,9 @@ module ADIWG
|
|
90
90
|
end
|
91
91
|
|
92
92
|
# report title
|
93
|
-
aShortVersion = version.split('.')
|
94
|
-
shortVersion = aShortVersion[0].to_s + '.' + aShortVersion[1].to_s
|
95
|
-
@html.h1('mdTranslator ' +
|
93
|
+
# aShortVersion = version.split('.')
|
94
|
+
# shortVersion = aShortVersion[0].to_s + '.' + aShortVersion[1].to_s
|
95
|
+
@html.h1('mdTranslator ' + version + ' HTML Metadata Record', 'id' => 'mdtranslator-metadata-report')
|
96
96
|
|
97
97
|
# report date
|
98
98
|
@html.section(:class => 'block') do
|
@@ -40,21 +40,21 @@ module ADIWG
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# dictionary - domains [] {domain}
|
43
|
-
hDictionary[:domains].
|
43
|
+
unless hDictionary[:domains].empty?
|
44
44
|
@html.details do
|
45
|
-
@html.summary('
|
45
|
+
@html.summary('Domains', {'class' => 'h5'})
|
46
46
|
@html.section(:class => 'block') do
|
47
|
-
domainClass.writeHtml(
|
47
|
+
domainClass.writeHtml(hDictionary[:domains])
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
51
51
|
|
52
52
|
# dictionary - entities [] {entity}
|
53
|
-
hDictionary[:entities].
|
53
|
+
unless hDictionary[:entities].empty?
|
54
54
|
@html.details do
|
55
|
-
@html.summary('
|
55
|
+
@html.summary('Entities', {'class' => 'h5'})
|
56
56
|
@html.section(:class => 'block') do
|
57
|
-
entityClass.writeHtml(
|
57
|
+
entityClass.writeHtml(hDictionary[:entities])
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -2,11 +2,13 @@
|
|
2
2
|
# domain
|
3
3
|
|
4
4
|
# History:
|
5
|
+
# Stan Smith 2017-11-03 added domainReference
|
5
6
|
# Stan Smith 2017-04-05 refactored for mdTranslator 2.0
|
6
7
|
# Stan Smith 2015-07-16 refactored to remove global namespace $HtmlNS
|
7
8
|
# Stan Smith 2015-03-26 original script
|
8
9
|
|
9
10
|
require_relative 'html_domainItem'
|
11
|
+
require_relative 'html_citation'
|
10
12
|
|
11
13
|
module ADIWG
|
12
14
|
module Mdtranslator
|
@@ -19,50 +21,84 @@ module ADIWG
|
|
19
21
|
@html = html
|
20
22
|
end
|
21
23
|
|
22
|
-
def writeHtml(
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
@html.text!(hDomain[:domainName])
|
38
|
-
@html.br
|
39
|
-
end
|
40
|
-
|
41
|
-
# domain - code
|
42
|
-
unless hDomain[:domainCode].nil?
|
43
|
-
@html.em('Code: ')
|
44
|
-
@html.text!(hDomain[:domainCode])
|
45
|
-
@html.br
|
46
|
-
end
|
47
|
-
|
48
|
-
# domain - description
|
49
|
-
unless hDomain[:domainDescription].nil?
|
50
|
-
@html.em('Description: ')
|
51
|
-
@html.section(:class => 'block') do
|
52
|
-
@html.text!(hDomain[:domainDescription])
|
53
|
-
end
|
54
|
-
end
|
24
|
+
def writeHtml(aDomains)
|
25
|
+
|
26
|
+
aDomains.each do |hDomain|
|
27
|
+
|
28
|
+
# classes used
|
29
|
+
itemClass = Html_DomainItem.new(@html)
|
30
|
+
citationClass = Html_Citation.new(@html)
|
31
|
+
|
32
|
+
dName = 'domain'
|
33
|
+
dName = hDomain[:domainCode] unless hDomain[:domainCode].nil?
|
34
|
+
dName = hDomain[:domainName] unless hDomain[:domainName].nil?
|
35
|
+
|
36
|
+
type = 'UNREPRESENTABLE'
|
37
|
+
type = 'CODESET' unless hDomain[:domainReference].empty?
|
38
|
+
type = 'ENUMERATED' unless hDomain[:domainItems].empty?
|
55
39
|
|
56
|
-
# domain - domain items [] {domainItem}
|
57
|
-
hDomain[:domainItems].each do |hItem|
|
58
40
|
@html.details do
|
59
|
-
@html.summary(
|
41
|
+
@html.summary(dName, {'class' => 'h5'})
|
60
42
|
@html.section(:class => 'block') do
|
61
|
-
|
43
|
+
|
44
|
+
# domain - type
|
45
|
+
@html.em('Domain Type: ')
|
46
|
+
@html.text!(type)
|
47
|
+
@html.br
|
48
|
+
|
49
|
+
# domain - id
|
50
|
+
unless hDomain[:domainId].nil?
|
51
|
+
@html.em('ID: ')
|
52
|
+
@html.text!(hDomain[:domainId])
|
53
|
+
@html.br
|
54
|
+
end
|
55
|
+
|
56
|
+
# domain - name
|
57
|
+
unless hDomain[:domainName].nil?
|
58
|
+
@html.em('Name: ')
|
59
|
+
@html.text!(hDomain[:domainName])
|
60
|
+
@html.br
|
61
|
+
end
|
62
|
+
|
63
|
+
# domain - code
|
64
|
+
unless hDomain[:domainCode].nil?
|
65
|
+
@html.em('Code: ')
|
66
|
+
@html.text!(hDomain[:domainCode])
|
67
|
+
@html.br
|
68
|
+
end
|
69
|
+
|
70
|
+
# domain - description
|
71
|
+
unless hDomain[:domainDescription].nil?
|
72
|
+
@html.em('Description: ')
|
73
|
+
@html.section(:class => 'block') do
|
74
|
+
@html.text!(hDomain[:domainDescription])
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# domain - domain reference {citation}
|
79
|
+
unless hDomain[:domainReference].empty?
|
80
|
+
@html.details do
|
81
|
+
@html.summary('Reference', {'class' => 'h5'})
|
82
|
+
@html.section(:class => 'block') do
|
83
|
+
citationClass.writeHtml(hDomain[:domainReference])
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
# domain - domain items [] {domainItem}
|
89
|
+
hDomain[:domainItems].each do |hItem|
|
90
|
+
@html.details do
|
91
|
+
@html.summary(hItem[:itemValue], {'class' => 'h5'})
|
92
|
+
@html.section(:class => 'block') do
|
93
|
+
itemClass.writeHtml(hItem)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
62
98
|
end
|
63
99
|
end
|
64
|
-
end
|
65
100
|
|
101
|
+
end # aDomain
|
66
102
|
end # writeHtml
|
67
103
|
end # Html_Domain
|
68
104
|
|