Sha256: 6966d5b9b2f06bfd16be5e0d4128840a06b004ab09804cf080e8b367647cfea2

Contents?: true

Size: 1.99 KB

Versions: 15

Compression:

Stored size: 1.99 KB

Contents

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

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

require_relative 'class_distributor'

module ADIWG
   module Mdtranslator
      module Writers
         module Iso19115_1

            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

15 entries across 15 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.18.2 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.1 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc9 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc6 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc5 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc4 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc3 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc2 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.18.0rc1 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.17.1 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.16.1 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb
adiwg-mdtranslator-2.15.0 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_distribution.rb