Sha256: c5c75893d1347534c0ba0c7677163997dc8fe9c8cecf5f4c156fed94f8fe7448

Contents?: true

Size: 1.89 KB

Versions: 5

Compression:

Stored size: 1.89 KB

Contents

require_relative 'class_dataQualityReport'
require_relative 'class_citation'

module ADIWG
  module Mdtranslator
    module Writers
      module Iso19115_1

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

          def writeXML(hDataQuality)

            reportClass = DataQualityReport.new(@xml, @hResponseObj)
            citationClass = CI_Citation.new(@xml, @hResponseObj)

            @xml.tag!('mdq:DQ_DataQuality') do

              @xml.tag!('mdq:scope') do
                @xml.tag!('mcc:MD_Scope') do
                  @xml.tag!('mcc:level') do
                    @xml.tag!('mcc:MD_ScopeCode', codeList: "http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#MD_ScopeCode", codeListValue: "series")
                  end
                end
              end

              unless hDataQuality[:standaloneQualityReport].nil? || hDataQuality[:standaloneQualityReport].empty?

                @xml.tag!('mdq:standaloneQualityReport') do
                  @xml.tag!('mdq:DQ_StandaloneQualityReportInformation') do
                    # reportReference

                    @xml.tag!('mdq:reportReference') do
                      citationClass.writeXML(hDataQuality[:standaloneQualityReport][:reportReference])
                    end


                    # abstract
                    @xml.tag!('mdq:abstract') do
                      @xml.tag!('gco:CharacterString', hDataQuality[:standaloneQualityReport][:abstract])
                    end
                  end
                end

              end

              # reports
              hDataQuality[:report].each do |hReport|
                unless hReport.nil? || hReport.empty?
                  reportClass.writeXML(hReport)
                end
                
              end
            end

          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adiwg-mdtranslator-2.18.0rc8 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb
adiwg-mdtranslator-2.18.0rc7 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb
adiwg-mdtranslator-2.18.0rc6 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb
adiwg-mdtranslator-2.18.0rc5 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb
adiwg-mdtranslator-2.18.0rc4 lib/adiwg/mdtranslator/writers/iso19115_1/classes/class_dataQuality.rb