lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb in adiwg-mdtranslator-2.13.0 vs lib/adiwg/mdtranslator/readers/mdJson/modules/module_graphic.rb in adiwg-mdtranslator-2.13.1

- old
+ new

@@ -1,10 +1,10 @@ # unpack graphic # Reader - ADIwg JSON to internal data structure # History: -# Stan Smith 2018-02-18 refactored error and warning messaging +# Stan Smith 2018-06-20 refactored error and warning messaging # Stan Smith 2016-10-12 refactored for mdJson 2.0 # Stan Smith 2015-07-14 refactored to remove global namespace constants # Stan Smith 2015-06-22 replace global ($response) with passed in object (responseObj) # Stan Smith 2014-12-30 refactored # Stan Smith 2014-12-24 added return if input hash is empty @@ -21,15 +21,17 @@ module Readers module MdJson module Graphic - def self.unpack(hGraphic, responseObj) + def self.unpack(hGraphic, responseObj, inContext = nil) + @MessagePath = ADIWG::Mdtranslator::Readers::MdJson::MdJson + # return nil object if input is empty if hGraphic.empty? - responseObj[:readerExecutionMessages] << 'WARNING: mdJson reader: graphic overview object is empty' + @MessagePath.issueWarning(430, responseObj, inContext) return nil end # instance classes needed in script intMetadataClass = InternalMetadata.new @@ -38,12 +40,10 @@ # graphic - file name (required) if hGraphic.has_key?('fileName') intGraphic[:graphicName] = hGraphic['fileName'] end if intGraphic[:graphicName].nil? || intGraphic[:graphicName] == '' - responseObj[:readerExecutionMessages] << 'ERROR: mdJson reader: graphic overview file name is missing' - responseObj[:readerExecutionPass] = false - return nil + @MessagePath.issueError(431, responseObj, inContext) end # graphic - file description if hGraphic.has_key?('fileDescription') unless hGraphic['fileDescription'] == '' \ No newline at end of file