-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/acquisition' into fix/mdJson-writer-acqusition
- Loading branch information
Showing
6 changed files
with
136 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 0 additions & 15 deletions
15
lib/adiwg/mdtranslator/readers/mdJson/modules/module_acq-pass.rb
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
lib/adiwg/mdtranslator/readers/mdJson/modules/module_acq-platform.rb
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
lib/adiwg/mdtranslator/readers/mdJson/modules/module_pass.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
require_relative 'module_identifier' | ||
require_relative 'module_extent' | ||
require_relative 'module_event' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Readers | ||
module MdJson | ||
|
||
module Pass | ||
def self.unpack(hPass, responseObj, inContext = nil) | ||
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson | ||
|
||
intMetadataClass = InternalMetadata.new | ||
intPass = intMetadataClass.newPass | ||
|
||
outContext = 'pass' | ||
outContext = inContext + ' > ' + outContext unless inContext.nil? | ||
|
||
if hPass.has_key?('passId') | ||
intPass[:passId] = hPass['passId'] | ||
else | ||
@MessagePath.issueWarning(40, responseObj, outContext) | ||
end | ||
|
||
if hPass.has_key?('identifier') | ||
intPass[:identifier] = Identifier.unpack(hPass['identifier'], responseObj, outContext) | ||
else | ||
@MessagePath.issueWarning(40, responseObj, outContext) | ||
end | ||
|
||
if hPass.has_key?('extent') | ||
intPass[:extent] = Extent.unpack(hPass['extent'], responseObj, outContext) | ||
end | ||
|
||
if hPass.has_key?('relatedEvent') | ||
hPass['relatedEvent'].each do |item| | ||
hReturn = Event.unpack(item, responseObj, outContext) | ||
unless hReturn.nil? | ||
intPass[:relatedEvents] << hReturn | ||
end | ||
end | ||
end | ||
|
||
intPass | ||
|
||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |
76 changes: 76 additions & 0 deletions
76
lib/adiwg/mdtranslator/readers/mdJson/modules/module_platform.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
require_relative 'module_citation' | ||
require_relative 'module_identifier' | ||
require_relative 'module_responsibileParty' | ||
require_relative 'module_acq-instrument' | ||
require_relative 'module_acq-instrumentationEventList' | ||
|
||
module ADIWG | ||
module Mdtranslator | ||
module Readers | ||
module MdJson | ||
|
||
module Platform | ||
def self.unpack(hAcqPlatform, responseObj, inContext = nil) | ||
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson | ||
|
||
intAcqPlatform = intMetadataClass.newPlatform | ||
|
||
if hAcqPlatform.has_key('platformId') | ||
intAcqPlatform[:platformId] = hAcqPlatform['platformId'] | ||
else | ||
@MessagePath.issueError(460, responseObj, inContext) | ||
end | ||
|
||
if hAcqPlatform.has_key?('citation') | ||
hReturn = Citation.unpack(hAcqPlatform['citation'], responseObj, inContext) | ||
unless hReturn.nil? | ||
intAcqPlatform[:citation] = hReturn | ||
end | ||
end | ||
|
||
if hAcqPlatform.has_key?('identifier') | ||
hReturn = Identifier.unpack(hAcqPlatform['identifier'], responseObj, inContext) | ||
unless hReturn.nil? | ||
intAcqPlatform[:identifier] = hReturn | ||
else | ||
@MessagePath.issueError(461, responseObj, inContext) | ||
end | ||
end | ||
|
||
if hAcqPlatform.has_key('description') | ||
intAcqPlatform[:description] = hAcqPlatform['description'] | ||
else | ||
@MessagePath.issueError(460, responseObj, inContext) | ||
end | ||
|
||
if hAcqPlatform.has_key?('sponsor') | ||
hReturn = ResponsibileParty.unpack(hAcqPlatform['sponsor'], responseObj, inContext) | ||
unless hReturn.nil? | ||
intAcqPlatform[:sponsors] = hReturn | ||
end | ||
end | ||
|
||
if hAcqPlatform.has_key('instrument') | ||
hReturn = AcqInstrument.unpack(hAcqPlatform['instrument'], responseObj, inContext) | ||
unless hReturn.nil? | ||
intAcqPlatform[:instruments] = hReturn | ||
else | ||
@MessagePath.issueError(461, responseObj, inContext) | ||
end | ||
end | ||
|
||
if hAcqPlatform.has_key('history') | ||
hReturn = AcqInstrumentationEventList.unpack(hAcqPlatform['history'], responseObj, inContext) | ||
unless hReturn.nil? | ||
intAcqPlatform[:history] = hReturn | ||
end | ||
|
||
intAcqPlatform | ||
|
||
end | ||
end | ||
|
||
end | ||
end | ||
end | ||
end |