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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_entityIndex.rb', line 20
def self.unpack(hIndex, responseObj, inContext = nil)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hIndex.empty?
@MessagePath.issueWarning(260, responseObj, inContext)
return nil
end
intMetadataClass = InternalMetadata.new
intIndex = intMetadataClass.newEntityIndex
if hIndex.has_key?('codeName')
intIndex[:indexCode] = hIndex['codeName']
end
if intIndex[:indexCode].nil? || intIndex[:indexCode] == ''
@MessagePath.issueError(261, responseObj, inContext)
end
if hIndex.has_key?('allowDuplicates')
if hIndex['allowDuplicates'] === true
intIndex[:duplicate] = true
end
end
if hIndex.has_key?('attributeCodeName')
intIndex[:attributeNames] = hIndex['attributeCodeName']
end
if intIndex[:attributeNames].empty?
@MessagePath.issueError(262, responseObj, inContext)
end
return intIndex
end
|