18
19
20
21
22
23
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
|
# File 'lib/adiwg/mdtranslator/readers/fgdc/modules/module_orderProcess.rb', line 18
def self.unpack(xOrder, hDistributor, techPre, hResponseObj)
intMetadataClass = InternalMetadata.new
hOrder = intMetadataClass.newOrderProcess
nonDigital = xOrder.xpath('./nondig').text
unless nonDigital.empty?
hTransfer = intMetadataClass.newTransferOption
hOffline = intMetadataClass.newMedium
hOffline[:note] = nonDigital
hTransfer[:offlineOptions] << hOffline
hDistributor[:transferOptions] << hTransfer
end
axDigital = xOrder.xpath('./digform')
unless axDigital.empty?
axDigital.each do |xDigiForm|
hReturn = DigitalForm.unpack(xDigiForm, techPre, hResponseObj)
unless hReturn.nil?
hDistributor[:transferOptions] << hReturn
end
end
end
if nonDigital.empty? && axDigital.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: standard order process digital/non-digital form is missing'
end
fees = xOrder.xpath('./fees').text
unless fees.empty?
hOrder[:fees] = fees
end
if fees.empty?
hResponseObj[:readerExecutionMessages] << 'WARNING: FGDC reader: standard order process fee is missing'
end
instructions = xOrder.xpath('./ordering').text
unless instructions.empty?
hOrder[:orderingInstructions] = instructions
end
turnaround = xOrder.xpath('./turnarnd').text
unless turnaround.empty?
hOrder[:turnaround] = turnaround
end
hDistributor[:orderProcess] << hOrder
return hDistributor
end
|