Sha256: 2db2ed3dac40c2a6cca8d4019d0e20139301f3820323a27bfddc62fdf56da315

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 KB

Contents

# ISO <<Class>> MD_SecurityConstraints
# writer output in XML

# History:
# 	Stan Smith 2013-11-01 original script
#   Stan Smith 2014-07-08 modify require statements to function in RubyGem structure

require 'code_classification'

class MD_SecurityConstraints

	def initialize(xml)
		@xml = xml
	end

	def writeXML(hSecurityCons)

		# classes used
		classCode = MD_ClassificationCode.new(@xml)

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

			# security constraints - classification code - required
			s = hSecurityCons[:classCode]
			if s.nil?
				@xml.tag!('gmd:classification',{'gco:nilReason'=>'missing'})
			else
				@xml.tag!('gmd:classification') do
					classCode.writeXML(s)
				end
			end

			# security constraints - user note
			s = hSecurityCons[:userNote]
			if !s.nil?
				@xml.tag!('gmd:userNote') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:userNote')
			end

			# security constraints - classification system
			s = hSecurityCons[:classSystem]

			if !s.nil?
				@xml.tag!('gmd:classificationSystem') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:classificationSystem')
			end

			# security constraints - handling description
			s = hSecurityCons[:handlingDesc]
			if !s.nil?
				@xml.tag!('gmd:handlingDescription') do
					@xml.tag!('gco:CharacterString',s)
				end
			elsif $showAllTags
				@xml.tag!('gmd:handlingDescription')
			end

		end

	end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adiwg-mdtranslator-0.10.2 lib/adiwg/mdtranslator/writers/iso/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.9.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.8.6 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.8.5 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.8.2 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.8.1 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb
adiwg-mdtranslator-0.8.0 lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_securityConstraints.rb