Class: MD_MetadataExtensionInformation
- Inherits:
-
Object
- Object
- MD_MetadataExtensionInformation
- Defined in:
- lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadataExtension.rb
Instance Method Summary collapse
-
#initialize(xml) ⇒ MD_MetadataExtensionInformation
constructor
A new instance of MD_MetadataExtensionInformation.
- #writeXML(hExtension) ⇒ Object
Constructor Details
#initialize(xml) ⇒ MD_MetadataExtensionInformation
Returns a new instance of MD_MetadataExtensionInformation.
15 16 17 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadataExtension.rb', line 15 def initialize(xml) @xml = xml end |
Instance Method Details
#writeXML(hExtension) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_metadataExtension.rb', line 19 def writeXML(hExtension) # classes used olResClass = CI_OnlineResource.new(@xml) rPartyClass = CI_ResponsibleParty.new(@xml) obCode = MD_ObligationCode.new(@xml) dataTCode = MD_DatatypeCode.new(@xml) @xml.tag!('gmd:MD_MetadataExtensionInformation') do # metadata extension - online resource - CI_OnLineResource hOLResource = hExtension[:onLineResource] if !hOLResource.empty? @xml.tag!('gmd:extensionOnLineResource') do olResClass.writeXML(hOLResource) end elsif $showAllTags @xml.tag!('gmd:extensionOnLineResource') end # metadata extension = extended element information @xml.tag!('gmd:extendedElementInformation') do @xml.tag!('gmd:MD_ExtendedElementInformation') do # extended element info - name - required s = hExtension[:extName] if s.nil? @xml.tag!('gmd:name',{'gco:nilReason'=>'missing'}) else @xml.tag!('gmd:name') do @xml.tag!('gco:CharacterString',s) end end # extended element info - short name s = hExtension[:extShortName] if !s.nil? @xml.tag!('gmd:shortName') do @xml.tag!('gco:CharacterString',s) end elsif $showAllTags @xml.tag!('gmd:shortName') end # extended element info - definition - required s = hExtension[:extDefinition] if s.nil? @xml.tag!('gmd:definition',{'gco:nilReason'=>'missing'}) else @xml.tag!('gmd:definition') do @xml.tag!('gco:CharacterString',s) end end # extended element info - obligation s = hExtension[:obligation] if !s.nil? @xml.tag!('gmd:obligation') do obCode.writeXML(s) end elsif $showAllTags @xml.tag!('gmd:obligation') end # extended element info - data type - required s = hExtension[:dataType] if s.nil? @xml.tag!('gmd:dataType',{'gco:nilReason'=>'missing'}) else @xml.tag!('gmd:dataType') do dataTCode.writeXML(s) end end # extended element info - maximum occurrence s = hExtension[:maxOccurrence] if !s.nil? @xml.tag!('gmd:maximumOccurrence') do @xml.tag!('gco:CharacterString',s) end elsif $showAllTags @xml.tag!('gmd:maximumOccurrence') end # extended element info - parent entity - required aParents = hExtension[:parentEntities] if aParents.empty? @xml.tag!('gmd:parentEntity',{'gco:nilReason'=>'missing'}) else aParents.each do |parent| @xml.tag!('gmd:parentEntity') do @xml.tag!('gco:CharacterString',parent) end end end # extended element info - rule s = hExtension[:rule] if s.nil? @xml.tag!('gmd:rule',{'gco:nilReason'=>'missing'}) else @xml.tag!('gmd:rule') do @xml.tag!('gco:CharacterString',s) end end # extended element info - rationale aRations = hExtension[:rationales] if aRations.empty? @xml.tag!('gmd:rationale') else aRations.each do |ration| @xml.tag!('gmd:rationale') do @xml.tag!('gco:CharacterString', ration) end end end # extended element info - source - CI_ResponsibleParty aSources = hExtension[:extSources] if aSources.empty? @xml.tag!('gmd:source',{'gco:nilReason'=>'missing'}) else aSources.each do |hSource| @xml.tag!('gmd:source') do rPartyClass.writeXML(hSource) end end end end end end end |