static public JSONObject getApprovedDocumentFromSubmission ( JSONObject submissionDoc ) throws Exception { JSONObject submissionInfo = submissionDoc . getJSONObject ( "nunaliit_submission" ) ; // Check if an approved version of the document is available JSONObject doc = submissionInfo . optJSONObject ( "approved_doc" ) ; if ( null != doc ) { JSONObject reserved = submissionInfo . optJSONObject ( "approved_reserved" ) ; return recreateDocumentFromDocAndReserved ( doc , reserved ) ; } else { // Use submission doc = submissionInfo . getJSONObject ( "submitted_doc" ) ; JSONObject reserved = submissionInfo . optJSONObject ( "submitted_reserved" ) ; return recreateDocumentFromDocAndReserved ( doc , reserved ) ; } }
Re - creates the approved document submitted by the client from the submission document .