Sha256: dbb249a8013b97ac46b21c9a9201fa16722e8a712ae64c6b6651160f6a88aa7b

Contents?: true

Size: 1.81 KB

Versions: 2

Compression:

Stored size: 1.81 KB

Contents

# Writer - internal data structure to ISO 19110:2003

# History:
# 	Stan Smith 2014-12-01 original script
#   Stan Smith 2014-12-12 refactored to handle namespacing readers and writers

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../iso/units'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../iso/codelists'))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../iso/classes'))

require 'builder'
require 'date'
require 'uuidtools'
require 'adiwg/mdtranslator/writers/iso19110/class_FCfeatureCatalogue'

module ADIWG
    module Mdtranslator
        module Writers
            module Iso

                # set writer namespace
                $WriterNS = ADIWG::Mdtranslator::Writers::Iso

                class Iso19110

                    def initialize
                        # reset ISO id='' counter
                        $idCount = '_000'
                    end

                    def writeXML(intObj)

                        # set the format of the output file based on the writer specified
                        $response[:writerFormat] = 'xml'
                        $response[:writerVersion] = ADIWG::Mdtranslator::VERSION

                        # create new XML document
                        xml = Builder::XmlMarkup.new(indent: 3)
                        metadataWriter = FC_FeatureCatalogue.new(xml)
                        metadata = metadataWriter.writeXML(intObj)

                        # set writer pass to true if no messages
                        # false or warning will be set by code that places the message
                        if $response[:writerMessages].length == 0
                            $response[:writerPass] = true
                        end

                        return metadata
                    end

                end

            end
        end
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.12.1 lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb
adiwg-mdtranslator-0.12.0 lib/adiwg/mdtranslator/writers/iso19110/iso19110_writer.rb