Sha256: fdc63b5ab674fc610e7197d022c4ad049ef57ea628e8fb1f913ace59001f70bc

Contents?: true

Size: 1.99 KB

Versions: 14

Compression:

Stored size: 1.99 KB

Contents

# ISO <<Class>> MD_Distribution
# 19115-3 writer output in XML

# History:
# 	Stan Smith 2019-04-09 original script

require_relative 'class_distributor'

module ADIWG
   module Mdtranslator
      module Writers
         module Iso19115_3

            class MD_Distribution

               def initialize(xml, hResponseObj)
                  @xml = xml
                  @hResponseObj = hResponseObj
               end

               def writeXML(hDistribution)

                  # classes used
                  distributorClass = MD_Distributor.new(@xml, @hResponseObj)

                  @xml.tag!('mrd:MD_Distribution') do

                     # distribution - description
                     unless hDistribution[:description].nil?
                        @xml.tag!('mrd:description') do
                           @xml.tag!('gco:CharacterString', hDistribution[:description])
                        end
                     end
                     if hDistribution[:description].nil? && @hResponseObj[:writerShowTags]
                        @xml.tag!('mrd:description')
                     end

                     # distribution - distributor
                     aDistributors = hDistribution[:distributor]
                     unless aDistributors.empty?
                        aDistributors.each do |hDistributor|
                           @xml.tag!('mrd:distributor') do
                              distributorClass.writeXML(hDistributor)
                           end
                        end
                     end
                     if aDistributors.empty? && @hResponseObj[:writerShowTags]
                        @xml.tag!('mrd:distributor')
                     end

                     # distribution - transfer options - supported under distributor

                     # distribution - distribution format - supported under distributor

                  end # gmd:MD_Distribution tag
               end # writeXML
            end # MD_Distribution class

         end
      end
   end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.19.0.pre.beta.31 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.30 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.29 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.28 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.27 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.26 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.13 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.12 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.11 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.10 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.9 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.8 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.19.0.pre.beta.7 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb
adiwg-mdtranslator-2.18.4 lib/adiwg/mdtranslator/writers/iso19115_3/classes/class_distribution.rb