signature:
public class DocumentToPDFConvert { /** * Makes use of the Fluid Core to convert a document into a PDF file .
 * @ param inputDocumentParam The file to convert to PDF .
 * @ return The { @ code File } object of the result PDF .
 * @ throws UtilException If anything goes wrong during execution . */
public File convertDocumentToPDF ( File inputDocumentParam ) { } }

implementation:
if ( inputDocumentParam == null || ! inputDocumentParam . exists ( ) ) { throw new UtilException ( "Input document to convert not provided or does not exist." , UtilException . ErrorCode . COMMAND ) ; } if ( ! inputDocumentParam . isFile ( ) ) { throw new UtilException ( "Input document '' is not a file." , UtilException . ErrorCode . COMMAND ) ; } File parentFolder = inputDocumentParam . getParentFile ( ) ; String inputFilenameWithoutExt = inputDocumentParam . getName ( ) ; int indexOfDot = - 1 ; if ( ( indexOfDot = inputFilenameWithoutExt . indexOf ( '.' ) ) > - 1 ) { inputFilenameWithoutExt = inputFilenameWithoutExt . substring ( 0 , indexOfDot ) ; } File generatedPdfFileOut = new File ( parentFolder . getAbsolutePath ( ) . concat ( File . separator ) . concat ( inputFilenameWithoutExt ) . concat ( ".pdf" ) ) ; String completeOutputPath = generatedPdfFileOut . getAbsolutePath ( ) ; try { CommandUtil . CommandResult commandResult = this . commandUtil . executeCommand ( CommandUtil . FLUID_CLI , COMMAND_CONVERT_DOC_TO_PDF , "-i" , inputDocumentParam . getAbsolutePath ( ) , "-o" , completeOutputPath ) ; // There is a problem . . .
if ( commandResult . getExitCode ( ) != 0 ) { throw new UtilException ( "Unable to convert '" + inputDocumentParam . getName ( ) + "' to PDF. " + commandResult . toString ( ) , UtilException . ErrorCode . COMMAND ) ; } File returnVal = new File ( completeOutputPath ) ; if ( ! returnVal . exists ( ) ) { throw new UtilException ( "Command executed, but no output file. Expected PDF at '" + completeOutputPath + "'." , UtilException . ErrorCode . GENERAL ) ; } return returnVal ; } catch ( IOException eParam ) { throw new UtilException ( "Problem executing command. " + eParam . getMessage ( ) , eParam , UtilException . ErrorCode . GENERAL ) ; }


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Retrieves the Ancestor for the { @ code formToGetAncestorForParam } .
 * @ param formToGetAncestorForParam The Fluid Form to get Ancestor for .
 * @ param includeFieldDataParam Should Ancestor ( Form ) Field data be included ?
 * @ param includeTableFieldsParam Should Table Record ( Form ) Field data be included ?
 * @ return The { @ code formToGetAncestorForParam } Ancestor as { @ code Form } ' s . */
public Form getAncestor ( Form formToGetAncestorForParam , boolean includeFieldDataParam , boolean includeTableFieldsParam ) { } }

implementation:
if ( DISABLE_WS ) { this . mode = Mode . RESTfulActive ; } // ANCESTOR . . .
try { // When mode is null or [ WebSocketActive ] . . .
if ( this . getAncestorClient == null && Mode . RESTfulActive != this . mode ) { this . getAncestorClient = new SQLUtilWebSocketGetAncestorClient ( this . baseURL , null , this . loggedInUser . getServiceTicketAsHexUpper ( ) , this . timeoutMillis , includeFieldDataParam , includeTableFieldsParam , COMPRESS_RSP , COMPRESS_RSP_CHARSET ) ; this . mode = Mode . WebSocketActive ; } } catch ( FluidClientException clientExcept ) { if ( clientExcept . getErrorCode ( ) != FluidClientException . ErrorCode . WEB_SOCKET_DEPLOY_ERROR ) { throw clientExcept ; } this . mode = Mode . RESTfulActive ; } Form formToUse = ( formToGetAncestorForParam == null ) ? null : new Form ( formToGetAncestorForParam . getId ( ) ) ; return ( this . getAncestorClient == null ) ? this . sqlUtilClient . getAncestor ( formToUse , includeFieldDataParam , includeTableFieldsParam ) : this . getAncestorClient . getAncestorSynchronized ( formToUse ) ;


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Retrieves all the Descendants ( Forms ) for the { @ code formsToGetDescForParam } .
 * @ param includeFieldDataParam Should Ancestor ( Form ) Field data be included ?
 * @ param includeTableFieldsParam Should Table Record ( Form ) Field data be included ?
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ param massFetchParam Is the fetch a large fetch .
 * @ param formsToGetDescForParam The Fluid Form to get Descendants for .
 * @ return The { @ code formsToGetDescForParam } Descendants as { @ code Form } ' s . */
public List < FormListing > getDescendants ( boolean includeFieldDataParam , boolean includeTableFieldsParam , boolean includeTableFieldFormRecordInfoParam , boolean massFetchParam , Form ... formsToGetDescForParam ) { } }

implementation:
if ( DISABLE_WS ) { this . mode = Mode . RESTfulActive ; } // DESCENDANTS . . .
try { // When mode is null or [ WebSocketActive ] . . .
if ( this . getDescendantsClient == null && Mode . RESTfulActive != this . mode ) { this . getDescendantsClient = new SQLUtilWebSocketGetDescendantsClient ( this . baseURL , null , this . loggedInUser . getServiceTicketAsHexUpper ( ) , this . timeoutMillis , includeFieldDataParam , includeTableFieldsParam , includeTableFieldFormRecordInfoParam , massFetchParam , COMPRESS_RSP , COMPRESS_RSP_CHARSET ) ; this . mode = Mode . WebSocketActive ; } } catch ( FluidClientException clientExcept ) { if ( clientExcept . getErrorCode ( ) != FluidClientException . ErrorCode . WEB_SOCKET_DEPLOY_ERROR ) { throw clientExcept ; } this . mode = Mode . RESTfulActive ; } if ( formsToGetDescForParam == null || formsToGetDescForParam . length < 1 ) { return null ; } Form [ ] formsToFetchFor = new Form [ formsToGetDescForParam . length ] ; for ( int index = 0 ; index < formsToFetchFor . length ; index ++ ) { formsToFetchFor [ index ] = new Form ( formsToGetDescForParam [ index ] . getId ( ) ) ; } if ( this . getDescendantsClient != null ) { return this . getDescendantsClient . getDescendantsSynchronized ( formsToFetchFor ) ; } else { List < FormListing > returnVal = new ArrayList < > ( ) ; for ( Form formToFetchFor : formsToFetchFor ) { List < Form > listOfForms = this . sqlUtilClient . getDescendants ( formToFetchFor , includeFieldDataParam , includeTableFieldsParam , includeTableFieldFormRecordInfoParam ) ; FormListing toAdd = new FormListing ( ) ; toAdd . setListing ( listOfForms ) ; toAdd . setListingCount ( ( listOfForms == null ) ? 0 : listOfForms . size ( ) ) ; returnVal . add ( toAdd ) ; } return returnVal ; }


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Retrieves all the Table ( Forms ) for the { @ code formsToGetDescForParam } .
 * @ param includeFieldDataParam Should Field data be included ?
 * @ param formsToGetTableFormsForParam The Fluid Form to get Descendants for .
 * @ return The { @ code formsToGetDescForParam } Descendants as { @ code Form } ' s . */
public List < FormListing > getTableForms ( boolean includeFieldDataParam , Form ... formsToGetTableFormsForParam ) { } }

implementation:
if ( DISABLE_WS ) { this . mode = Mode . RESTfulActive ; } // DESCENDANTS . . .
try { // When mode is null or [ WebSocketActive ] . . .
if ( this . getTableFormsClient == null && Mode . RESTfulActive != this . mode ) { this . getTableFormsClient = new SQLUtilWebSocketGetTableFormsClient ( this . baseURL , null , this . loggedInUser . getServiceTicketAsHexUpper ( ) , this . timeoutMillis , includeFieldDataParam , COMPRESS_RSP , COMPRESS_RSP_CHARSET ) ; this . mode = Mode . WebSocketActive ; } } catch ( FluidClientException clientExcept ) { if ( clientExcept . getErrorCode ( ) != FluidClientException . ErrorCode . WEB_SOCKET_DEPLOY_ERROR ) { throw clientExcept ; } this . mode = Mode . RESTfulActive ; } if ( formsToGetTableFormsForParam == null || formsToGetTableFormsForParam . length < 1 ) { return null ; } Form [ ] formsToFetchFor = new Form [ formsToGetTableFormsForParam . length ] ; for ( int index = 0 ; index < formsToFetchFor . length ; index ++ ) { formsToFetchFor [ index ] = new Form ( formsToGetTableFormsForParam [ index ] . getId ( ) ) ; } if ( this . getTableFormsClient != null ) { return this . getTableFormsClient . getTableFormsSynchronized ( formsToFetchFor ) ; } else { List < FormListing > returnVal = new ArrayList < > ( ) ; for ( Form formToFetchFor : formsToFetchFor ) { List < Form > listOfForms = this . sqlUtilClient . getTableForms ( formToFetchFor , includeFieldDataParam ) ; FormListing toAdd = new FormListing ( ) ; toAdd . setListing ( listOfForms ) ; toAdd . setListingCount ( ( listOfForms == null ) ? 0 : listOfForms . size ( ) ) ; returnVal . add ( toAdd ) ; } return returnVal ; }


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Retrieves all the ( Fields ) for the { @ code formsToGetDescForParam } .
 * @ param includeFieldDataParam Should Field data be included ?
 * @ param formsToGetFieldsForParam The Fluid Form to get Descendants for .
 * @ return The { @ code formsToGetFieldsForParam } Fields as { @ code Field } ' s . */
public List < FormFieldListing > getFormFields ( boolean includeFieldDataParam , Form ... formsToGetFieldsForParam ) { } }

implementation:
if ( DISABLE_WS ) { this . mode = Mode . RESTfulActive ; } // FORM FIELDS . . .
try { // When mode is null or [ WebSocketActive ] . . .
if ( this . getFormFieldsClient == null && Mode . RESTfulActive != this . mode ) { this . getFormFieldsClient = new SQLUtilWebSocketGetFormFieldsClient ( this . baseURL , null , this . loggedInUser . getServiceTicketAsHexUpper ( ) , this . timeoutMillis , includeFieldDataParam , COMPRESS_RSP , COMPRESS_RSP_CHARSET ) ; this . mode = Mode . WebSocketActive ; } } catch ( FluidClientException clientExcept ) { if ( clientExcept . getErrorCode ( ) != FluidClientException . ErrorCode . WEB_SOCKET_DEPLOY_ERROR ) { throw clientExcept ; } this . mode = Mode . RESTfulActive ; } if ( formsToGetFieldsForParam == null || formsToGetFieldsForParam . length < 1 ) { return null ; } Form [ ] formsToFetchFor = new Form [ formsToGetFieldsForParam . length ] ; for ( int index = 0 ; index < formsToFetchFor . length ; index ++ ) { formsToFetchFor [ index ] = new Form ( formsToGetFieldsForParam [ index ] . getId ( ) ) ; } if ( this . getFormFieldsClient != null ) { return this . getFormFieldsClient . getFormFieldsSynchronized ( formsToFetchFor ) ; } else { List < FormFieldListing > returnVal = new ArrayList < > ( ) ; for ( Form formToFetchFor : formsToFetchFor ) { List < Field > listOfFields = this . sqlUtilClient . getFormFields ( formToFetchFor , includeFieldDataParam ) ; FormFieldListing toAdd = new FormFieldListing ( ) ; toAdd . setListing ( listOfFields ) ; toAdd . setListingCount ( ( listOfFields == null ) ? 0 : listOfFields . size ( ) ) ; returnVal . add ( toAdd ) ; } return returnVal ; }


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Retrieves all the ( Fields ) for the { @ code formsToGetDescForParam } .
 * @ param includeFieldDataParam Should Field data be included ?
 * @ param formsToPopulateFormFieldsForParam The Fluid Form to get Descendants for . */
public void massPopulateFormFields ( boolean includeFieldDataParam , Form ... formsToPopulateFormFieldsForParam ) { } }

implementation:
if ( DISABLE_WS ) { this . mode = Mode . RESTfulActive ; } // FORM FIELDS . . .
try { // When mode is null or [ WebSocketActive ] . . .
if ( this . getFormFieldsClient == null && Mode . RESTfulActive != this . mode ) { this . getFormFieldsClient = new SQLUtilWebSocketGetFormFieldsClient ( this . baseURL , null , this . loggedInUser . getServiceTicketAsHexUpper ( ) , this . timeoutMillis , includeFieldDataParam , COMPRESS_RSP , COMPRESS_RSP_CHARSET ) ; this . mode = Mode . WebSocketActive ; } } catch ( FluidClientException clientExcept ) { if ( clientExcept . getErrorCode ( ) != FluidClientException . ErrorCode . WEB_SOCKET_DEPLOY_ERROR ) { throw clientExcept ; } this . mode = Mode . RESTfulActive ; } // Nothing to do . . .
if ( formsToPopulateFormFieldsForParam == null || formsToPopulateFormFieldsForParam . length < 1 ) { return ; } // Populate a known echo for all of the local form caches . . .
Form [ ] formsToFetchForLocalCacheArr = new Form [ formsToPopulateFormFieldsForParam . length ] ; for ( int index = 0 ; index < formsToFetchForLocalCacheArr . length ; index ++ ) { formsToFetchForLocalCacheArr [ index ] = new Form ( formsToPopulateFormFieldsForParam [ index ] . getId ( ) ) ; formsToFetchForLocalCacheArr [ index ] . setEcho ( UUID . randomUUID ( ) . toString ( ) ) ; } List < FormFieldListing > listingReturnFieldValsPopulated = new ArrayList < > ( ) ; // Fetch all of the values in a single go . . .
if ( this . getFormFieldsClient != null ) { listingReturnFieldValsPopulated = this . getFormFieldsClient . getFormFieldsSynchronized ( formsToFetchForLocalCacheArr ) ; } else { // Old Rest way of fetching all of the values . . .
for ( Form formToFetchFor : formsToFetchForLocalCacheArr ) { List < Field > listOfFields = this . sqlUtilClient . getFormFields ( formToFetchFor , includeFieldDataParam ) ; FormFieldListing toAdd = new FormFieldListing ( ) ; toAdd . setListing ( listOfFields ) ; toAdd . setListingCount ( ( listOfFields == null ) ? 0 : listOfFields . size ( ) ) ; toAdd . setEcho ( formToFetchFor . getEcho ( ) ) ; listingReturnFieldValsPopulated . add ( toAdd ) ; } } // Populate each of the form from the param . . .
for ( Form formToSetFieldsOn : formsToPopulateFormFieldsForParam ) { formToSetFieldsOn . setFormFields ( this . getFieldValuesForFormFromCache ( formToSetFieldsOn . getId ( ) , listingReturnFieldValsPopulated , formsToFetchForLocalCacheArr ) ) ; }


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Populate the field values from the cache .
 * @ param formIdParam The id of the form to populate .
 * @ param listingReturnFieldValsPopulatedParam The cache of field values .
 * @ param formsToFetchForLocalCacheArrParam The forms that contain the ids and echos .
 * @ return The field values for form with id { @ code formIdParam } . */
private List < Field > getFieldValuesForFormFromCache ( Long formIdParam , List < FormFieldListing > listingReturnFieldValsPopulatedParam , Form [ ] formsToFetchForLocalCacheArrParam ) { } }

implementation:
if ( formIdParam == null || formIdParam . longValue ( ) < 1 ) { return null ; } if ( listingReturnFieldValsPopulatedParam == null || listingReturnFieldValsPopulatedParam . isEmpty ( ) ) { return null ; } if ( formsToFetchForLocalCacheArrParam == null || formsToFetchForLocalCacheArrParam . length == 0 ) { return null ; } for ( Form formIter : formsToFetchForLocalCacheArrParam ) { // Form is a match . . .
if ( formIdParam . equals ( formIter . getId ( ) ) ) { String echoToUse = formIter . getEcho ( ) ; for ( FormFieldListing fieldListing : listingReturnFieldValsPopulatedParam ) { if ( echoToUse . equals ( fieldListing . getEcho ( ) ) ) { return fieldListing . getListing ( ) ; } } } } return null ;


signature:
public class SQLUtilWebSocketRESTWrapper { /** * Close any clients used during lifetime of { @ code this } object . */
public void closeAndClean ( ) { } }

implementation: if ( this . sqlUtilClient != null ) { this . sqlUtilClient . closeAndClean ( ) ; } if ( this . getAncestorClient != null ) { this . getAncestorClient . closeAndClean ( ) ; } if ( this . getDescendantsClient != null ) { this . getDescendantsClient . closeAndClean ( ) ; } if ( this . getTableFormsClient != null ) { this . getTableFormsClient . closeAndClean ( ) ; } if ( this . getFormFieldsClient != null ) { this . getFormFieldsClient . closeAndClean ( ) ; }


signature:
public class SQLColumn { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code UserQuery }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Name . . .
if ( this . getColumnName ( ) != null ) { returnVal . put ( JSONMapping . COLUMN_NAME , this . getColumnName ( ) ) ; } // Index . . .
if ( this . getColumnIndex ( ) != null ) { returnVal . put ( JSONMapping . COLUMN_INDEX , this . getColumnIndex ( ) ) ; } // SQL Type . . .
if ( this . getSqlType ( ) != null ) { returnVal . put ( JSONMapping . SQL_TYPE , this . getSqlType ( ) ) ; } // SQL Value . . .
if ( this . getSqlValue ( ) != null ) { returnVal . put ( JSONMapping . SQL_VALUE , this . getSqlValue ( ) ) ; } return returnVal ;


signature:
public class ABaseFluidJSONObject { /** * Base { @ code toJsonObject } that creates a { @ code JSONObject }
 * with the Id and ServiceTicket set .
 * @ return { @ code JSONObject } representation of { @ code ABaseFluidJSONObject }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see org . json . JSONObject */
@ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = new JSONObject ( ) ; // Id . . .
if ( this . getId ( ) != null ) { returnVal . put ( JSONMapping . ID , this . getId ( ) ) ; } // Service Ticket . . .
if ( this . getServiceTicket ( ) != null ) { returnVal . put ( JSONMapping . SERVICE_TICKET , this . getServiceTicket ( ) ) ; } // Echo . . .
if ( this . getEcho ( ) != null ) { returnVal . put ( JSONMapping . ECHO , this . getEcho ( ) ) ; } return returnVal ;


signature:
public class ABaseFluidJSONObject { /** * Converts the { @ code Long } timestamp into a { @ code Date } object .
 * Returns { @ code null } if { @ code longValueParam } is { @ code null } .
 * @ param longValueParam The milliseconds since January 1 , 1970 , 00:00:00 GMT
 * @ return { @ code Date } Object from { @ code longValueParam } */
@ XmlTransient private Date getLongAsDateFromJson ( Long longValueParam ) { } }

implementation: if ( longValueParam == null ) { return null ; } return new Date ( longValueParam ) ;


signature:
public class ABaseFluidJSONObject { /** * Retrieves the value of field { @ code fieldNameParam } as a timestamp .
 * @ param fieldNameParam The name of the JSON field to retrieve .
 * @ return The value of the JSON Object as a { @ code java . util . Date } . */
@ XmlTransient public Date getDateFieldValueFromFieldWithName ( String fieldNameParam ) { } }

implementation: if ( ( fieldNameParam == null || fieldNameParam . trim ( ) . isEmpty ( ) ) || ( this . jsonObject == null || this . jsonObject . isNull ( fieldNameParam ) ) ) { return null ; } Object objectAtIndex = this . jsonObject . get ( fieldNameParam ) ; if ( objectAtIndex instanceof Number ) { return this . getLongAsDateFromJson ( ( ( Number ) objectAtIndex ) . longValue ( ) ) ; } else if ( objectAtIndex instanceof String ) { Date validDate = null ; for ( SimpleDateFormat format : SUPPORTED_FORMATS ) { try { validDate = format . parse ( ( String ) objectAtIndex ) ; if ( validDate != null ) { break ; } } catch ( ParseException parseExcept ) { validDate = null ; } } return validDate ; } return null ;


signature:
public class ABaseFluidJSONObject { /** * Converts the { @ code Date } object into a { @ code Long } timestamp .
 * Returns { @ code null } if { @ code dateValueParam } is { @ code null } .
 * @ param dateValueParam { @ code Long } Object from { @ code dateValueParam }
 * @ return The milliseconds since January 1 , 1970 , 00:00:00 GMT */
@ XmlTransient public Long getDateAsLongFromJson ( Date dateValueParam ) { } }

implementation: if ( dateValueParam == null ) { return null ; } return dateValueParam . getTime ( ) ;


signature:
public class FlowStepRuleClient { /** * Create a new Flow Step Entry rule .
 * @ param flowStepRuleParam Rule to create .
 * @ return Created rule . */
public FlowStepRule createFlowStepEntryRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . putJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleEntryCreate ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Create a new Flow Step Exit rule .
 * @ param flowStepRuleParam Rule to create .
 * @ return Created rule . */
public FlowStepRule createFlowStepExitRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . putJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleExitCreate ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Create a new Flow Step View rule .
 * @ param flowStepRuleParam Rule to create .
 * @ return Created rule . */
public FlowStepRule createFlowStepViewRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . putJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleViewCreate ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Update an existing Flow Step Entry rule .
 * @ param flowStepRuleParam Rule to update .
 * @ return Updated rule . */
public FlowStepRule updateFlowStepEntryRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleUpdateEntry ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Update an existing Flow Step Exit rule .
 * @ param flowStepRuleParam Rule to update .
 * @ return Updated rule . */
public FlowStepRule updateFlowStepExitRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleUpdateExit ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Update an existing Flow Step View rule .
 * @ param flowStepRuleParam Rule to update .
 * @ return Updated rule . */
public FlowStepRule updateFlowStepViewRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleUpdateView ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Compiles the { @ code viewRuleSyntaxParam } text within the Fluid workflow engine .
 * @ param viewRuleSyntaxParam The syntax to compile .
 * @ return Compiled rule . */
public FlowStepRule compileFlowStepViewRule ( String viewRuleSyntaxParam ) { } }

implementation: FlowStepRule flowStepRule = new FlowStepRule ( ) ; flowStepRule . setRule ( viewRuleSyntaxParam ) ; if ( this . serviceTicket != null ) { flowStepRule . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRule , WS . Path . FlowStepRule . Version1 . compileViewSyntax ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Retrieves the exit rules by step { @ code flowStepParam } .
 * Name or id can be provided .
 * @ param flowStepParam The flow step to get the exit rules for .
 * @ return All the exit rules for the step { @ code flowStepParam } . */
public FlowStepRuleListing getExitRulesByStep ( FlowStep flowStepParam ) { } }

implementation: if ( flowStepParam == null ) { return null ; } if ( this . serviceTicket != null ) { flowStepParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRuleListing ( this . postJson ( flowStepParam , WS . Path . FlowStepRule . Version1 . getExitRulesByStep ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Compiles and Executes the { @ code viewRuleSyntaxParam }
 * text within the Fluid workflow engine .
 * @ param viewRuleSyntaxParam The syntax to compile .
 * @ param fluidItemToExecuteOnParam The item to execute the rules on .
 * @ return Execution result . */
public FlowItemExecuteResult compileFlowStepViewRuleAndExecute ( String viewRuleSyntaxParam , FluidItem fluidItemToExecuteOnParam ) { } }

implementation: FlowStepRule flowStepRule = new FlowStepRule ( ) ; flowStepRule . setRule ( viewRuleSyntaxParam ) ; FlowItemExecutePacket toPost = new FlowItemExecutePacket ( ) ; if ( this . serviceTicket != null ) { toPost . setServiceTicket ( this . serviceTicket ) ; } toPost . setFlowStepRule ( flowStepRule ) ; toPost . setFluidItem ( fluidItemToExecuteOnParam ) ; return new FlowItemExecuteResult ( this . postJson ( toPost , WS . Path . FlowStepRule . Version1 . compileViewSyntaxAndExecute ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Compiles the { @ code entryRuleSyntaxParam } text within the Fluid workflow engine .
 * @ param entryRuleSyntaxParam The syntax to compile .
 * @ return Compiled rule . */
public FlowStepRule compileFlowStepEntryRule ( String entryRuleSyntaxParam ) { } }

implementation: FlowStepRule flowStepRule = new FlowStepRule ( ) ; flowStepRule . setRule ( entryRuleSyntaxParam ) ; if ( this . serviceTicket != null ) { flowStepRule . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRule , WS . Path . FlowStepRule . Version1 . compileEntrySyntax ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Compiles and Executes the { @ code entryRuleSyntaxParam }
 * text within the Fluid workflow engine .
 * @ param entryRuleSyntaxParam The syntax to compile .
 * @ param fluidItemToExecuteOnParam The item to execute the rules on .
 * @ return Execution result . */
public FlowItemExecuteResult compileFlowStepEntryRuleAndExecute ( String entryRuleSyntaxParam , FluidItem fluidItemToExecuteOnParam ) { } }

implementation: FlowStepRule flowStepRule = new FlowStepRule ( ) ; flowStepRule . setRule ( entryRuleSyntaxParam ) ; FlowItemExecutePacket toPost = new FlowItemExecutePacket ( ) ; if ( this . serviceTicket != null ) { toPost . setServiceTicket ( this . serviceTicket ) ; } toPost . setFlowStepRule ( flowStepRule ) ; toPost . setFluidItem ( fluidItemToExecuteOnParam ) ; return new FlowItemExecuteResult ( this . postJson ( toPost , WS . Path . FlowStepRule . Version1 . compileEntrySyntaxAndExecute ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Moves an entry rule order one up from the current location .
 * @ param flowStepRuleParam The Rule to move up .
 * @ return The result after the move . */
public FlowStepRule moveFlowStepEntryRuleUp ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleMoveEntryUp ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Moves an entry rule order one down from the current location .
 * @ param flowStepRuleParam The Rule to move down .
 * @ return The result after the move . */
public FlowStepRule moveFlowStepEntryRuleDown ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleMoveEntryDown ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Deletes an Step Entry rule .
 * @ param flowStepRuleParam The rule to delete .
 * @ return The deleted rule . */
public FlowStepRule deleteFlowStepEntryRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStepRule ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleDeleteEntry ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Deletes an Step Exit rule .
 * @ param flowStepRuleParam The rule to delete .
 * @ return The deleted rule . */
public FlowStep deleteFlowStepExitRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStep ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleDeleteExit ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Deletes an Step View rule .
 * @ param flowStepRuleParam The rule to delete .
 * @ return The deleted rule . */
public FlowStep deleteFlowStepViewRule ( FlowStepRule flowStepRuleParam ) { } }

implementation: if ( flowStepRuleParam != null && this . serviceTicket != null ) { flowStepRuleParam . setServiceTicket ( this . serviceTicket ) ; } return new FlowStep ( this . postJson ( flowStepRuleParam , WS . Path . FlowStepRule . Version1 . flowStepRuleDeleteView ( ) ) ) ;


signature:
public class FlowStepRuleClient { /** * Retrieves the next valid syntax rules for { @ code inputRuleParam } .
 * @ param inputRuleParam The text to use as input .
 * @ return Listing of valid syntax words to use . */
public List < String > getNextValidSyntaxWordsEntryRule ( String inputRuleParam ) { } }

implementation: if ( inputRuleParam == null ) { inputRuleParam = UtilGlobal . EMPTY ; } FlowStepRule flowStepRule = new FlowStepRule ( ) ; flowStepRule . setRule ( inputRuleParam ) ; if ( this . serviceTicket != null ) { flowStepRule . setServiceTicket ( this . serviceTicket ) ; } FlowStepRule returnedObj = new FlowStepRule ( this . postJson ( flowStepRule , WS . Path . FlowStepRule . Version1 . getNextValidEntrySyntax ( ) ) ) ; return returnedObj . getNextValidSyntaxWords ( ) ;


signature:
public class LoginClient { /** * Performs the necessary login actions against Fluid .
 * Please note that the actual password never travels over the wire / connection .
 * @ param usernameParam The users Username .
 * @ param passwordParam The users password .
 * @ return Session token .
 * @ see AppRequestToken */
public AppRequestToken login ( String usernameParam , String passwordParam ) { } }

implementation:
// Default login is for 9 hours .
return this . login ( usernameParam , passwordParam , TimeUnit . HOURS . toSeconds ( 9 ) ) ;


signature:
public class LoginClient { /** * Performs the necessary login actions against Fluid .
 * Please note that the actual password never travels over the wire / connection .
 * @ param usernameParam The users Username .
 * @ param passwordParam The users password .
 * @ param sessionLifespanSecondsParam The requested duration of the session in seconds .
 * @ return Session token .
 * @ see AppRequestToken */
public AppRequestToken login ( String usernameParam , String passwordParam , Long sessionLifespanSecondsParam ) { } }

implementation:
if ( this . isEmpty ( usernameParam ) || this . isEmpty ( passwordParam ) ) { throw new FluidClientException ( "Username and Password required." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } AuthRequest authRequest = new AuthRequest ( ) ; authRequest . setUsername ( usernameParam ) ; authRequest . setLifetime ( sessionLifespanSecondsParam ) ; // Init the session . . .
// Init the session to get the salt . . .
AuthResponse authResponse ; try { authResponse = new AuthResponse ( this . postJson ( true , authRequest , WS . Path . User . Version1 . userInitSession ( ) ) ) ; } // JSON format problem . . .
catch ( JSONException jsonException ) { throw new FluidClientException ( jsonException . getMessage ( ) , jsonException , FluidClientException . ErrorCode . JSON_PARSING ) ; } AuthEncryptedData authEncData = this . initializeSession ( passwordParam , authResponse ) ; // Issue the token . . .
AppRequestToken appReqToken = this . issueAppRequestToken ( authResponse . getServiceTicketBase64 ( ) , usernameParam , authEncData ) ; appReqToken . setRoleString ( authEncData . getRoleListing ( ) ) ; appReqToken . setSalt ( authResponse . getSalt ( ) ) ; return appReqToken ;


signature:
public class LoginClient { /** * Performs HMAC and encryption to initialize the session .
 * @ param passwordParam The user password in the clear .
 * @ param authResponseParam Response of the initial authentication request ( handshake ) .
 * @ return Authenticated encrypted data . */
private AuthEncryptedData initializeSession ( String passwordParam , AuthResponse authResponseParam ) { } }

implementation:
// IV . . .
byte [ ] ivBytes = UtilGlobal . decodeBase64 ( authResponseParam . getIvBase64 ( ) ) ; // Seed . . .
byte [ ] seedBytes = UtilGlobal . decodeBase64 ( authResponseParam . getSeedBase64 ( ) ) ; // Encrypted Data . . .
byte [ ] encryptedData = UtilGlobal . decodeBase64 ( authResponseParam . getEncryptedDataBase64 ( ) ) ; // HMac from Response . . .
byte [ ] hMacFromResponse = UtilGlobal . decodeBase64 ( authResponseParam . getEncryptedDataHmacBase64 ( ) ) ; // Local HMac . . .
byte [ ] localGeneratedHMac = AES256Local . generateLocalHMAC ( encryptedData , passwordParam , authResponseParam . getSalt ( ) , seedBytes ) ; // Password mismatch . . .
if ( ! Arrays . equals ( hMacFromResponse , localGeneratedHMac ) ) { throw new FluidClientException ( "Login attempt failure." , FluidClientException . ErrorCode . LOGIN_FAILURE ) ; } // Decrypted Initialization Data . . .
byte [ ] decryptedEncryptedData = AES256Local . decryptInitPacket ( encryptedData , passwordParam , authResponseParam . getSalt ( ) , ivBytes , seedBytes ) ; try { JSONObject jsonObj = new JSONObject ( new String ( decryptedEncryptedData ) ) ; return new AuthEncryptedData ( jsonObj ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class LoginClient { /** * Issue a new { @ code AppRequestToken } from provided params .
 * @ param serviceTicketBase64Param The service ticket from authentication .
 * @ param usernameParam The users username .
 * @ param authEncryptDataParam The encrypted packet .
 * @ return Request Token .
 * @ see AppRequestToken */
private AppRequestToken issueAppRequestToken ( String serviceTicketBase64Param , String usernameParam , AuthEncryptedData authEncryptDataParam ) { } }

implementation: byte [ ] iv = AES256Local . generateRandom ( AES256Local . IV_SIZE_BYTES ) ; byte [ ] seed = AES256Local . generateRandom ( AES256Local . SEED_SIZE_BYTES ) ; byte [ ] sessionKey = UtilGlobal . decodeBase64 ( authEncryptDataParam . getSessionKeyBase64 ( ) ) ; byte [ ] dataToEncrypt = usernameParam . getBytes ( ) ; byte [ ] encryptedData = AES256Local . encrypt ( sessionKey , dataToEncrypt , iv ) ; byte [ ] encryptedDataHMac = AES256Local . generateLocalHMACForReqToken ( encryptedData , sessionKey , seed ) ; AppRequestToken requestToServer = new AppRequestToken ( ) ; requestToServer . setEncryptedDataBase64 ( UtilGlobal . encodeBase64 ( encryptedData ) ) ; requestToServer . setEncryptedDataHmacBase64 ( UtilGlobal . encodeBase64 ( encryptedDataHMac ) ) ; requestToServer . setIvBase64 ( UtilGlobal . encodeBase64 ( iv ) ) ; requestToServer . setSeedBase64 ( UtilGlobal . encodeBase64 ( seed ) ) ; requestToServer . setServiceTicket ( serviceTicketBase64Param ) ; try { return new AppRequestToken ( this . postJson ( requestToServer , WS . Path . User . Version1 . userIssueToken ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class FlowItemExecuteResult { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FlowItemExecuteResult }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Fluid Item . . .
if ( this . getFluidItem ( ) != null ) { returnVal . put ( JSONMapping . FLUID_ITEM , this . getFluidItem ( ) . toJsonObject ( ) ) ; } // Flow Step Rule . . .
if ( this . getFlowStepRule ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP_RULE , this . getFlowStepRule ( ) . toJsonObject ( ) ) ; } // Assignment Rule . . .
if ( this . getAssignmentRuleValue ( ) != null ) { returnVal . put ( JSONMapping . ASSIGNMENT_RULE_VALUE , this . getAssignmentRuleValue ( ) ) ; } // Statement Result as String . . .
if ( this . getStatementResultAsString ( ) != null ) { returnVal . put ( JSONMapping . STATEMENT_RESULT_AS_STRING , this . getStatementResultAsString ( ) ) ; } // Execute per Fluid Item Query . . .
if ( this . getExecutePerFluidItemQuery ( ) != null ) { returnVal . put ( JSONMapping . EXECUTE_PER_FLUID_ITEM_QUERY , this . getExecutePerFluidItemQuery ( ) ) ; } // Fluid Item Query . . .
if ( this . getFluidItemQuery ( ) != null ) { returnVal . put ( JSONMapping . FLUID_ITEM_QUERY , this . getFluidItemQuery ( ) ) ; } // Execution Result . . .
if ( this . getExecutionResult ( ) != null ) { returnVal . put ( JSONMapping . EXECUTION_RESULT , this . getExecutionResult ( ) ) ; } // Progress to next phase . . .
if ( this . getProgressToNextPhase ( ) != null ) { returnVal . put ( JSONMapping . PROGRESS_TO_NEXT_PHASE , this . getProgressToNextPhase ( ) ) ; } // Fluid Items . . .
if ( this . getFluidItems ( ) != null && ! this . getFluidItems ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( FluidItem item : this . getFluidItems ( ) ) { jsonArray . put ( item . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FLUID_ITEMS , jsonArray ) ; } // Execute Users . . .
if ( this . getExecuteUsers ( ) != null && ! this . getExecuteUsers ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( User item : this . getExecuteUsers ( ) ) { jsonArray . put ( item . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . EXECUTE_USERS , jsonArray ) ; } // Mail Messages To Send . . .
if ( this . getMailMessagesToSend ( ) != null && ! this . getMailMessagesToSend ( ) . isEmpty ( ) ) { JSONArray jsonArray = new JSONArray ( ) ; for ( MailMessage item : this . getMailMessagesToSend ( ) ) { jsonArray . put ( item . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . MAIL_MESSAGES_TO_SEND , jsonArray ) ; } return returnVal ;


signature:
public class MultiChoice { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code MultiChoice } .
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Available . . .
if ( this . getAvailableMultiChoices ( ) != null ) { List < String > availChoices = this . getAvailableMultiChoices ( ) ; returnVal . put ( JSONMapping . AVAILABLE_MULTI_CHOICES , new JSONArray ( availChoices . toArray ( ) ) ) ; returnVal . put ( JSONMapping . AVAILABLE_CHOICES , new JSONArray ( availChoices . toArray ( ) ) ) ; returnVal . put ( JSONMapping . AVAILABLE_CHOICES_COMBINED , this . combineStringArrayWith ( availChoices , UtilGlobal . PIPE ) ) ; } // Selected . . .
if ( this . getSelectedMultiChoices ( ) != null ) { List < String > selectChoices = this . getSelectedMultiChoices ( ) ; returnVal . put ( JSONMapping . SELECTED_MULTI_CHOICES , new JSONArray ( selectChoices . toArray ( ) ) ) ; returnVal . put ( JSONMapping . SELECTED_CHOICES , new JSONArray ( selectChoices . toArray ( ) ) ) ; returnVal . put ( JSONMapping . SELECTED_CHOICES_COMBINED , this . combineStringArrayWith ( selectChoices , UtilGlobal . PIPE ) ) ; } return returnVal ;


signature:
public class MultiChoice { /** * Combine { @ code listToCombineParam } into a single { @ code String } .
 * @ param listToCombineParam To combine .
 * @ param separatorCharsParam The char used to separate with .
 * @ return The combined text value . */
@ XmlTransient public String combineStringArrayWith ( List < String > listToCombineParam , String separatorCharsParam ) { } }

implementation: String returnValue = UtilGlobal . EMPTY ; int lengthOfSepChars = ( separatorCharsParam == null ) ? 0 : separatorCharsParam . length ( ) ; if ( listToCombineParam != null && ! listToCombineParam . isEmpty ( ) ) { StringBuffer concatBuffer = new StringBuffer ( ) ; for ( String toAdd : listToCombineParam ) { concatBuffer . append ( toAdd ) ; concatBuffer . append ( separatorCharsParam ) ; } String concatString = concatBuffer . toString ( ) ; returnValue = concatString . substring ( 0 , concatString . length ( ) - lengthOfSepChars ) ; } return returnValue ;


signature:
public class UserQueryClient { /** * Creates a new { @ code UserQuery } .
 * @ param userQueryParam The { @ code UserQuery } to create .
 * @ return The Created User Query .
 * @ see com . fluidbpm . program . api . vo . userquery . UserQuery */
public UserQuery createUserQuery ( UserQuery userQueryParam ) { } }

implementation: if ( userQueryParam != null && this . serviceTicket != null ) { userQueryParam . setServiceTicket ( this . serviceTicket ) ; } return new UserQuery ( this . putJson ( userQueryParam , WS . Path . UserQuery . Version1 . userQueryCreate ( ) ) ) ;


signature:
public class UserQueryClient { /** * Updates an existing { @ code UserQuery } .
 * @ param userQueryParam The { @ code UserQuery } to update .
 * @ return The Updated UserQuery .
 * @ see UserQuery */
public UserQuery updateUserQuery ( UserQuery userQueryParam ) { } }

implementation: if ( userQueryParam != null && this . serviceTicket != null ) { userQueryParam . setServiceTicket ( this . serviceTicket ) ; } return new UserQuery ( this . postJson ( userQueryParam , WS . Path . UserQuery . Version1 . userQueryUpdate ( ) ) ) ;


signature:
public class UserQueryClient { /** * Deletes the { @ code UserQuery } provided .
 * Id must be set on the { @ code UserQuery } .
 * @ param userQueryToDeleteParam The UserQuery to Delete .
 * @ return The deleted UserQuery . */
public UserQuery deleteUserQuery ( UserQuery userQueryToDeleteParam ) { } }

implementation: if ( userQueryToDeleteParam != null && this . serviceTicket != null ) { userQueryToDeleteParam . setServiceTicket ( this . serviceTicket ) ; } return new UserQuery ( this . postJson ( userQueryToDeleteParam , WS . Path . UserQuery . Version1 . userQueryDelete ( ) ) ) ;


signature:
public class UserQueryClient { /** * Retrieves User Query information for the provided { @ code userQueryIdParam } .
 * @ param userQueryIdParam The ID of the { @ code UserQuery } to retrieve info for .
 * @ return UserQuery information .
 * @ see UserQuery */
public UserQuery getUserQueryById ( Long userQueryIdParam ) { } }

implementation: UserQuery userQueryToGetInfoFor = new UserQuery ( ) ; userQueryToGetInfoFor . setId ( userQueryIdParam ) ; if ( this . serviceTicket != null ) { userQueryToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new UserQuery ( this . postJson ( userQueryToGetInfoFor , WS . Path . UserQuery . Version1 . getById ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserQueryClient { /** * Retrieves all user query information .
 * @ return UserQuery information .
 * @ see UserQueryListing */
public UserQueryListing getAllUserQueries ( ) { } }

implementation: UserQuery userQueryToGetInfoFor = new UserQuery ( ) ; if ( this . serviceTicket != null ) { userQueryToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new UserQueryListing ( this . postJson ( userQueryToGetInfoFor , WS . Path . UserQuery . Version1 . getAllUserQueries ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UserQueryClient { /** * Executes the { @ code UserQuery } { @ code queryToExecuteParam }
 * and returns the result information .
 * @ param queryToExecuteParam The UserQuery to execute .
 * @ param populateAncestorIdParam - Whether the ancestor id should be populated ( when applicable ) .
 * @ param queryLimitParam The query limit .
 * @ param offsetParam The query offset .
 * @ return The UserQuery result .
 * @ see FluidItemListing */
public FluidItemListing executeUserQuery ( UserQuery queryToExecuteParam , boolean populateAncestorIdParam , int queryLimitParam , int offsetParam ) { } }

implementation: return this . executeUserQuery ( queryToExecuteParam , populateAncestorIdParam , queryLimitParam , offsetParam , false ) ;


signature:
public class UserQueryClient { /** * Executes the { @ code UserQuery } { @ code queryToExecuteParam }
 * and returns the result information .
 * @ param queryToExecuteParam The UserQuery to execute .
 * @ param populateAncestorIdParam - Whether the ancestor id should be populated ( when applicable ) .
 * @ param queryLimitParam The query limit .
 * @ param offsetParam The query offset .
 * @ param forceUseDatabaseParam Force to use underlying database .
 * @ return The UserQuery result .
 * @ see FluidItemListing */
public FluidItemListing executeUserQuery ( UserQuery queryToExecuteParam , boolean populateAncestorIdParam , int queryLimitParam , int offsetParam , boolean forceUseDatabaseParam ) { } }

implementation:
if ( this . serviceTicket != null && queryToExecuteParam != null ) { queryToExecuteParam . setServiceTicket ( this . serviceTicket ) ; } try { return new FluidItemListing ( this . postJson ( queryToExecuteParam , WS . Path . UserQuery . Version1 . executeUserQuery ( populateAncestorIdParam , forceUseDatabaseParam , queryLimitParam , offsetParam ) ) ) ; } catch ( JSONException jsonExcept ) { // JSON Issue . . .
throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class SQLFormFieldUtil { /** * Retrieve the Form Field mappings for Electronic Form { @ code electronicFormIdParam } .
 * @ param electronicFormIdParam The Electronic Form to get Form Field mappings for .
 * @ return List of Form Field mappings . */
public List < FormFieldMapping > getFormFieldMappingForForm ( Long electronicFormIdParam ) { } }

implementation:
List < FormFieldMapping > returnVal = new ArrayList ( ) ; if ( electronicFormIdParam == null ) { return returnVal ; } PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { Long formDefinitionId = this . getFormDefinitionId ( electronicFormIdParam ) ; // Local Mapping . . .
// When we have the key by definition , we can just return .
if ( this . localDefinitionToFieldsMapping . containsKey ( formDefinitionId ) ) { return this . localDefinitionToFieldsMapping . get ( formDefinitionId ) ; } ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Field . GetFormFieldsForFormContainer ) ; preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; preparedStatement . setLong ( 1 , electronicFormIdParam ) ; resultSet = preparedStatement . executeQuery ( ) ; // Iterate each of the form containers . . .
while ( resultSet . next ( ) ) { returnVal . add ( this . mapFormFieldMapping ( resultSet ) ) ; } // Cache the mapping . . .
this . localDefinitionToFieldsMapping . put ( formDefinitionId , returnVal ) ; return returnVal ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement , resultSet ) ; }


signature:
public class SQLFormFieldUtil { /** * Retrieve the Form Field mappings for Form Definition { @ code electronicFormDefinitionIdParam } .
 * @ param formDefinitionIdParam The Electronic Form Definition
 * to get Form Field mappings for .
 * @ return List of Form Field mappings . */
public List < FormFieldMapping > getFormFieldMappingForFormDefinition ( Long formDefinitionIdParam ) { } }

implementation:
List < FormFieldMapping > returnVal = new ArrayList ( ) ; if ( formDefinitionIdParam == null || formDefinitionIdParam . longValue ( ) < 1 ) { return returnVal ; } PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { // Local Mapping . . .
// When we have the key by definition , we can just return .
if ( this . localDefinitionToFieldsMapping . containsKey ( formDefinitionIdParam ) ) { return this . localDefinitionToFieldsMapping . get ( formDefinitionIdParam ) ; } ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Field . GetFormFieldsForFormDefinition ) ; preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; preparedStatement . setLong ( 1 , formDefinitionIdParam ) ; resultSet = preparedStatement . executeQuery ( ) ; // Iterate each of the form containers . . .
while ( resultSet . next ( ) ) { returnVal . add ( this . mapFormFieldMapping ( resultSet ) ) ; } this . localDefinitionToFieldsMapping . put ( formDefinitionIdParam , returnVal ) ; return returnVal ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement , resultSet ) ; }


signature:
public class SQLFormFieldUtil { /** * Retrieves the Form Definition Id for the
 * Electronic Form with id { @ code electronicFormIdParam } .
 * @ param electronicFormIdParam The Electronic Form to fetch fields for .
 * @ return The Form Definition for Electronic Form { @ code electronicFormIdParam } . */
public Long getFormDefinitionId ( Long electronicFormIdParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } PreparedStatement preparedStatement = null ; ResultSet resultSet ; try { ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Field . GetFormDefinitionForFormContainer ) ; preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; preparedStatement . setLong ( 1 , electronicFormIdParam ) ; resultSet = preparedStatement . executeQuery ( ) ; // Iterate each of the form containers . . .
while ( resultSet . next ( ) ) { return resultSet . getLong ( 1 ) ; } return null ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement ) ; }


signature:
public class SQLFormFieldUtil { /** * Retrieves the Form Fields { @ code VALUES } for the
 * Electronic Form with id { @ code electronicFormIdParam } .
 * @ param electronicFormIdParam The Electronic Form to fetch fields for .
 * @ param includeTableFieldsParam Whether to populate the table fields .
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ return The Form Fields for Electronic Form { @ code electronicFormIdParam } . */
public List < Field > getFormFields ( Long electronicFormIdParam , boolean includeTableFieldsParam , boolean includeTableFieldFormRecordInfoParam ) { } }

implementation:
List < Field > returnVal = new ArrayList ( ) ; if ( electronicFormIdParam == null ) { return returnVal ; } List < FormFieldMapping > fieldMappings = this . getFormFieldMappingForForm ( electronicFormIdParam ) ; if ( fieldMappings == null || fieldMappings . isEmpty ( ) ) { return returnVal ; } // Get the values for each of the fields . . .
for ( FormFieldMapping fieldMapping : fieldMappings ) { // Skip if ignore Table Fields . . .
if ( ! includeTableFieldsParam && fieldMapping . dataType == UtilGlobal . FieldTypeId . _7_TABLE_FIELD ) { // Table Field . . .
continue ; } Field fieldToAdd = this . getFormFieldValueFor ( fieldMapping , electronicFormIdParam , includeTableFieldFormRecordInfoParam ) ; if ( fieldToAdd == null ) { continue ; } // When table field . . .
if ( includeTableFieldsParam && ( fieldToAdd . getFieldValue ( ) instanceof TableField ) ) { TableField tableField = ( TableField ) fieldToAdd . getFieldValue ( ) ; if ( tableField . getTableRecords ( ) != null && ! tableField . getTableRecords ( ) . isEmpty ( ) ) { for ( Form tableRecordForm : tableField . getTableRecords ( ) ) { tableRecordForm . setFormFields ( this . getFormFields ( tableRecordForm . getId ( ) , false , false ) ) ; } } } returnVal . add ( fieldToAdd ) ; } return returnVal ;


signature:
public class SQLFormFieldUtil { /** * Retrieves the Form Field value for Electronic Form { @ code formContainerIdParam } .
 * @ param formFieldMappingParam The mapping to use .
 * @ param formContainerIdParam The Electronic Form Id .
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ return Populated { @ code Field } value . */
public Field getFormFieldValueFor ( FormFieldMapping formFieldMappingParam , Long formContainerIdParam , boolean includeTableFieldFormRecordInfoParam ) { } }

implementation:
if ( formFieldMappingParam == null ) { return null ; } // First attempt to fetch from the cache . . .
if ( this . getCacheUtil ( ) != null ) { CacheUtil . CachedFieldValue cachedFieldValue = this . getCacheUtil ( ) . getCachedFieldValueFrom ( formFieldMappingParam . formDefinitionId , formContainerIdParam , formFieldMappingParam . formFieldId ) ; if ( cachedFieldValue != null ) { Field field = cachedFieldValue . getCachedFieldValueAsField ( ) ; if ( field != null ) { field . setFieldName ( formFieldMappingParam . name ) ; return field ; } } } // Now use a database lookup . . .
Field returnVal = null ; PreparedStatement preparedStatement = null , preparedStatementForTblInfo = null ; ResultSet resultSet = null , resultSetForTblInfo = null ; try { ISyntax syntax = SyntaxFactory . getInstance ( ) . getFieldValueSyntaxFor ( this . getSQLTypeFromConnection ( ) , formFieldMappingParam ) ; if ( syntax != null ) { preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; preparedStatement . setLong ( 1 , formFieldMappingParam . formDefinitionId ) ; preparedStatement . setLong ( 2 , formFieldMappingParam . formFieldId ) ; preparedStatement . setLong ( 3 , formContainerIdParam ) ; resultSet = preparedStatement . executeQuery ( ) ; } switch ( formFieldMappingParam . dataType . intValue ( ) ) { // Text . . .
case UtilGlobal . FieldTypeId . _1_TEXT : if ( resultSet . next ( ) ) { returnVal = new Field ( formFieldMappingParam . name , resultSet . getString ( 1 ) , Field . Type . Text ) ; } break ; // True False . . .
case UtilGlobal . FieldTypeId . _2_TRUE_FALSE : if ( resultSet . next ( ) ) { returnVal = new Field ( formFieldMappingParam . name , resultSet . getBoolean ( 1 ) , Field . Type . TrueFalse ) ; } break ; // Paragraph Text . . .
case UtilGlobal . FieldTypeId . _3_PARAGRAPH_TEXT : if ( resultSet . next ( ) ) { returnVal = new Field ( formFieldMappingParam . name , resultSet . getString ( 1 ) , Field . Type . ParagraphText ) ; } break ; // Multiple Choice . . .
case UtilGlobal . FieldTypeId . _4_MULTI_CHOICE : MultiChoice multiChoice = new MultiChoice ( ) ; List < String > selectedValues = new ArrayList ( ) ; while ( resultSet . next ( ) ) { selectedValues . add ( resultSet . getString ( 1 ) ) ; } multiChoice . setSelectedMultiChoices ( selectedValues ) ; if ( ! selectedValues . isEmpty ( ) ) { returnVal = new Field ( formFieldMappingParam . name , multiChoice ) ; } break ; // Date Time . . .
case UtilGlobal . FieldTypeId . _5_DATE_TIME : if ( resultSet . next ( ) ) { returnVal = new Field ( formFieldMappingParam . name , resultSet . getDate ( 1 ) , Field . Type . DateTime ) ; } break ; // Decimal . . .
case UtilGlobal . FieldTypeId . _6_DECIMAL : if ( resultSet . next ( ) ) { returnVal = new Field ( formFieldMappingParam . name , resultSet . getDouble ( 1 ) , Field . Type . Decimal ) ; } break ; // Table Field . . .
case UtilGlobal . FieldTypeId . _7_TABLE_FIELD : List < Long > formContainerIds = new ArrayList ( ) ; while ( resultSet . next ( ) ) { formContainerIds . add ( resultSet . getLong ( 1 ) ) ; } // Break if empty . . .
if ( formContainerIds . isEmpty ( ) ) { break ; } TableField tableField = new TableField ( ) ; final List < Form > formRecords = new ArrayList ( ) ; // Populate all the ids for forms . . .
formContainerIds . forEach ( formContId -> { formRecords . add ( new Form ( formContId ) ) ; } ) ; // Retrieve the info for the table record . . .
if ( includeTableFieldFormRecordInfoParam ) { ISyntax syntaxForFormContInfo = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Form . GetFormContainerInfo ) ; preparedStatementForTblInfo = this . getConnection ( ) . prepareStatement ( syntaxForFormContInfo . getPreparedStatement ( ) ) ; for ( Form formRecordToSetInfoOn : formRecords ) { preparedStatementForTblInfo . setLong ( 1 , formRecordToSetInfoOn . getId ( ) ) ; resultSetForTblInfo = preparedStatementForTblInfo . executeQuery ( ) ; if ( resultSetForTblInfo . next ( ) ) { Long formTypeId = resultSetForTblInfo . getLong ( SQLFormUtil . SQLColumnIndex . _02_FORM_TYPE ) ; formRecordToSetInfoOn . setFormTypeId ( formTypeId ) ; formRecordToSetInfoOn . setFormType ( this . sqlFormDefinitionUtil == null ? null : this . sqlFormDefinitionUtil . getFormDefinitionIdAndTitle ( ) . get ( formTypeId ) ) ; formRecordToSetInfoOn . setTitle ( resultSetForTblInfo . getString ( SQLFormUtil . SQLColumnIndex . _03_TITLE ) ) ; Date created = resultSetForTblInfo . getDate ( SQLFormUtil . SQLColumnIndex . _04_CREATED ) ; Date lastUpdated = resultSetForTblInfo . getDate ( SQLFormUtil . SQLColumnIndex . _05_LAST_UPDATED ) ; // Created . . .
if ( created != null ) { formRecordToSetInfoOn . setDateCreated ( new Date ( created . getTime ( ) ) ) ; } // Last Updated . . .
if ( lastUpdated != null ) { formRecordToSetInfoOn . setDateLastUpdated ( new Date ( lastUpdated . getTime ( ) ) ) ; } } } } tableField . setTableRecords ( formRecords ) ; returnVal = new Field ( formFieldMappingParam . name , tableField , Field . Type . Table ) ; // TODO _ _ 8 _ _ encrypted field . . .
break ; // Label . . .
case UtilGlobal . FieldTypeId . _9_LABEL : returnVal = new Field ( formFieldMappingParam . name , formFieldMappingParam . description , Field . Type . Label ) ; break ; default : throw new SQLException ( "Unable to map '" + formContainerIdParam . intValue ( ) + "', to Form Field value." ) ; } return returnVal ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement ) ; this . closeStatement ( preparedStatementForTblInfo ) ; }


signature:
public class SQLFormFieldUtil { /** * Maps a { @ code ResultSet } to a new instance of { @ code FormFieldMapping } .
 * @ param resultSetParam The { @ code ResultSet } used to create an { @ code FormFieldMapping } .
 * @ return FormFieldMapping from { @ code ResultSet } .
 * @ throws SQLException
 * @ see ResultSet
 * @ see FormFieldMapping */
private FormFieldMapping mapFormFieldMapping ( ResultSet resultSetParam ) throws SQLException { } }

implementation: return new FormFieldMapping ( resultSetParam . getLong ( 1 ) , resultSetParam . getLong ( 2 ) , resultSetParam . getLong ( 3 ) , resultSetParam . getString ( 4 ) , resultSetParam . getString ( 5 ) , resultSetParam . getString ( 6 ) ) ;


signature:
public class RoleClient { /** * Creates a new { @ code Role } with the privileges inside the { @ code roleParam } .
 * @ param roleParam The { @ code Role } to create .
 * @ return The Created Role .
 * @ see Role
 * @ see com . fluidbpm . program . api . vo . role . RoleToFormDefinition
 * @ see com . fluidbpm . program . api . vo . role . RoleToFormFieldToFormDefinition
 * @ see com . fluidbpm . program . api . vo . role . RoleToJobView */
public Role createRole ( Role roleParam ) { } }

implementation: if ( roleParam != null && this . serviceTicket != null ) { roleParam . setServiceTicket ( this . serviceTicket ) ; } return new Role ( this . putJson ( roleParam , WS . Path . Role . Version1 . roleCreate ( ) ) ) ;


signature:
public class RoleClient { /** * Updates an existing { @ code Role } with the privileges inside the { @ code roleParam } .
 * @ param roleParam The { @ code Role } to update .
 * @ return The Created Role .
 * @ see Role
 * @ see com . fluidbpm . program . api . vo . role . RoleToFormDefinition
 * @ see com . fluidbpm . program . api . vo . role . RoleToFormFieldToFormDefinition
 * @ see com . fluidbpm . program . api . vo . role . RoleToJobView */
public Role updateRole ( Role roleParam ) { } }

implementation: if ( roleParam != null && this . serviceTicket != null ) { roleParam . setServiceTicket ( this . serviceTicket ) ; } return new Role ( this . postJson ( roleParam , WS . Path . Role . Version1 . roleUpdate ( ) ) ) ;


signature:
public class RoleClient { /** * Deletes the { @ code Role } provided .
 * Id must be set on the { @ code Role } .
 * @ param roleToDeleteParam The Role to Delete .
 * @ return The deleted Role . */
public Role deleteRole ( Role roleToDeleteParam ) { } }

implementation: if ( roleToDeleteParam != null && this . serviceTicket != null ) { roleToDeleteParam . setServiceTicket ( this . serviceTicket ) ; } return new Role ( this . postJson ( roleToDeleteParam , WS . Path . Role . Version1 . roleDelete ( ) ) ) ;


signature:
public class RoleClient { /** * Retrieves role information for the provided { @ code roleIdParam } .
 * @ param roleIdParam The ID of the { @ code Role } to retrieve info for .
 * @ return Role information .
 * @ see com . fluidbpm . program . api . vo . role . Role */
public Role getRoleById ( Long roleIdParam ) { } }

implementation: Role roleToGetInfoFor = new Role ( ) ; roleToGetInfoFor . setId ( roleIdParam ) ; if ( this . serviceTicket != null ) { roleToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new Role ( this . postJson ( roleToGetInfoFor , WS . Path . Role . Version1 . getById ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class RoleClient { /** * Retrieves all role information .
 * @ return Role information .
 * @ see com . fluidbpm . program . api . vo . role . RoleListing */
public RoleListing getAllRoles ( ) { } }

implementation: RoleListing roleToGetInfoFor = new RoleListing ( ) ; if ( this . serviceTicket != null ) { roleToGetInfoFor . setServiceTicket ( this . serviceTicket ) ; } try { return new RoleListing ( this . postJson ( roleToGetInfoFor , WS . Path . Role . Version1 . getAllRoles ( ) ) ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class MailMessageAttachment { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code MailMessageAttachment }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Attachment Path . . .
if ( this . getAttachmentPath ( ) != null ) { returnVal . put ( JSONMapping . ATTACHMENT_PATH , this . getAttachmentPath ( ) ) ; } // Attachment Data Base64 . . .
if ( this . getAttachmentDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . ATTACHMENT_DATA_BASE64 , this . getAttachmentDataBase64 ( ) ) ; } return returnVal ;


signature:
public class CommandUtil { /** * Executes the { @ code commandParams } and returns the result .
 * @ param commandParams The command and parameters to execute .
 * @ return The result of the execution .
 * @ throws IOException If execution of the command fails .
 * @ see CommandResult */
public CommandResult executeCommand ( String ... commandParams ) throws IOException { } }

implementation:
if ( commandParams == null || commandParams . length == 0 ) { throw new IOException ( "Unable to execute command. No commands provided." ) ; } List < String > returnedLines = new ArrayList ( ) ; Charset charset = Charset . forName ( ENCODING_UTF_8 ) ; try { Process process = null ; // One param . . .
if ( commandParams . length == 1 ) { process = Runtime . getRuntime ( ) . exec ( commandParams [ 0 ] ) ; } // More params . . .
else { process = Runtime . getRuntime ( ) . exec ( commandParams ) ; } BufferedReader reader = new BufferedReader ( new InputStreamReader ( process . getInputStream ( ) , charset ) ) ; String readLine = null ; while ( ( readLine = reader . readLine ( ) ) != null ) { returnedLines . add ( readLine ) ; } BufferedReader errorReader = new BufferedReader ( new InputStreamReader ( process . getErrorStream ( ) , charset ) ) ; while ( ( readLine = errorReader . readLine ( ) ) != null ) { returnedLines . add ( readLine ) ; } int exitValue = - 1000 ; try { exitValue = process . waitFor ( ) ; } catch ( InterruptedException e ) { String commandString = ( commandParams == null || commandParams . length == 0 ) ? "<unknown>" : commandParams [ 0 ] ; throw new IOException ( "Unable to wait for command [" + commandString + "] to exit. " + e . getMessage ( ) , e ) ; } String [ ] rtnArr = { } ; return new CommandResult ( exitValue , returnedLines . toArray ( rtnArr ) ) ; } catch ( IOException ioExeption ) { // IO Problem . . .
String commandString = ( commandParams == null || commandParams . length == 0 ) ? "<unknown>" : commandParams [ 0 ] ; throw new IOException ( "Unable to execute command/s [" + commandString + "]. " + ioExeption . getMessage ( ) , ioExeption ) ; }


signature:
public class CommandUtil { /** * Executes the { @ code objectCommandParam } and returns the result .
 * @ param objectCommandParam The command to execute .
 * @ return The result of the execution .
 * @ see CommandUtil # executeCommand ( String . . . )
 * @ throws Exception If anything goes wrong during execution . */
public CommandResult executeCommand ( String objectCommandParam ) throws Exception { } }

implementation: if ( objectCommandParam == null ) { return new CommandResult ( 333 , new String [ ] { "No Object Command provided. 'null' not allowed." } ) ; } return this . executeCommand ( new String [ ] { objectCommandParam } ) ;


signature:
public class AccessToken { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AccessToken }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Access Token . . .
if ( this . getAccessToken ( ) != null ) { returnVal . put ( JSONMapping . ACCESS_TOKEN , this . getAccessToken ( ) ) ; } // Id Token . . .
if ( this . getIdToken ( ) != null ) { returnVal . put ( JSONMapping . ID_TOKEN , this . getIdToken ( ) ) ; } // Token Type . . .
if ( this . getTokenType ( ) != null ) { returnVal . put ( JSONMapping . TOKEN_TYPE , this . getTokenType ( ) ) ; } return returnVal ;


signature:
public class FormHistoricData { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FormFlowHistoricData } .
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Date . . .
if ( this . getDate ( ) != null ) { returnVal . put ( JSONMapping . DATE , this . getDateAsLongFromJson ( this . getDate ( ) ) ) ; } // Date and Time Field Name . . .
if ( this . getDateAndFieldName ( ) != null ) { returnVal . put ( JSONMapping . DATE_AND_FIELD_NAME , this . getDateAndFieldName ( ) ) ; } // Form Container Field Values JSON . . .
if ( this . getFormContainerFieldValuesJSON ( ) != null ) { returnVal . put ( JSONMapping . FORM_CONTAINER_FIELD_VALUES_JSON , this . getFormContainerFieldValuesJSON ( ) ) ; } // Log Entry Type . . .
if ( this . getLogEntryType ( ) != null ) { returnVal . put ( JSONMapping . LOG_ENTRY_TYPE , this . getLogEntryType ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Historic Entry Type . . .
if ( this . getHistoricEntryType ( ) != null ) { returnVal . put ( JSONMapping . HISTORIC_ENTRY_TYPE , this . getHistoricEntryType ( ) ) ; } // User . . .
if ( this . getUser ( ) != null ) { returnVal . put ( JSONMapping . USER , this . getUser ( ) . toJsonObject ( ) ) ; } // Field . . .
if ( this . getField ( ) != null ) { returnVal . put ( JSONMapping . FIELD , this . getField ( ) . toJsonObject ( ) ) ; } // Different from Previous . . .
if ( this . getIsFieldDifferentFromPrevious ( ) != null ) { returnVal . put ( JSONMapping . IS_FIELD_DIFFERENT_FROM_PREVIOUS , this . getIsFieldDifferentFromPrevious ( ) ) ; } // Field type Signature . . .
if ( this . getIsFieldTypeSignature ( ) != null ) { returnVal . put ( JSONMapping . IS_FIELD_TYPE_SIGNATURE , this . getIsFieldTypeSignature ( ) ) ; } // Escape Text . . .
if ( this . getIsEscapeText ( ) != null ) { returnVal . put ( JSONMapping . IS_ESCAPE_TEXT , this . getIsEscapeText ( ) ) ; } return returnVal ;


signature:
public class RoleToFormDefinition { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code RoleToFormDefinition }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Can Create . . .
if ( this . isCanCreate ( ) != null ) { returnVal . put ( JSONMapping . CAN_CREATE , this . isCanCreate ( ) . booleanValue ( ) ) ; } // Attachment can View . . .
if ( this . isAttachmentsView ( ) != null ) { returnVal . put ( JSONMapping . ATTACHMENTS_VIEW , this . isAttachmentsView ( ) . booleanValue ( ) ) ; } // Attachment can Create or Modify . . .
if ( this . isAttachmentsCreateUpdate ( ) != null ) { returnVal . put ( JSONMapping . ATTACHMENTS_CREATE_UPDATE , this . isAttachmentsCreateUpdate ( ) . booleanValue ( ) ) ; } // Form Definition . . .
if ( this . getFormDefinition ( ) != null ) { returnVal . put ( JSONMapping . FORM_DEFINITION , this . getFormDefinition ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as one of the { @ code Field . Type } s .
 * @ see Field . Type */
@ XmlTransient public Object getFieldValueForField ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValue ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code String } .
 * @ see Field . Type # Text */
@ XmlTransient public String getFieldValueAsString ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsString ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code TableField } .
 * @ see Field . Type # Table
 * @ see TableField */
@ XmlTransient public TableField getFieldValueAsTableField ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsTableField ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code MultiChoice } .
 * @ see Field . Type # MultipleChoice
 * @ see MultiChoice */
@ XmlTransient public MultiChoice getFieldValueAsMultiChoice ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsMultiChoice ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Date } .
 * @ see Field . Type # DateTime */
@ XmlTransient public Date getFieldValueAsDate ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsDate ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Boolean } .
 * @ see Field . Type # TrueFalse */
@ XmlTransient public Boolean getFieldValueAsBoolean ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsBoolean ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Double } .
 * @ see Field . Type # Decimal */
@ XmlTransient public Double getFieldValueAsDouble ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsDouble ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < li > Field Value is not of type { @ code Number } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Integer } .
 * @ see Field . Type # Decimal */
@ XmlTransient public Integer getFieldValueAsInt ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsInteger ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < li > Field Value is not of type { @ code Number } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Long } .
 * @ see Field . Type # Decimal */
@ XmlTransient public Long getFieldValueAsLong ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsLong ( ) ;


signature:
public class Form { /** * Returns the value of the { @ code fieldNameParam } requested .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * A { @ code null } will be returned if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < li > Field Value is not of type { @ code Number } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ return The value for the Form Field as { @ code Number } .
 * @ see Field . Type # Decimal */
@ XmlTransient public Number getFieldValueAsNumber ( String fieldNameParam ) { } }

implementation: Field fieldWithName = this . getField ( fieldNameParam ) ; return ( fieldWithName == null ) ? null : fieldWithName . getFieldValueAsNumber ( ) ;


signature:
public class Form { /** * Sets the value of the { @ code fieldNameParam } requested .
 * If there is an existing value , the value will be override with
 * the value of { @ code fieldValueParam } .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * The value won ' t be set if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ param fieldValueParam The value of the { @ code Field } .
 * @ see Field . Type */
@ XmlTransient public void setFieldValue ( String fieldNameParam , Object fieldValueParam ) { } }

implementation:
if ( fieldNameParam == null || fieldNameParam . trim ( ) . length ( ) == 0 ) { return ; } if ( this . getFormFields ( ) == null || this . getFormFields ( ) . isEmpty ( ) ) { this . setFormFields ( new ArrayList ( ) ) ; } String fieldNameParamLower = fieldNameParam . toLowerCase ( ) ; for ( Iterator < Field > fieldIter = this . getFormFields ( ) . iterator ( ) ; fieldIter . hasNext ( ) ; ) { Field field = fieldIter . next ( ) ; if ( field . getFieldName ( ) == null || field . getFieldName ( ) . trim ( ) . length ( ) == 0 ) { continue ; } String fieldNameLower = field . getFieldName ( ) . toLowerCase ( ) ; if ( fieldNameParamLower . equals ( fieldNameLower ) ) { field . setFieldValue ( fieldValueParam ) ; return ; } } // When the Field is not added previously . . .
this . getFormFields ( ) . add ( new Field ( fieldNameParam , fieldValueParam ) ) ;


signature:
public class Form { /** * Sets the value of the { @ code fieldNameParam } requested .
 * If there is an existing value , the value will be override with
 * the value of { @ code fieldValueParam } .
 * The { @ code fieldNameParam } < b > is not < / b > case sensitive .
 * < br >
 * The value won ' t be set if ;
 * < ul >
 * < li > { @ code fieldNameParam } is { @ code null } or empty . < / li >
 * < li > { @ code getFormFields ( ) } is { @ code null } or empty . < / li >
 * < li > Field is not found by { @ code fieldNameParam } . < / li >
 * < / ul >
 * @ param fieldNameParam The name of the Form Field as in Fluid .
 * @ param fieldValueParam The value of the { @ code Field } .
 * @ param typeParam The { @ code Field . Type } of { @ code Field } .
 * @ see Field . Type */
@ XmlTransient public void setFieldValue ( String fieldNameParam , Object fieldValueParam , Field . Type typeParam ) { } }

implementation:
if ( fieldNameParam == null ) { return ; } if ( this . getFormFields ( ) == null || this . getFormFields ( ) . isEmpty ( ) ) { this . setFormFields ( new ArrayList ( ) ) ; } String paramLower = fieldNameParam . toLowerCase ( ) . trim ( ) ; boolean valueFound = false ; // Iterate the Form Fields . . .
int fieldIndex = 0 ; for ( Iterator < Field > fieldIter = this . getFormFields ( ) . iterator ( ) ; fieldIter . hasNext ( ) ; fieldIndex ++ ) { Field field = fieldIter . next ( ) ; String toCheckNameLower = field . getFieldName ( ) ; if ( toCheckNameLower == null || toCheckNameLower . trim ( ) . isEmpty ( ) ) { continue ; } toCheckNameLower = toCheckNameLower . trim ( ) . toLowerCase ( ) ; if ( paramLower . equals ( toCheckNameLower ) ) { valueFound = true ; this . getFormFields ( ) . get ( fieldIndex ) . setFieldValue ( fieldValueParam ) ; this . getFormFields ( ) . get ( fieldIndex ) . setTypeAsEnum ( typeParam ) ; break ; } } // Add the value if it wasn ' t found by name . . .
if ( ! valueFound ) { this . getFormFields ( ) . add ( new Field ( fieldNameParam , fieldValueParam , typeParam ) ) ; }


signature:
public class Form { /** * Determine whether the current { @ code Form } Type / Definition is
 * of type { @ code formTypeParam }
 * If the { @ code formTypeParam } is { @ code null } or empty , { @ code false }
 * will be returned .
 * @ param formTypeParam String value of the Form Definition .
 * @ return Whether the { @ code Form } is of type { @ code formTypeParam } */
@ XmlTransient public boolean isFormType ( String formTypeParam ) { } }

implementation: if ( ( formTypeParam == null || formTypeParam . trim ( ) . isEmpty ( ) ) || ( this . getFormType ( ) == null || this . getFormType ( ) . trim ( ) . isEmpty ( ) ) ) { return false ; } return formTypeParam . toLowerCase ( ) . equals ( getFormType ( ) . toLowerCase ( ) ) ;


signature:
public class Form { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Form }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( ) */
@ Override @ XmlTransient public JSONObject toJsonObject ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Form Type . . .
if ( this . getFormType ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE , this . getFormType ( ) ) ; } // Form Type Id . . .
if ( this . getFormTypeId ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE_ID , this . getFormTypeId ( ) ) ; } // Title . . .
if ( this . getTitle ( ) != null ) { returnVal . put ( JSONMapping . TITLE , this . getTitle ( ) ) ; } // Form Description . . .
if ( this . getFormDescription ( ) != null ) { returnVal . put ( JSONMapping . FORM_DESCRIPTION , this . getFormDescription ( ) ) ; } // Ancestor Label . . .
if ( this . getAncestorLabel ( ) != null ) { returnVal . put ( JSONMapping . ANCESTOR_LABEL , this . getAncestorLabel ( ) ) ; } // Descendant Label . . .
if ( this . getDescendantsLabel ( ) != null ) { returnVal . put ( JSONMapping . DESCENDANTS_LABEL , this . getDescendantsLabel ( ) ) ; } // Number Inputs . . .
if ( this . getNumberInputs ( ) != null ) { returnVal . put ( JSONMapping . NUMBER_INPUTS , this . getNumberInputs ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } // Current User . . .
if ( this . getCurrentUser ( ) != null ) { returnVal . put ( JSONMapping . CURRENT_USER , this . getCurrentUser ( ) . toJsonObject ( ) ) ; } // State . . .
if ( this . getState ( ) != null ) { returnVal . put ( JSONMapping . STATE , this . getState ( ) ) ; } // Flow State . . .
if ( this . getFlowState ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STATE , this . getFlowState ( ) ) ; } // Form Fields . . .
if ( this . getFormFields ( ) != null && ! this . getFormFields ( ) . isEmpty ( ) ) { JSONArray formFieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getFormFields ( ) ) { formFieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . FORM_FIELDS , formFieldsArr ) ; } // Associated Flows . . .
if ( this . getAssociatedFlows ( ) != null && ! this . getAssociatedFlows ( ) . isEmpty ( ) ) { JSONArray assoJobsArr = new JSONArray ( ) ; for ( Flow toAdd : this . getAssociatedFlows ( ) ) { assoJobsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ASSOCIATED_FLOWS , assoJobsArr ) ; } // Ancestor . . .
Long ancestorIdLcl = this . getAncestorId ( ) ; if ( ancestorIdLcl != null ) { returnVal . put ( JSONMapping . ANCESTOR_ID , ancestorIdLcl ) ; } // Table Field Parent Id . . .
if ( this . getTableFieldParentId ( ) != null ) { returnVal . put ( JSONMapping . TABLE_FIELD_PARENT_ID , this . getTableFieldParentId ( ) ) ; } // Descendant Ids . . .
if ( this . getDescendantIds ( ) != null && ! this . getDescendantIds ( ) . isEmpty ( ) ) { JSONArray array = new JSONArray ( ) ; for ( Long formId : this . getDescendantIds ( ) ) { array . put ( formId ) ; } returnVal . put ( JSONMapping . DESCENDANT_IDS , array ) ; } return returnVal ;


signature:
public class Form { /** * Creates the mapping object required by Elastic Search when making
 * use of enhanced data - types .
 * See { @ code https : / / www . elastic . co / guide / en / elasticsearch / reference / current / mapping - types . html } .
 * @ return { @ code JSONObject } representation of { @ code Form } for
 * ElasticSearch mapping .
 * @ throws JSONException If there is a problem with the JSON Body . */
@ Override @ XmlTransient public JSONObject toJsonMappingForElasticSearch ( ) throws JSONException { } }

implementation:
JSONObject returnVal = new JSONObject ( ) ; // Id . . .
{ JSONObject idJsonObj = new JSONObject ( ) ; idJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . LONG ) ; returnVal . put ( ABaseFluidJSONObject . JSONMapping . ID , idJsonObj ) ; } // Form Type . . .
{ JSONObject formTypeJsonObj = new JSONObject ( ) ; formTypeJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . KEYWORD ) ; returnVal . put ( JSONMapping . FORM_TYPE , formTypeJsonObj ) ; } // Form Type Id . . .
{ JSONObject formTypeIdJsonObj = new JSONObject ( ) ; formTypeIdJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . LONG ) ; returnVal . put ( JSONMapping . FORM_TYPE_ID , formTypeIdJsonObj ) ; } // Title . . .
{ JSONObject titleJsonObj = new JSONObject ( ) ; titleJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . TEXT ) ; returnVal . put ( JSONMapping . TITLE , titleJsonObj ) ; } // Form Description . . .
{ JSONObject formDescJsonObj = new JSONObject ( ) ; formDescJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . KEYWORD ) ; returnVal . put ( JSONMapping . FORM_DESCRIPTION , formDescJsonObj ) ; } // State . . .
{ JSONObject stateJsonObj = new JSONObject ( ) ; stateJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . KEYWORD ) ; returnVal . put ( JSONMapping . STATE , stateJsonObj ) ; } // Flow State . . .
{ JSONObject flowStateJsonObj = new JSONObject ( ) ; flowStateJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . KEYWORD ) ; returnVal . put ( JSONMapping . FLOW_STATE , flowStateJsonObj ) ; } // Current User . . .
{ JSONObject currentUserJsonObj = new JSONObject ( ) ; currentUserJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . OBJECT ) ; JSONObject properties = new JSONObject ( ) ; // Current User Id . . .
JSONObject currentUserUserIdJsonObj = new JSONObject ( ) ; currentUserUserIdJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . LONG ) ; properties . put ( User . JSONMapping . Elastic . USER_ID , currentUserUserIdJsonObj ) ; // Current User Id . . .
JSONObject currentUserUsernameJsonObj = new JSONObject ( ) ; currentUserUsernameJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . KEYWORD ) ; properties . put ( User . JSONMapping . USERNAME , currentUserUsernameJsonObj ) ; currentUserJsonObj . put ( ABaseFluidJSONObject . JSONMapping . Elastic . PROPERTIES , properties ) ; returnVal . put ( JSONMapping . CURRENT_USER , currentUserJsonObj ) ; } // Date Created . . .
{ JSONObject dateCreatedJsonObj = new JSONObject ( ) ; dateCreatedJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . DATE ) ; returnVal . put ( JSONMapping . DATE_CREATED , dateCreatedJsonObj ) ; } // Date Last Updated . . .
{ JSONObject dateLastUpdatedJsonObj = new JSONObject ( ) ; dateLastUpdatedJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . DATE ) ; returnVal . put ( JSONMapping . DATE_LAST_UPDATED , dateLastUpdatedJsonObj ) ; } // Get the listing of form fields . . .
if ( this . getFormFields ( ) != null && ! this . getFormFields ( ) . isEmpty ( ) ) { for ( Field toAdd : this . getFormFields ( ) ) { JSONObject convertedField = toAdd . toJsonMappingForElasticSearch ( ) ; if ( convertedField == null ) { continue ; } String fieldNameAsCamel = toAdd . getFieldNameAsUpperCamel ( ) ; returnVal . put ( fieldNameAsCamel , convertedField ) ; } } // Ancestor Obj . . .
{ JSONObject ancestorJsonObj = new JSONObject ( ) ; ancestorJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . LONG ) ; returnVal . put ( JSONMapping . ANCESTOR_ID , ancestorJsonObj ) ; } // Table field parent id . . .
{ JSONObject tblFieldParentIdJsonObj = new JSONObject ( ) ; tblFieldParentIdJsonObj . put ( Field . JSONMapping . Elastic . MAPPING_ONLY_TYPE , Field . ElasticSearchType . LONG ) ; returnVal . put ( JSONMapping . TABLE_FIELD_PARENT_ID , tblFieldParentIdJsonObj ) ; } return returnVal ;


signature:
public class Form { /** * Conversion to { @ code JSONObject } for storage in ElasticCache for { @ code Form } .
 * @ return { @ code JSONObject } representation of { @ code Form }
 * @ throws JSONException If there is a problem with the JSON Body .
 * @ see ABaseFluidJSONObject # toJsonObject ( )
 * @ see Form */
@ Override @ XmlTransient public JSONObject toJsonForElasticSearch ( ) throws JSONException { } }

implementation:
JSONObject returnVal = super . toJsonObject ( ) ; // Form Type . . .
if ( this . getFormType ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE , this . getFormType ( ) ) ; } // Form Type Id . . .
if ( this . getFormTypeId ( ) != null ) { returnVal . put ( JSONMapping . FORM_TYPE_ID , this . getFormTypeId ( ) ) ; } // Title . . .
if ( this . getTitle ( ) != null ) { returnVal . put ( JSONMapping . TITLE , this . getTitle ( ) ) ; } // Form Description . . .
if ( this . getFormDescription ( ) != null ) { returnVal . put ( JSONMapping . FORM_DESCRIPTION , this . getFormDescription ( ) ) ; } // State . . .
if ( this . getState ( ) != null ) { returnVal . put ( JSONMapping . STATE , this . getState ( ) ) ; } // Flow State . . .
if ( this . getFlowState ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STATE , this . getFlowState ( ) ) ; } // Current User . . .
JSONObject currentUserJsonObj = new JSONObject ( ) ; if ( this . getCurrentUser ( ) == null ) { currentUserJsonObj . put ( User . JSONMapping . Elastic . USER_ID , JSONObject . NULL ) ; currentUserJsonObj . put ( User . JSONMapping . USERNAME , JSONObject . NULL ) ; } else { // Id . . .
if ( this . getCurrentUser ( ) . getId ( ) == null || this . getCurrentUser ( ) . getId ( ) . longValue ( ) < 1 ) { currentUserJsonObj . put ( User . JSONMapping . Elastic . USER_ID , JSONObject . NULL ) ; } else { currentUserJsonObj . put ( User . JSONMapping . Elastic . USER_ID , this . getCurrentUser ( ) . getId ( ) ) ; } // Username . . .
if ( this . getCurrentUser ( ) . getUsername ( ) == null || this . getCurrentUser ( ) . getUsername ( ) . trim ( ) . isEmpty ( ) ) { currentUserJsonObj . put ( User . JSONMapping . USERNAME , JSONObject . NULL ) ; } else { currentUserJsonObj . put ( User . JSONMapping . USERNAME , this . getCurrentUser ( ) . getUsername ( ) ) ; } } returnVal . put ( JSONMapping . CURRENT_USER , currentUserJsonObj ) ; // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateAsLongFromJson ( this . getDateCreated ( ) ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateAsLongFromJson ( this . getDateLastUpdated ( ) ) ) ; } // Form Fields . . .
if ( this . getFormFields ( ) != null && ! this . getFormFields ( ) . isEmpty ( ) ) { for ( Field toAdd : this . getFormFields ( ) ) { JSONObject convertedFieldObj = toAdd . toJsonForElasticSearch ( ) ; if ( convertedFieldObj == null ) { continue ; } Iterator < String > iterKeys = convertedFieldObj . keys ( ) ; while ( iterKeys . hasNext ( ) ) { String key = iterKeys . next ( ) ; returnVal . put ( key , convertedFieldObj . get ( key ) ) ; } } } // Ancestor . . .
Long ancestorIdLcl = this . getAncestorId ( ) ; if ( ancestorIdLcl != null ) { returnVal . put ( JSONMapping . ANCESTOR_ID , ancestorIdLcl ) ; } // Table Field Parent Id . . .
if ( this . getTableFieldParentId ( ) != null ) { returnVal . put ( JSONMapping . TABLE_FIELD_PARENT_ID , this . getTableFieldParentId ( ) ) ; } // Descendant Ids . . .
if ( this . getDescendantIds ( ) != null && ! this . getDescendantIds ( ) . isEmpty ( ) ) { JSONArray array = new JSONArray ( ) ; for ( Long formId : this . getDescendantIds ( ) ) { array . put ( formId ) ; } returnVal . put ( JSONMapping . DESCENDANT_IDS , array ) ; } return returnVal ;


signature:
public class Form { /** * Serialize { @ code this } object into a JSONObject .
 * Any fields provided with a Java { @ code null } value will be stored
 * as { @ code JSONObject . Null } . { @ code Field . Type . Table } fields are not supported and will be skipped .
 * @ return Flat { @ code JSON } object ( No inner fields ) .
 * @ see JSONObject */
@ XmlTransient public JSONObject convertToFlatJSONObject ( ) { } }

implementation:
JSONObject returnVal = new JSONObject ( ) ; // Id . . .
returnVal . put ( FlatFormJSONMapping . FORM_ID , this . getId ( ) == null ? JSONObject . NULL : this . getId ( ) ) ; // Title . . .
returnVal . put ( FlatFormJSONMapping . FORM_TITLE , this . getTitle ( ) == null ? JSONObject . NULL : this . getTitle ( ) ) ; // Form Type . . .
returnVal . put ( FlatFormJSONMapping . FORM_TYPE , this . getFormType ( ) == null ? JSONObject . NULL : this . getFormType ( ) ) ; // State . . .
returnVal . put ( FlatFormJSONMapping . FORM_STATE , this . getState ( ) == null ? JSONObject . NULL : this . getState ( ) ) ; // Form Flow State . . .
returnVal . put ( FlatFormJSONMapping . FORM_FLOW_STATE , this . getFlowState ( ) == null ? JSONObject . NULL : this . getFlowState ( ) ) ; // Date Created . . .
returnVal . put ( FlatFormJSONMapping . FORM_DATE_CREATED , ( this . getDateCreated ( ) == null ) ? JSONObject . NULL : this . getDateCreated ( ) . getTime ( ) ) ; // Date Last Updated . . .
returnVal . put ( FlatFormJSONMapping . FORM_DATE_LAST_UPDATED , ( this . getDateLastUpdated ( ) == null ) ? JSONObject . NULL : this . getDateLastUpdated ( ) . getTime ( ) ) ; // Form Fields . . .
if ( this . getFormFields ( ) == null || this . getFormFields ( ) . isEmpty ( ) ) { return returnVal ; } // Set the form fields . . .
UtilGlobal utilGlobal = new UtilGlobal ( ) ; this . getFormFields ( ) . forEach ( ( formFieldItem ) -> { utilGlobal . setFlatFieldOnJSONObj ( FlatFormJSONMapping . FORM_FIELD_PREFIX , FlatFormJSONMapping . FORM_FIELD_ID_PREFIX , formFieldItem , returnVal ) ;