class ADIWG::Mdtranslator::Writers::Iso19115_2::MD_AggregateInformation

Public Class Methods

new(xml, hResponseObj) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb, line 28
def initialize(xml, hResponseObj)
   @xml = xml
   @hResponseObj = hResponseObj
   @NameSpace = ADIWG::Mdtranslator::Writers::Iso19115_2
end

Public Instance Methods

writeXML(hAssocRes) click to toggle source
# File lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_aggregateInformation.rb, line 34
def writeXML(hAssocRes)

   # classes used
   codelistClass = MD_Codelist.new(@xml, @hResponseObj)
   citationClass = CI_Citation.new(@xml, @hResponseObj)

   @xml.tag!('gmd:MD_AggregateInformation') do

      # aggregate information - aggregate data set name {citation}
      hAssocCit = hAssocRes[:resourceCitation]
      unless hAssocCit.empty?
         @xml.tag!('gmd:aggregateDataSetName') do
            citationClass.writeXML(hAssocCit, 'associated resource')
         end
      end
      if hAssocCit.empty? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:aggregateDataSetName')
      end

      # aggregate information - aggregate data set identifier (use citation > identifier)
      # data set identifier was dropped from 19115-1 and not carried in mdJson

      # aggregate information - association type (required)
      s = hAssocRes[:associationType]
      unless s.nil?
         @xml.tag!('gmd:associationType') do
            codelistClass.writeXML('gmd', 'iso_associationType', s)
         end
      end
      if s.nil?
         @NameSpace.issueWarning(1, 'gmd:associationType')
      end

      # aggregate information - initiative type
      s = hAssocRes[:initiativeType]
      unless s.nil?
         @xml.tag!('gmd:initiativeType') do
            codelistClass.writeXML('gmd', 'iso_initiativeType', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:initiativeType')
      end

   end # MD_AggregateInformation tag
end