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
|
# File 'lib/adiwg/mdtranslator/readers/mdJson/modules/module_metadataRepository.rb', line 18
def self.unpack(hMdDist, responseObj)
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson
if hMdDist.empty?
@MessagePath.issueWarning(580, responseObj)
return nil
end
intMetadataClass = InternalMetadata.new
intMdDist = intMetadataClass.newMetadataRepository
outContext = 'metadata repository'
if hMdDist.has_key?('repository')
intMdDist[:repository] = hMdDist['repository']
end
if intMdDist[:repository].nil? || intMdDist[:repository] == ''
@MessagePath.issueError(581, responseObj)
end
if hMdDist.has_key?('citation')
unless hMdDist['citation'].empty?
hReturn = Citation.unpack(hMdDist['citation'], responseObj, outContext)
unless hReturn.nil?
intMdDist[:citation] = hReturn
end
end
end
if hMdDist.has_key?('metadataStandard')
unless hMdDist['metadataStandard'] == ''
intMdDist[:metadataStandard] = hMdDist['metadataStandard']
end
end
return intMdDist
end
|