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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_format.rb', line 18
def self.unpack(hFormat, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hFormat.empty?
@MessagePath.issueWarning(290, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intFormat = intMetadataClass.newResourceFormat
outContext = 'medium format'
outContext = inContext + ' > ' + outContext unless inContext.nil?
if hFormat.has_key?('formatSpecification')
hObject = hFormat['formatSpecification']
unless hObject.empty?
hReturn = Citation.unpack(hObject, responseObj, outContext)
unless hReturn.nil?
intFormat[:formatSpecification] = hReturn
end
end
end
if intFormat[:formatSpecification].empty?
@MessagePath.issueError(291, responseObj, inContext)
end
if hFormat.has_key?('amendmentNumber')
unless hFormat['amendmentNumber'] == ''
intFormat[:amendmentNumber] = hFormat['amendmentNumber']
end
end
if hFormat.has_key?('compressionMethod')
unless hFormat['compressionMethod'] == ''
intFormat[:compressionMethod] = hFormat['compressionMethod']
end
end
if hFormat.has_key?('technicalPrerequisite')
unless hFormat['technicalPrerequisite'] == ''
intFormat[:technicalPrerequisite] = hFormat['technicalPrerequisite']
end
end
return intFormat
end
|