Class: ADIWG::Mdtranslator::Writers::Iso19115_2::MD_StandardOrderProcess

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb

Instance Method Summary collapse

Constructor Details

#initialize(xml, hResponseObj) ⇒ MD_StandardOrderProcess

Returns a new instance of MD_StandardOrderProcess.



20
21
22
23
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb', line 20

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

Instance Method Details

#writeXML(hOrder) ⇒ Object



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
# File 'lib/adiwg/mdtranslator/writers/iso19115_2/classes/class_orderProcess.rb', line 25

def writeXML(hOrder)

   # classes used

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

      # order process - fees
      s = hOrder[:fees]
      unless s.nil?
         @xml.tag!('gmd:fees') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:fees')
      end

      # order process - plannedAvailableDateTime
      hDateTime = hOrder[:plannedAvailability]
      unless hDateTime.empty?
         paDateTime = hDateTime[:dateTime]
         paDateRes = hDateTime[:dateResolution]
         @xml.tag!('gmd:plannedAvailableDateTime') do
            dateTimeStr =
               AdiwgDateTimeFun.stringDateTimeFromDateTime(paDateTime, paDateRes)
            @xml.tag!('gco:DateTime', dateTimeStr)
         end
      end
      if hDateTime.empty? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:plannedAvailableDateTime')
      end

      # order process - orderingInstructions
      s = hOrder[:orderingInstructions]
      unless s.nil?
         @xml.tag!('gmd:orderingInstructions') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:orderingInstructions')
      end

      # order process - turnaround
      s = hOrder[:turnaround]
      unless s.nil?
         @xml.tag!('gmd:turnaround') do
            @xml.tag!('gco:CharacterString', s)
         end
      end
      if s.nil? && @hResponseObj[:writerShowTags]
         @xml.tag!('gmd:turnaround')
      end

   end # gmd:MD_StandardOrderProcess tag
end