Class: ADIWG::Mdtranslator::Writers::Fgdc::OrderProcess
- Inherits:
-
Object
- Object
- ADIWG::Mdtranslator::Writers::Fgdc::OrderProcess
- Defined in:
- lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb
Instance Method Summary collapse
-
#initialize(xml, hResponseObj) ⇒ OrderProcess
constructor
A new instance of OrderProcess.
- #writeXML(hDistributor, inContext) ⇒ Object
Constructor Details
#initialize(xml, hResponseObj) ⇒ OrderProcess
Returns a new instance of OrderProcess.
18 19 20 21 22 |
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb', line 18 def initialize(xml, hResponseObj) @xml = xml @hResponseObj = hResponseObj @NameSpace = ADIWG::Mdtranslator::Writers::Fgdc end |
Instance Method Details
#writeXML(hDistributor, inContext) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/adiwg/mdtranslator/writers/fgdc/classes/class_orderProcess.rb', line 24 def writeXML(hDistributor, inContext) # classes used digiClass = DigitalFormat.new(@xml, @hResponseObj) # for FGDC only the first orderProcess can be accepted because ... # in FGDC transferOptions are children of orderProcess # in mdJson/ISO transferOptions are children of distributor # therefore in FGDC all transferOptions will be collected and mapped to # the first orderProcess # all other orderProcess records will be lost hOrder = hDistributor[:orderProcess][0] aTransfer = hDistributor[:transferOptions] # order process 6.4.1 (nondig) - non-digital form # non-digital are 'offline' transferOptions that have ONLY 'note' populated # if a transferOption is written as non-digital take care not to write again as digital # only one non-digital transfer is allowed per orderProcess doBreak = false aTransfer.each do |hTransOpt| hTransOpt[:offlineOptions].each do |hOffline| isNonDig = false isNonDig = true unless hOffline[:note].nil? isNonDig = false unless hOffline[:mediumSpecification].empty? isNonDig = false unless hOffline[:density].nil? isNonDig = false unless hOffline[:units].nil? isNonDig = false unless hOffline[:numberOfVolumes].nil? isNonDig = false unless hOffline[:mediumFormat].empty? isNonDig = false unless hOffline[:identifier].empty? if isNonDig @xml.tag!('nondig', hOffline[:note]) doBreak = true end break if doBreak end break if doBreak end # order process 6.4.2 (digform) - digital form # handles transferOptions for online and offline options aTransfer.each do |hTransOpt| @xml.tag!('digform') do digiClass.writeXML(hTransOpt, inContext) end end if aTransfer.empty? && @hResponseObj[:writerShowTags] @xml.tag!('digform') end # order process 6.4.3 (fees) - fees (required) unless hOrder[:fees].nil? @xml.tag!('fees', hOrder[:fees]) end if hOrder[:fees].nil? @NameSpace.issueWarning(140,'fees', 'distribution') end # order process 6.4.4 (ordering) - order instructions unless hOrder[:orderingInstructions].nil? @xml.tag!('ordering', hOrder[:orderingInstructions]) end if hOrder[:orderingInstructions].nil? && @hResponseObj[:writerShowTags] @xml.tag!('ordering') end # order process 6.4.5 (turnarnd) - turnaround unless hOrder[:turnaround].nil? @xml.tag!('turnarnd', hOrder[:turnaround]) end if hOrder[:turnaround].nil? && @hResponseObj[:writerShowTags] @xml.tag!('turnarnd') end end |