Skip to content

Commit

Permalink
add resultFile to coverageResult in mdJson reader
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Oliveros committed Jan 19, 2024
1 parent a7c1eb2 commit 46edb39
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require_relative 'module_scope'
require_relative 'module_spatialRepresentation'
require_relative 'module_resultFile'

module ADIWG
module Mdtranslator
Expand Down Expand Up @@ -50,7 +51,7 @@ def self.unpack(hResult, responseObj)

# resultFile
if hResult.has_key?('resultFile')
intResult[:resultFile] = hResult['resultFile']
intResult[:resultFile] = ResultFile.unpack(hResult['resultFile'], responseObj)
end

return intResult
Expand Down
74 changes: 74 additions & 0 deletions lib/adiwg/mdtranslator/readers/mdJson/modules/module_resultFile.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
require_relative 'module_format'

module ADIWG
module Mdtranslator
module Readers
module MdJson

module ResultFile

def self.unpack(hContent, responseObj)
require 'pp'
pp hContent
@MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson

# return nil object if input is empty
if hContent.empty?
@MessagePath.issueWarning(130, responseObj)
return nil
end

# instance classes needed in script
intMetadataClass = InternalMetadata.new
intContent = intMetadataClass.newCoverageDescription

# content information - file name (required)
if hContent.has_key?('fileName')
unless hContent['fileName'] == ''
intContent[:fileName] = hContent['fileName']
end
end
if intContent[:fileName].nil?
@MessagePath.issueError(131, responseObj)
end

# content information - file description (required)
if hContent.has_key?('fileDescription')
unless hContent['fileDescription'] == ''
intContent[:fileDescription] = hContent['fileDescription']
end
end
if intContent[:fileDescription].nil?
@MessagePath.issueError(132, responseObj)
end

# content information - file type
if hContent.has_key?('fileType')
unless hContent['fileType'] == ''
intContent[:fileType] = hContent['fileType']
end
end
if intContent[:fileType].nil?
@MessagePath.issueError(131, responseObj)
end

if hContent.has_key?('fileFormat')
hObject = hContent['fileFormat']
unless hObject.empty?
hReturn = Format.unpack(hObject, responseObj)
unless hReturn.nil?
intContent[:fileFormat] = hReturn
end
end
end

return intContent

end

end

end
end
end
end

0 comments on commit 46edb39

Please sign in to comment.