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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_securityConstraint.rb', line 20
def self.unpack(hSecurityCon, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hSecurityCon.empty?
@MessagePath.issueWarning(750, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intSecCon = intMetadataClass.newSecurityConstraint
if hSecurityCon.has_key?('classification')
intSecCon[:classCode] = hSecurityCon['classification']
end
if intSecCon[:classCode].nil? || intSecCon[:classCode] == ''
@MessagePath.issueError(751, responseObj, inContext)
end
if hSecurityCon.has_key?('userNote')
unless hSecurityCon['userNote'] == ''
intSecCon[:userNote] = hSecurityCon['userNote']
end
end
if hSecurityCon.has_key?('classificationSystem')
unless hSecurityCon['classificationSystem'] == ''
intSecCon[:classSystem] = hSecurityCon['classificationSystem']
end
end
if hSecurityCon.has_key?('handlingDescription')
unless hSecurityCon['handlingDescription'] == ''
intSecCon[:handling] = hSecurityCon['handlingDescription']
end
end
return intSecCon
end
|