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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +51 -1
  3. data/lib/adiwg/mdtranslator/internal/internal_metadata_obj.rb +33 -2
  4. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_attribute.rb +68 -35
  5. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_codeSet.rb +66 -0
  6. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entity.rb +7 -1
  7. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_entityOverview.rb +10 -1
  8. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_enumerated.rb +38 -19
  9. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_range.rb +68 -19
  10. data/lib/adiwg/mdtranslator/readers/fgdc/modules/module_transferInfo.rb +3 -0
  11. data/lib/adiwg/mdtranslator/readers/mdJson/mdJson_reader.rb +4 -2
  12. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_domain.rb +87 -79
  13. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entity.rb +150 -115
  14. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityAttribute.rb +184 -113
  15. data/lib/adiwg/mdtranslator/readers/mdJson/modules/module_valueRange.rb +56 -0
  16. data/lib/adiwg/mdtranslator/version.rb +7 -1
  17. data/lib/adiwg/mdtranslator/writers/html/sections/html_body.rb +3 -3
  18. data/lib/adiwg/mdtranslator/writers/html/sections/html_dataDictionary.rb +6 -6
  19. data/lib/adiwg/mdtranslator/writers/html/sections/html_domain.rb +74 -38
  20. data/lib/adiwg/mdtranslator/writers/html/sections/html_ellipsoidParameters.rb +68 -0
  21. data/lib/adiwg/mdtranslator/writers/html/sections/html_entity.rb +130 -76
  22. data/lib/adiwg/mdtranslator/writers/html/sections/html_entityAttribute.rb +78 -0
  23. data/lib/adiwg/mdtranslator/writers/html/sections/html_identifier.rb +1 -1
  24. data/lib/adiwg/mdtranslator/writers/html/sections/html_obliqueLinePoint.rb +37 -0
  25. data/lib/adiwg/mdtranslator/writers/html/sections/html_projectionParameters.rb +229 -0
  26. data/lib/adiwg/mdtranslator/writers/html/sections/html_referenceSystemParameters.rb +65 -0
  27. data/lib/adiwg/mdtranslator/writers/html/sections/html_spatialReference.rb +19 -1
  28. data/lib/adiwg/mdtranslator/writers/html/sections/html_verticalDatumParameters.rb +69 -0
  29. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_address.rb +103 -103
  30. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_citation.rb +185 -0
  31. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_date.rb +60 -0
  32. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_definitionReference.rb +45 -0
  33. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_domain.rb +107 -0
  34. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_fcFeatureCatalogue.rb +187 -187
  35. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureAttribute.rb +123 -117
  36. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_featureType.rb +155 -141
  37. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_gcoDateTime.rb +48 -0
  38. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_listedValue.rb +54 -55
  39. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_mdIdentifier.rb +56 -0
  40. data/lib/adiwg/mdtranslator/writers/iso19110/classes/class_series.rb +63 -0
  41. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_attributeGroup.rb +51 -50
  42. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_citation.rb +181 -180
  43. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_crs.rb +96 -0
  44. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_ellipsoidParameters.rb +62 -0
  45. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_keyword.rb +54 -54
  46. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_miMetadata.rb +301 -298
  47. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_obliqueLinePoint.rb +53 -0
  48. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_projectionParameters.rb +229 -0
  49. data/lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_referenceSystem.rb +49 -32
  50. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_domain.rb +5 -2
  51. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entity.rb +7 -1
  52. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_entityAttribute.rb +18 -2
  53. data/lib/adiwg/mdtranslator/writers/mdJson/sections/mdJson_valueRange.rb +28 -0
  54. data/lib/adiwg/mdtranslator/writers/sbJson/sections/sbJson_budget.rb +33 -13
  55. metadata +22 -4
  56. data/lib/adiwg/mdtranslator/readers/mdJson/version.rb +0 -16
@@ -3,127 +3,133 @@
3
3
  # create attributes for entities
4
4
 
5
5
  # History:
6
- # Stan Smith 2017-02-02 refactored for mdTranslator/mdJson 2.0
7
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
8
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
9
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
10
- # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
6
+ # Stan Smith 2017-11-02 split out domain from attribute
7
+ # Stan Smith 2017-02-02 refactored for mdTranslator/mdJson 2.0
8
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
9
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
10
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
11
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
11
12
  # Stan Smith 2014-12-02 original script
12
13
 
13
14
  require_relative 'class_multiplicity'
14
- require_relative 'class_listedValue'
15
15
  require_relative 'class_unitsOfMeasure'
16
+ require_relative 'class_definitionReference'
17
+ require_relative 'class_domain'
16
18
 
17
19
  module ADIWG
18
- module Mdtranslator
19
- module Writers
20
- module Iso19110
21
-
22
- class FC_FeatureAttribute
23
-
24
- def initialize(xml, responseObj)
25
- @xml = xml
26
- @hResponseObj = responseObj
27
- end
28
-
29
- def writeXML(hAttribute)
30
-
31
- # classes used
32
- multiClass = Multiplicity.new(@xml, @hResponseObj)
33
- listClass = FC_ListedValue.new(@xml, @hResponseObj)
34
- uomClass = UnitsOfMeasure.new(@xml, @hResponseObj)
35
-
36
- @xml.tag!('gfc:FC_FeatureAttribute') do
37
-
38
- # feature attribute - member name (required)
39
- # used for attribute common name
40
- s = hAttribute[:attributeName]
41
- unless s.nil?
42
- @xml.tag!('gfc:memberName') do
43
- @xml.tag!('gco:LocalName', s)
44
- end
45
- end
46
- if s.nil?
47
- @xml.tag!('gfc:memberName', {'gco:nilReason' => 'missing'})
48
- end
49
-
50
- # feature attribute - definition
51
- # not required by ISO, but important enough to indicate if missing
52
- s = hAttribute[:attributeDefinition]
53
- unless s.nil?
54
- @xml.tag!('gfc:definition') do
55
- @xml.tag!('gco:CharacterString', s)
56
- end
57
- end
58
- if s.nil?
59
- @xml.tag!('gfc:definition', {'gco:nilReason' => 'missing'})
60
- end
61
-
62
- # feature attribute - cardinality (required)
63
- @xml.tag!('gfc:cardinality') do
64
- multiClass.writeXML(hAttribute)
65
- end
66
-
67
- # feature attribute - code
68
- s = hAttribute[:attributeCode]
69
- unless s.nil?
70
- @xml.tag!('gfc:code') do
71
- @xml.tag!('gco:CharacterString', s)
72
- end
73
- end
74
- if s.nil? && @hResponseObj[:writerShowTags]
75
- @xml.tag!('gfc:code')
76
- end
77
-
78
- # feature attribute - value measurement unit (units of measure)
79
- s = hAttribute[:unitOfMeasure]
80
- unless s.nil?
81
- @xml.tag!('gfc:valueMeasurementUnit') do
82
- uomClass.writeUnits(s)
83
- end
84
- end
85
- if s.nil? && @hResponseObj[:writerShowTags]
86
- @xml.tag!('gfc:valueMeasurementUnit')
87
- end
88
-
89
- # feature attribute - value type (datatype)
90
- s = hAttribute[:dataType]
91
- unless s.nil?
92
- @xml.tag!('gfc:valueType') do
93
- @xml.tag!('gco:TypeName') do
94
- @xml.tag!('gco:aName') do
95
- @xml.tag!('gco:CharacterString', s)
96
- end
97
- end
98
- end
99
- end
100
- if s.nil? && @hResponseObj[:writerShowTags]
101
- @xml.tag!('gfc:valueType')
102
- end
103
-
104
- # feature attribute - listed value (domain)
105
- domainID = hAttribute[:domainId]
106
- unless domainID.nil?
107
- # find domain in domain array
108
- hDomain = ADIWG::Mdtranslator::Writers::Iso19110.getDomain(domainID)
109
- unless hDomain.empty?
110
- aItems = hDomain[:domainItems]
111
- aItems.each do |hItem|
112
- @xml.tag!('gfc:listedValue') do
113
- listClass.writeXML(hItem)
114
- end
115
- end
116
- end
117
- end
118
- if domainID.nil? && @hResponseObj[:writerShowTags]
119
- @xml.tag!('gfc:listedValue')
120
- end
121
-
122
- end # gfc:FC_FeatureAttribute tag
123
- end # writeXML
124
- end # gfc:FC_FeatureAttribute class
125
-
126
- end
127
- end
128
- end
20
+ module Mdtranslator
21
+ module Writers
22
+ module Iso19110
23
+
24
+ class FC_FeatureAttribute
25
+
26
+ def initialize(xml, responseObj)
27
+ @xml = xml
28
+ @hResponseObj = responseObj
29
+ end
30
+
31
+ def writeXML(hAttribute)
32
+
33
+ # classes used
34
+ multiClass = Multiplicity.new(@xml, @hResponseObj)
35
+ uomClass = UnitsOfMeasure.new(@xml, @hResponseObj)
36
+ defRefClass = FC_DefinitionReference.new(@xml, @hResponseObj)
37
+ domainClass = Domain.new(@xml, @hResponseObj)
38
+
39
+ @xml.tag!('gfc:FC_FeatureAttribute') do
40
+
41
+ # feature attribute - member name (required)
42
+ # used for attribute common name
43
+ s = hAttribute[:attributeName]
44
+ unless s.nil?
45
+ @xml.tag!('gfc:memberName') do
46
+ @xml.tag!('gco:LocalName', s)
47
+ end
48
+ end
49
+ if s.nil?
50
+ @xml.tag!('gfc:memberName', {'gco:nilReason' => 'missing'})
51
+ end
52
+
53
+ # feature attribute - definition
54
+ # not required by ISO, but important enough to indicate if missing
55
+ s = hAttribute[:attributeDefinition]
56
+ unless s.nil?
57
+ @xml.tag!('gfc:definition') do
58
+ @xml.tag!('gco:CharacterString', s)
59
+ end
60
+ end
61
+ if s.nil?
62
+ @xml.tag!('gfc:definition', {'gco:nilReason' => 'missing'})
63
+ end
64
+
65
+ # feature attribute - cardinality (required)
66
+ @xml.tag!('gfc:cardinality') do
67
+ multiClass.writeXML(hAttribute)
68
+ end
69
+
70
+ # feature attribute - definition reference {definitionReference}
71
+ hCitation = hAttribute[:attributeReference]
72
+ unless hCitation.empty?
73
+ @xml.tag!('gfc:definitionReference') do
74
+ defRefClass.writeXML(hCitation)
75
+ end
76
+ end
77
+ if hCitation.empty? && @hResponseObj[:writerShowTags]
78
+ @xml.tag!('gfc:definitionReference')
79
+ end
80
+
81
+ # feature attribute - code
82
+ s = hAttribute[:attributeCode]
83
+ unless s.nil?
84
+ @xml.tag!('gfc:code') do
85
+ @xml.tag!('gco:CharacterString', s)
86
+ end
87
+ end
88
+ if s.nil? && @hResponseObj[:writerShowTags]
89
+ @xml.tag!('gfc:code')
90
+ end
91
+
92
+ # feature attribute - value measurement unit (units of measure)
93
+ s = hAttribute[:unitOfMeasure]
94
+ unless s.nil?
95
+ @xml.tag!('gfc:valueMeasurementUnit') do
96
+ uomClass.writeUnits(s)
97
+ end
98
+ end
99
+ if s.nil? && @hResponseObj[:writerShowTags]
100
+ @xml.tag!('gfc:valueMeasurementUnit')
101
+ end
102
+
103
+ # feature attribute - value type (datatype)
104
+ s = hAttribute[:dataType]
105
+ unless s.nil?
106
+ @xml.tag!('gfc:valueType') do
107
+ @xml.tag!('gco:TypeName') do
108
+ @xml.tag!('gco:aName') do
109
+ @xml.tag!('gco:CharacterString', s)
110
+ end
111
+ end
112
+ end
113
+ end
114
+ if s.nil? && @hResponseObj[:writerShowTags]
115
+ @xml.tag!('gfc:valueType')
116
+ end
117
+
118
+ # feature attribute - domains
119
+ domainID = hAttribute[:domainId]
120
+ unless domainID.nil?
121
+ # find domain in domain array
122
+ hDomain = ADIWG::Mdtranslator::Writers::Iso19110.getDomain(domainID)
123
+ unless hDomain.empty?
124
+ domainClass.writeXML(hDomain)
125
+ end
126
+ end
127
+
128
+ end # gfc:FC_FeatureAttribute tag
129
+ end # writeXML
130
+ end # gfc:FC_FeatureAttribute class
131
+
132
+ end
133
+ end
134
+ end
129
135
  end
@@ -2,153 +2,167 @@
2
2
  # writer output in XML
3
3
 
4
4
  # History:
5
- # Stan Smith 2017-02-03 refactored for mdJson/mdTranslator 2.0
6
- # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
7
- # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
8
- # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
9
- # Stan Smith 2015-02-18 added aliases for entities
10
- # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
5
+ # Stan Smith 2017-11-02 add entity reference
6
+ # Stan Smith 2017-02-03 refactored for mdJson/mdTranslator 2.0
7
+ # Stan Smith 2015-07-14 refactored to eliminate namespace globals $WriterNS and $IsoNS
8
+ # Stan Smith 2015-07-14 refactored to make iso19110 independent of iso19115_2 classes
9
+ # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj)
10
+ # Stan Smith 2015-02-18 added aliases for entities
11
+ # Stan Smith 2014-12-12 refactored to handle namespacing readers and writers
11
12
  # Stan Smith 2014-12-02 original script
12
13
 
13
14
  require_relative 'class_featureConstraint'
14
15
  require_relative 'class_featureAttribute'
16
+ require_relative 'class_definitionReference'
15
17
 
16
18
  module ADIWG
17
- module Mdtranslator
18
- module Writers
19
- module Iso19110
20
-
21
- class FC_FeatureType
22
-
23
- def initialize(xml, responseObj)
24
- @xml = xml
25
- @hResponseObj = responseObj
26
- end
27
-
28
- def writeXML(hEntity)
29
-
30
- # classes used
31
- fConClass = FC_Constraint.new(@xml, @hResponseObj)
32
- fAttClass = FC_FeatureAttribute.new(@xml, @hResponseObj)
33
-
34
- # create an identity for the entity
35
- entityId = hEntity[:entityId]
36
- if entityId.nil?
37
- @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
38
- entityId = 'entity' + @hResponseObj[:writerMissingIdCount]
39
- else
40
- entityId.gsub!(/[^0-9a-zA-Z]/,'')
19
+ module Mdtranslator
20
+ module Writers
21
+ module Iso19110
22
+
23
+ class FC_FeatureType
24
+
25
+ def initialize(xml, responseObj)
26
+ @xml = xml
27
+ @hResponseObj = responseObj
28
+ end
29
+
30
+ def writeXML(hEntity)
31
+
32
+ # classes used
33
+ fConClass = FC_Constraint.new(@xml, @hResponseObj)
34
+ fAttClass = FC_FeatureAttribute.new(@xml, @hResponseObj)
35
+ defRefClass = FC_DefinitionReference.new(@xml, @hResponseObj)
36
+
37
+ # create an identity for the entity
38
+ entityId = hEntity[:entityId]
39
+ if entityId.nil?
40
+ @hResponseObj[:writerMissingIdCount] = @hResponseObj[:writerMissingIdCount].succ
41
+ entityId = 'entity' + @hResponseObj[:writerMissingIdCount]
42
+ else
43
+ entityId.gsub!(/[^0-9a-zA-Z]/, '')
44
+ end
45
+
46
+ @xml.tag!('gfc:FC_FeatureType', {'id' => entityId}) do
47
+
48
+ # feature type - type name (required)
49
+ # used for entity common name
50
+ s = hEntity[:entityName]
51
+ unless s.nil?
52
+ @xml.tag!('gfc:typeName') do
53
+ @xml.tag!('gco:LocalName', s)
41
54
  end
55
+ end
56
+ if s.nil?
57
+ @xml.tag!('gfc:typeName', {'gco:nilReason' => 'missing'})
58
+ end
59
+
60
+ # feature type - definition
61
+ s = hEntity[:entityDefinition]
62
+ unless s.nil?
63
+ @xml.tag!('gfc:definition') do
64
+ @xml.tag!('gco:CharacterString', s)
65
+ end
66
+ end
67
+ if s.nil? && @hResponseObj[:writerShowTags]
68
+ @xml.tag!('gfc:definition')
69
+ end
70
+
71
+ # feature type - code
72
+ # used for entity code name
73
+ s = hEntity[:entityCode]
74
+ unless s.nil?
75
+ @xml.tag!('gfc:code') do
76
+ @xml.tag!('gco:CharacterString', s)
77
+ end
78
+ end
79
+ if s.nil? && @hResponseObj[:writerShowTags]
80
+ @xml.tag!('gfc:code')
81
+ end
82
+
83
+ # feature type - isAbstract (required)
84
+ # always defaulted to false
85
+ @xml.tag!('gfc:isAbstract') do
86
+ @xml.tag!('gco:Boolean', 'false')
87
+ end
88
+
89
+ # feature type - aliases
90
+ aAliases = hEntity[:entityAlias]
91
+ aAliases.each do |myAlias|
92
+ @xml.tag!('gfc:aliases') do
93
+ @xml.tag!('gco:LocalName', myAlias)
94
+ end
95
+ end
96
+
97
+ # feature type - feature catalogue (required)
98
+ # 'role that links this feature type to the feature catalogue that contains it'
99
+ # confusing, allows definition of another feature catalogue here
100
+ # just set to nilReason = 'inapplicable' (as recommended by NOAA)
101
+ @xml.tag!('gfc:featureCatalogue', {'gco:nilReason' => 'inapplicable'})
102
+
103
+ # feature type - constrained by
104
+ # use to define primary key, foreign keys, and indexes
105
+ # feature type - primary key
106
+ aPKs = hEntity[:primaryKey]
107
+ unless aPKs.empty?
108
+ @xml.tag!('gfc:constrainedBy') do
109
+ fConClass.writeXML('pk', aPKs)
110
+ end
111
+ end
112
+ if aPKs.empty? && @hResponseObj[:writerShowTags]
113
+ @xml.tag!('gfc:constrainedBy')
114
+ end
115
+
116
+ # feature type - indexes
117
+ aIndexes = hEntity[:indexes]
118
+ unless aIndexes.empty?
119
+ aIndexes.each do |hIndex|
120
+ @xml.tag!('gfc:constrainedBy') do
121
+ fConClass.writeXML('index', hIndex)
122
+ end
123
+ end
124
+ end
125
+
126
+ # feature type - foreign keys
127
+ aFKs = hEntity[:foreignKeys]
128
+ unless aFKs.empty?
129
+ aFKs.each do |hFK|
130
+ @xml.tag!('gfc:constrainedBy') do
131
+ fConClass.writeXML('fk', hFK)
132
+ end
133
+ end
134
+ end
42
135
 
43
- @xml.tag!('gfc:FC_FeatureType', {'id' => entityId}) do
44
-
45
- # feature type - type name (required)
46
- # used for entity common name
47
- s = hEntity[:entityName]
48
- unless s.nil?
49
- @xml.tag!('gfc:typeName') do
50
- @xml.tag!('gco:LocalName', s)
51
- end
52
- end
53
- if s.nil?
54
- @xml.tag!('gfc:typeName', {'gco:nilReason' => 'missing'})
55
- end
56
-
57
- # feature type - definition
58
- s = hEntity[:entityDefinition]
59
- unless s.nil?
60
- @xml.tag!('gfc:definition') do
61
- @xml.tag!('gco:CharacterString', s)
62
- end
63
- end
64
- if s.nil? && @hResponseObj[:writerShowTags]
65
- @xml.tag!('gfc:definition')
66
- end
67
-
68
- # feature type - code
69
- # used for entity code name
70
- s = hEntity[:entityCode]
71
- unless s.nil?
72
- @xml.tag!('gfc:code') do
73
- @xml.tag!('gco:CharacterString', s)
74
- end
75
- end
76
- if s.nil? && @hResponseObj[:writerShowTags]
77
- @xml.tag!('gfc:code')
78
- end
79
-
80
- # feature type - isAbstract (required)
81
- # always defaulted to false
82
- @xml.tag!('gfc:isAbstract') do
83
- @xml.tag!('gco:Boolean', 'false')
84
- end
85
-
86
- # feature type - aliases
87
- aAliases = hEntity[:entityAlias]
88
- aAliases.each do |myAlias|
89
- @xml.tag!('gfc:aliases') do
90
- @xml.tag!('gco:LocalName',myAlias)
91
- end
92
- end
93
-
94
- # feature type - feature catalogue (required)
95
- # 'role that links this feature type to the feature catalogue that contains it'
96
- # confusing, allows definition of another feature catalogue here
97
- # just set to nilReason = 'inapplicable' (as recommended by NOAA)
98
- @xml.tag!('gfc:featureCatalogue', {'gco:nilReason' => 'inapplicable'})
99
-
100
- # feature type - constrained by
101
- # use to define primary key, foreign keys, and indexes
102
- # constraint - primary key
103
- aPKs = hEntity[:primaryKey]
104
- unless aPKs.empty?
105
- @xml.tag!('gfc:constrainedBy') do
106
- fConClass.writeXML('pk', aPKs)
107
- end
108
- end
109
- if aPKs.empty? && @hResponseObj[:writerShowTags]
110
- @xml.tag!('gfc:constrainedBy')
111
- end
112
-
113
- # constraint - indexes
114
- aIndexes = hEntity[:indexes]
115
- unless aIndexes.empty?
116
- aIndexes.each do |hIndex|
117
- @xml.tag!('gfc:constrainedBy') do
118
- fConClass.writeXML('index', hIndex)
119
- end
120
- end
121
- end
122
-
123
- # constraint - foreign keys
124
- aFKs = hEntity[:foreignKeys]
125
- unless aFKs.empty?
126
- aFKs.each do |hFK|
127
- @xml.tag!('gfc:constrainedBy') do
128
- fConClass.writeXML('fk', hFK)
129
- end
130
- end
131
- end
132
-
133
- # feature type - character of characteristics
134
- # used to define entity attributes
135
- aAttributes = hEntity[:attributes]
136
- unless aAttributes.empty?
137
- aAttributes.each do |hAttribute|
138
- @xml.tag!('gfc:carrierOfCharacteristics') do
139
- fAttClass.writeXML(hAttribute)
140
- end
141
- end
142
- end
143
- if aAttributes.empty? && @hResponseObj[:writerShowTags]
144
- @xml.tag!('gfc:carrierOfCharacteristics')
145
- end
146
-
147
- end # gfc:FC_FeatureType tag
148
- end # writeXML
149
- end # FC_FeatureType class
150
-
151
- end
152
- end
153
- end
136
+ # feature type - entity reference
137
+ aRef = hEntity[:entityReferences]
138
+ unless aRef.empty?
139
+ @xml.tag!('gfc:definitionReference') do
140
+ defRefClass.writeXML(aRef[0])
141
+ end
142
+ end
143
+ if aRef.empty? && @hResponseObj[:writerShowTags]
144
+ @xml.tag!('gfc:definitionReference')
145
+ end
146
+
147
+ # feature type - character of characteristics
148
+ # used to define entity attributes
149
+ aAttributes = hEntity[:attributes]
150
+ unless aAttributes.empty?
151
+ aAttributes.each do |hAttribute|
152
+ @xml.tag!('gfc:carrierOfCharacteristics') do
153
+ fAttClass.writeXML(hAttribute)
154
+ end
155
+ end
156
+ end
157
+ if aAttributes.empty? && @hResponseObj[:writerShowTags]
158
+ @xml.tag!('gfc:carrierOfCharacteristics')
159
+ end
160
+
161
+ end # gfc:FC_FeatureType tag
162
+ end # writeXML
163
+ end # FC_FeatureType class
164
+
165
+ end
166
+ end
167
+ end
154
168
  end