signature:
public class FlowStepClient { /** * Updates an existing Flow Step .
 * @ param flowStepParam The updated Flow Step values .
 * @ return The updated Step . */
public FlowStep updateFlowStep ( FlowStep flowStepParam ) { } }

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


signature:
public class FlowStepClient { /** * Retrieves an existing Flow Step via Primary key .
 * @ param flowStepIdParam The Flow Step Primary Key .
 * @ param flowStepTypeParam The type of step .
 * @ return The Step retrieved by Primary key .
 * @ see com . fluidbpm . program . api . vo . flow . FlowStep . StepType */
public FlowStep getFlowStepById ( Long flowStepIdParam , String flowStepTypeParam ) { } }

implementation: FlowStep flowStep = new FlowStep ( flowStepIdParam ) ; flowStep . setFlowStepType ( flowStepTypeParam ) ; if ( this . serviceTicket != null ) { flowStep . setServiceTicket ( this . serviceTicket ) ; } return new FlowStep ( this . postJson ( flowStep , WS . Path . FlowStep . Version1 . getById ( ) ) ) ;


signature:
public class FlowStepClient { /** * Retrieves an existing Flow Step via Step .
 * Lookup will include id , then ;
 * Name .
 * @ param flowStepParam The Flow Step to use as lookup .
 * @ return The Step retrieved by provided { @ code flowStepParam } .
 * @ see com . fluidbpm . program . api . vo . flow . FlowStep . StepType */
public FlowStep getFlowStepByStep ( FlowStep flowStepParam ) { } }

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


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * via Flow Step Name key .
 * @ param flowStepNameParam The Flow Step Name .
 * @ param flowParam The Flow .
 * @ return The Step retrieved by Primary key .
 * @ see com . fluidbpm . program . api . vo . flow . FlowStep . StepType */
public JobViewListing getJobViewsByStepName ( String flowStepNameParam , Flow flowParam ) { } }

implementation: FlowStep step = new FlowStep ( ) ; step . setName ( flowStepNameParam ) ; step . setFlow ( flowParam ) ; return this . getJobViewsByStep ( step ) ;


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * via Flow Step Name key .
 * @ param flowNameParam The Flow Name .
 * @ param flowStepNameParam The Flow Step Name .
 * @ param flowViewNameParam The Step View Name .
 * @ return The View that matches the credentials .
 * @ see com . fluidbpm . program . api . vo . flow . FlowStep . StepType
 * @ see JobView */
public JobView getStandardJobViewBy ( String flowNameParam , String flowStepNameParam , String flowViewNameParam ) { } }

implementation: if ( flowNameParam == null || flowNameParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Flow name not provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( flowStepNameParam == null || flowStepNameParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Step name not provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } if ( flowViewNameParam == null || flowViewNameParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "View name not provided." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } JobViewListing jobViewListing = this . getJobViewsByStepName ( flowStepNameParam , new Flow ( flowNameParam ) ) ; JobView returnVal = null ; if ( jobViewListing . getListingCount ( ) . intValue ( ) > 1 ) { for ( JobView jobView : jobViewListing . getListing ( ) ) { if ( ViewType . STANDARD . equals ( jobView . getViewType ( ) ) && jobView . getViewName ( ) . equalsIgnoreCase ( flowViewNameParam ) ) { returnVal = jobView ; break ; } } } if ( returnVal == null ) { throw new FluidClientException ( "No View found for Flow '" + flowNameParam + "', Step '" + flowStepNameParam + "' and View '" + flowViewNameParam + "'." , FluidClientException . ErrorCode . NO_RESULT ) ; } return returnVal ;


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * via Flow Step Primary key .
 * @ param flowStepParam The Flow Step .
 * @ return The Step retrieved by Primary key .
 * @ see com . fluidbpm . program . api . vo . flow . FlowStep . StepType */
public JobViewListing getJobViewsByStep ( FlowStep flowStepParam ) { } }

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


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * via logged in { @ code User } .
 * @ return The JobView ' s by logged in user . */
public JobViewListing getJobViewsByLoggedInUser ( ) { } }

implementation: FlowStep flowStep = new FlowStep ( ) ; if ( this . serviceTicket != null ) { flowStep . setServiceTicket ( this . serviceTicket ) ; } return new JobViewListing ( this . postJson ( flowStep , WS . Path . FlowStep . Version1 . getAllViewsByLoggedInUser ( ) ) ) ;


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * for { @ code User } .
 * @ param userParam The { @ link User } to get job views for .
 * @ return The JobView ' s that user { @ code userParam } has access to . */
public JobViewListing getJobViewsByUser ( User userParam ) { } }

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


signature:
public class FlowStepClient { /** * Retrieves all Assignment { @ link com . fluidbpm . program . api . vo . flow . JobView } s
 * for { @ code Flow } .
 * @ param flowParam The flow to get { @ link JobView } ' s for .
 * @ return The JobView ' s associated with Flow { @ code flowParam } . */
public JobViewListing getJobViewsByFlow ( Flow flowParam ) { } }

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


signature:
public class FlowStepClient { /** * Retrieves all Steps via Flow .
 * @ param flowParam The Flow .
 * @ return The Step retrieved by Primary key .
 * @ see com . fluidbpm . program . api . vo . flow . Flow
 * @ see FlowStepListing */
public FlowStepListing getStepsByFlow ( Flow flowParam ) { } }

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


signature:
public class FlowStepClient { /** * Delete an existing Flow Step .
 * @ param flowStepParam The Flow Step to delete .
 * @ return The deleted Flow Step . */
public FlowStep deleteFlowStep ( FlowStep flowStepParam ) { } }

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


signature:
public class FlowStepClient { /** * Forcefully delete an existing Flow Step .
 * Only ' admin ' can forcefully delete a step .
 * @ param flowStepParam The Flow Step to delete .
 * @ return The deleted Flow Step . */
public FlowStep forceDeleteFlowStep ( FlowStep flowStepParam ) { } }

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


signature:
public class ABaseESUtil { /** * Performs a search against the Elasticsearch instance with the { @ code qbParam } .
 * @ param qbParam The @ { code QueryBuilder } to search with .
 * @ param indexParam The Elasticsearch Index to use { @ code ( document , folder or table _ field ) } .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The number of results to return .
 * @ param formTypesParam The Id ' s for the Form Definitions to be returned .
 * @ return The { @ code ElasticTypeAndId } { @ code List } .
 * @ see Index
 * @ see ElasticTypeAndId */
public final List < ElasticTypeAndId > searchAndConvertHitsToIdsOnly ( QueryBuilder qbParam , String indexParam , int offsetParam , int limitParam , Long ... formTypesParam ) { } }

implementation:
SearchHits searchHits = this . searchWithHits ( qbParam , indexParam , true , offsetParam , limitParam , formTypesParam ) ; List < ElasticTypeAndId > returnVal = null ; long totalHits ; if ( searchHits != null && ( totalHits = searchHits . getTotalHits ( ) ) > 0 ) { returnVal = new ArrayList ( ) ; if ( ( searchHits . getHits ( ) . length != totalHits ) && ( searchHits . getHits ( ) . length != limitParam ) ) { throw new FluidElasticSearchException ( "The Hits and fetch count has mismatch. Total hits is '" + totalHits + "' while hits is '" + searchHits . getHits ( ) . length + "'." ) ; } long iterationMax = totalHits ; if ( limitParam > 0 && totalHits > limitParam ) { iterationMax = limitParam ; } // Iterate . . .
for ( int index = 0 ; index < iterationMax ; index ++ ) { SearchHit searchHit = searchHits . getAt ( index ) ; String idAsString ; if ( ( idAsString = searchHit . getId ( ) ) == null ) { continue ; } returnVal . add ( new ElasticTypeAndId ( this . toLongSafe ( idAsString ) , searchHit . getType ( ) ) ) ; } } return returnVal ;


signature:
public class ABaseESUtil { /** * Performs a search against the Elasticsearch instance with the { @ code qbParam } .
 * @ param qbParam The @ { code QueryBuilder } to search with .
 * @ param indexParam The Elasticsearch Index to use { @ code ( document , folder or table _ field ) } .
 * @ param withNoFieldsParam Should fields be IGNORED returned .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The max number of results to return .
 * @ param formTypesParam The Id ' s for the Form Definitions to be returned .
 * @ return The Elasticsearch { @ code SearchHits } . */
public final SearchHits searchWithHits ( QueryBuilder qbParam , String indexParam , boolean withNoFieldsParam , int offsetParam , int limitParam , Long ... formTypesParam ) { } }

implementation:
if ( this . client == null ) { throw new ElasticsearchException ( "Elasticsearch client is not set." ) ; } SearchRequestBuilder searchRequestBuilder = this . client . prepareSearch ( // Indexes . . .
indexParam ) . setSearchType ( SearchType . DFS_QUERY_THEN_FETCH ) . setQuery ( qbParam ) . setFrom ( 0 ) . setExplain ( false ) ; // No Fields . . .
if ( withNoFieldsParam ) { searchRequestBuilder = searchRequestBuilder . storedFields ( NO_FIELDS_MAPPER ) ; } // The requested number of results . . .
if ( limitParam > 0 ) { searchRequestBuilder = searchRequestBuilder . setSize ( limitParam ) ; } if ( offsetParam > - 1 ) { searchRequestBuilder = searchRequestBuilder . setFrom ( offsetParam ) ; } if ( formTypesParam == null ) { formTypesParam = new Long [ ] { } ; } // If Types is set . . .
if ( formTypesParam != null && formTypesParam . length > 0 ) { String [ ] formTypesAsString = new String [ formTypesParam . length ] ; for ( int index = 0 ; index < formTypesParam . length ; index ++ ) { Long formTypeId = formTypesParam [ index ] ; if ( formTypeId == null ) { continue ; } formTypesAsString [ index ] = formTypeId . toString ( ) ; } searchRequestBuilder = searchRequestBuilder . setTypes ( formTypesAsString ) ; } // Perform the actual search . . .
SearchResponse searchResponse = searchRequestBuilder . execute ( ) . actionGet ( ) ; if ( searchResponse == null ) { return null ; } return searchResponse . getHits ( ) ;


signature:
public class ABaseESUtil { /** * Performs a search against the Elasticsearch instance with the { @ code qbParam } .
 * @ param qbParam The @ { code QueryBuilder } to search with .
 * @ param indexParam The Elasticsearch Index to use { @ code ( document , folder or table _ field ) } .
 * @ param withNoFieldsParam Should fields be IGNORED returned .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The number of results to return .
 * @ param formTypesParam The Id ' s for the Form Definitions to be returned .
 * @ return { @ code true } if there were any { @ code SearchHits } from the lookup . */
public final boolean searchContainHits ( QueryBuilder qbParam , String indexParam , boolean withNoFieldsParam , int offsetParam , int limitParam , Long ... formTypesParam ) { } }

implementation: SearchHits searchHits = this . searchWithHits ( qbParam , indexParam , withNoFieldsParam , offsetParam , limitParam , formTypesParam ) ; return ( searchHits != null && searchHits . getTotalHits ( ) > 0 ) ;


signature:
public class ABaseESUtil { /** * Retrieves the { @ code Form } ' s via the provided { @ code formIdsParam } .
 * @ param indexParam The ElasticSearch index to be used for lookup .
 * @ param formIdsParam { @ code List } of Identifiers for the Forms to return .
 * @ param includeFieldDataParam Whether to populate the return { @ code Form } table fields .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The max number of results to return .
 * @ return { @ code List < Form > } List of Forms . */
public final List < Form > getFormsByIds ( String indexParam , List < Long > formIdsParam , boolean includeFieldDataParam , int offsetParam , int limitParam ) { } }

implementation:
if ( formIdsParam == null || formIdsParam . isEmpty ( ) ) { return null ; } if ( indexParam == null || indexParam . trim ( ) . isEmpty ( ) ) { throw new FluidElasticSearchException ( "Index is mandatory for lookup." ) ; } // Query using the descendantId directly . . .
StringBuffer byIdQuery = new StringBuffer ( ) ; for ( Long formId : formIdsParam ) { byIdQuery . append ( ABaseFluidJSONObject . JSONMapping . ID ) ; byIdQuery . append ( ":\"" ) ; byIdQuery . append ( formId ) ; byIdQuery . append ( "\" " ) ; } String queryByIdsToString = byIdQuery . toString ( ) ; queryByIdsToString = queryByIdsToString . substring ( 0 , queryByIdsToString . length ( ) - 1 ) ; List < Form > returnVal = null ; if ( includeFieldDataParam ) { returnVal = this . searchAndConvertHitsToFormWithAllFields ( QueryBuilders . queryStringQuery ( queryByIdsToString ) , indexParam , offsetParam , limitParam , new Long [ ] { } ) ; } else { returnVal = this . searchAndConvertHitsToFormWithNoFields ( QueryBuilders . queryStringQuery ( queryByIdsToString ) , indexParam , offsetParam , limitParam , new Long [ ] { } ) ; } if ( returnVal == null || returnVal . isEmpty ( ) ) { return null ; } return returnVal ;


signature:
public class ABaseESUtil { /** * Performs a search against the Elasticsearch instance with the { @ code qbParam } .
 * @ param qbParam The @ { code QueryBuilder } to search with .
 * @ param indexParam The Elasticsearch Index to use { @ code ( document , folder or table _ field ) } .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The max number of results to return .
 * @ param formTypesParam The Id ' s for the Form Definitions to be returned .
 * @ return The { @ code SearchHits } as Fluid { @ code Form } .
 * @ see Form
 * @ see SearchHits */
public final List < Form > searchAndConvertHitsToFormWithAllFields ( QueryBuilder qbParam , String indexParam , int offsetParam , int limitParam , Long ... formTypesParam ) { } }

implementation:
SearchHits searchHits = this . searchWithHits ( qbParam , indexParam , false , offsetParam , limitParam , formTypesParam ) ; List < Form > returnVal = null ; long totalHits ; if ( searchHits != null && ( totalHits = searchHits . getTotalHits ( ) ) > 0 ) { returnVal = new ArrayList ( ) ; if ( ( searchHits . getHits ( ) . length != totalHits ) && ( searchHits . getHits ( ) . length != limitParam ) ) { throw new FluidElasticSearchException ( "The Hits and fetch count has mismatch. Total hits is '" + totalHits + "' while hits is '" + searchHits . getHits ( ) . length + "'." ) ; } long iterationMax = totalHits ; if ( limitParam > 0 && totalHits > limitParam ) { iterationMax = limitParam ; } // Iterate . . .
for ( int index = 0 ; index < iterationMax ; index ++ ) { SearchHit searchHit = searchHits . getAt ( index ) ; String source ; if ( ( source = searchHit . getSourceAsString ( ) ) == null ) { continue ; } this . printInfoOnSourceFromES ( searchHit ) ; Form formFromSource = new Form ( ) ; JSONObject jsonObject = new JSONObject ( source ) ; List < Field > fieldsForForm = null ; // Is Form Type available . . .
if ( jsonObject . has ( Form . JSONMapping . FORM_TYPE_ID ) ) { if ( this . fieldUtil == null ) { throw new FluidElasticSearchException ( "Field Util is not set. Use a different constructor." ) ; } fieldsForForm = formFromSource . convertTo ( this . fieldUtil . getFormFieldMappingForFormDefinition ( jsonObject . getLong ( Form . JSONMapping . FORM_TYPE_ID ) ) ) ; } formFromSource . populateFromElasticSearchJson ( jsonObject , fieldsForForm ) ; returnVal . add ( formFromSource ) ; } } return returnVal ;


signature:
public class ABaseESUtil { /** * Performs a search against the Elasticsearch instance with the { @ code qbParam } .
 * @ param qbParam The @ { code QueryBuilder } to search with .
 * @ param indexParam The Elasticsearch Index to use { @ code ( document , folder or table _ field ) } .
 * @ param offsetParam The offset for the results to return .
 * @ param limitParam The max number of results to return .
 * @ param formTypesParam The Id ' s for the Form Definitions to be returned .
 * @ return The { @ code SearchHits } as Fluid { @ code Form } .
 * @ see Form
 * @ see SearchHits */
public final List < Form > searchAndConvertHitsToFormWithNoFields ( QueryBuilder qbParam , String indexParam , int offsetParam , int limitParam , Long ... formTypesParam ) { } }

implementation:
SearchHits searchHits = this . searchWithHits ( qbParam , indexParam , false , offsetParam , limitParam , formTypesParam ) ; List < Form > returnVal = null ; long totalHits ; if ( searchHits != null && ( totalHits = searchHits . getTotalHits ( ) ) > 0 ) { returnVal = new ArrayList ( ) ; if ( ( searchHits . getHits ( ) . length != totalHits ) && ( searchHits . getHits ( ) . length != limitParam ) ) { throw new FluidElasticSearchException ( "The Hits and fetch count has mismatch. Total hits is '" + totalHits + "' while hits is '" + searchHits . getHits ( ) . length + "'." ) ; } long iterationMax = totalHits ; if ( limitParam > 0 && totalHits > limitParam ) { iterationMax = limitParam ; } // Iterate . . .
for ( int index = 0 ; index < iterationMax ; index ++ ) { SearchHit searchHit = searchHits . getAt ( index ) ; String source ; if ( ( source = searchHit . getSourceAsString ( ) ) == null ) { continue ; } this . printInfoOnSourceFromES ( searchHit ) ; Form formFromSource = new Form ( ) ; formFromSource . populateFromElasticSearchJson ( new JSONObject ( source ) , null ) ; returnVal . add ( formFromSource ) ; } } return returnVal ;


signature:
public class ABaseESUtil { /** * Populate all the Table Field values from the Table index .
 * @ param addAllTableRecordsForReturnParam Whether to include all the Table Records as a return value .
 * @ param includeFieldDataParam Whether to populate the return { @ code Form } table fields .
 * @ param formFieldsParam The { @ code Field } s to populate .
 * @ return { @ code List < Form > } of populated Table Field records . */
protected final List < Form > populateTableFields ( boolean addAllTableRecordsForReturnParam , boolean includeFieldDataParam , List < Field > formFieldsParam ) { } }

implementation:
if ( formFieldsParam == null || formFieldsParam . isEmpty ( ) ) { return null ; } List < Form > allTableRecordsFromAllFields = addAllTableRecordsForReturnParam ? new ArrayList ( ) : null ; // Populate each of the Table Fields . . .
for ( Field descendantField : formFieldsParam ) { // Skip if not Table Field . . .
if ( ! ( descendantField . getFieldValue ( ) instanceof TableField ) ) { continue ; } TableField tableField = ( TableField ) descendantField . getFieldValue ( ) ; List < Form > tableRecordWithIdOnly = tableField . getTableRecords ( ) ; if ( tableRecordWithIdOnly == null || tableRecordWithIdOnly . isEmpty ( ) ) { continue ; } // Populate the ids for lookup . . .
List < Long > formIdsOnly = new ArrayList ( ) ; for ( Form tableRecord : tableRecordWithIdOnly ) { formIdsOnly . add ( tableRecord . getId ( ) ) ; } List < Form > populatedTableRecords = this . getFormsByIds ( Index . TABLE_RECORD , formIdsOnly , includeFieldDataParam , DEFAULT_OFFSET , MAX_NUMBER_OF_TABLE_RECORDS ) ; if ( addAllTableRecordsForReturnParam && populatedTableRecords != null ) { allTableRecordsFromAllFields . addAll ( populatedTableRecords ) ; } tableField . setTableRecords ( populatedTableRecords ) ; descendantField . setFieldValue ( tableField ) ; } return allTableRecordsFromAllFields ;


signature:
public class ABaseESUtil { /** * Confirms whether index with the name { @ code indexToCheckParam } exists .
 * @ param indexToCheckParam ElasticSearch index to check for existance .
 * @ return { @ code true } if ElasticSearch index { @ code indexToCheckParam } exists , otherwise { @ code false } . */
public boolean doesIndexExist ( String indexToCheckParam ) { } }

implementation: if ( indexToCheckParam == null || indexToCheckParam . trim ( ) . isEmpty ( ) ) { return false ; } if ( this . client == null ) { throw new FluidElasticSearchException ( "ElasticSearch client is not initialized." ) ; } return this . client . admin ( ) . cluster ( ) . prepareState ( ) . execute ( ) . actionGet ( ) . getState ( ) . getMetaData ( ) . hasIndex ( indexToCheckParam ) ;


signature:
public class ABaseESUtil { /** * Close the SQL and ElasticSearch Connection . */
@ Override public void closeConnection ( ) { } }

implementation: CloseConnectionRunnable closeConnectionRunnable = new CloseConnectionRunnable ( this ) ; Thread closeConnThread = new Thread ( closeConnectionRunnable , "Close ABaseES Connection" ) ; closeConnThread . start ( ) ;


signature:
public class Attachment { /** * Checks to see whether { @ code this } { @ code Attachment } name contains
 * the value { @ code containingTextParam } .
 * @ param containingTextParam The text to check for < b > ( not case sensitive ) < / b > .
 * @ return Whether the { @ code Attachment } name contains { @ code containingTextParam } . */
@ XmlTransient public boolean doesNameContain ( String containingTextParam ) { } }

implementation: if ( this . getName ( ) == null || this . getName ( ) . trim ( ) . isEmpty ( ) ) { return false ; } if ( containingTextParam == null || containingTextParam . trim ( ) . isEmpty ( ) ) { return false ; } String paramLower = containingTextParam . toLowerCase ( ) ; String nameLower = this . getName ( ) . toLowerCase ( ) ; return nameLower . contains ( paramLower ) ;


signature:
public class Attachment { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Attachment }
 * @ 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 Data . . .
if ( this . getAttachmentDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . ATTACHMENT_DATA_BASE64 , this . getAttachmentDataBase64 ( ) ) ; } // Content Type . . .
if ( this . getContentType ( ) != null ) { returnVal . put ( JSONMapping . CONTENT_TYPE , this . getContentType ( ) ) ; } // Form Id . . .
if ( this . getFormId ( ) != null ) { returnVal . put ( JSONMapping . FORM_ID , this . getFormId ( ) ) ; } // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Path . . .
if ( this . getPath ( ) != null ) { returnVal . put ( JSONMapping . PATH , this . getPath ( ) ) ; } // Version . . .
if ( this . getVersion ( ) != null ) { returnVal . put ( JSONMapping . VERSION , this . getVersion ( ) ) ; } // Date Created . . .
if ( this . getDateCreated ( ) != null ) { returnVal . put ( JSONMapping . DATE_CREATED , this . getDateCreated ( ) . getTime ( ) ) ; } // Date Last Updated . . .
if ( this . getDateLastUpdated ( ) != null ) { returnVal . put ( JSONMapping . DATE_LAST_UPDATED , this . getDateLastUpdated ( ) . getTime ( ) ) ; } return returnVal ;


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

implementation: if ( formToGetTableFormsForParam != null && this . serviceTicket != null ) { formToGetTableFormsForParam . setServiceTicket ( this . serviceTicket ) ; } try { FormListing formListing = new FormListing ( this . postJson ( formToGetTableFormsForParam , WS . Path . SQLUtil . Version1 . getTableForms ( includeFieldDataParam ) ) ) ; return formListing . getListing ( ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class SQLUtilClient { /** * Retrieves all Descendants for the { @ code formToGetTableFormsForParam } .
 * @ param formToGetDescendantsForParam The Fluid Form to get Descendants for .
 * @ param includeFieldDataParam Should Descendant ( Form ) Field data be included ?
 * @ param includeTableFieldsParam Should Table Record ( Form ) Field data be included ?
 * @ param inclTableFieldFormInfoParam Include table record field info .
 * @ return The { @ code formToGetTableFormsForParam } Descendants as { @ code Form } ' s . */
public List < Form > getDescendants ( Form formToGetDescendantsForParam , boolean includeFieldDataParam , boolean includeTableFieldsParam , boolean inclTableFieldFormInfoParam ) { } }

implementation: if ( formToGetDescendantsForParam != null && this . serviceTicket != null ) { formToGetDescendantsForParam . setServiceTicket ( this . serviceTicket ) ; } try { FormListing formListing = new FormListing ( this . postJson ( formToGetDescendantsForParam , WS . Path . SQLUtil . Version1 . getDescendants ( includeFieldDataParam , includeTableFieldsParam , inclTableFieldFormInfoParam ) ) ) ; return formListing . getListing ( ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class SQLUtilClient { /** * 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 ( formToGetAncestorForParam != null && this . serviceTicket != null ) { formToGetAncestorForParam . setServiceTicket ( this . serviceTicket ) ; } try { return new Form ( this . postJson ( formToGetAncestorForParam , WS . Path . SQLUtil . Version1 . getAncestor ( includeFieldDataParam , includeTableFieldsParam ) ) ) ; } // JSON Issue . . .
catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


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

implementation: if ( formToGetFieldsForParam != null && this . serviceTicket != null ) { formToGetFieldsForParam . setServiceTicket ( this . serviceTicket ) ; } try { FormFieldListing formFieldListing = new FormFieldListing ( this . postJson ( formToGetFieldsForParam , WS . Path . SQLUtil . Version1 . getFormFields ( includeTableFieldsParam ) ) ) ; return formFieldListing . getListing ( ) ; } catch ( JSONException e ) { throw new FluidClientException ( e . getMessage ( ) , e , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class UtilGlobal { /** * Utility method for creating camel - case - upper from { @ code inputParam }
 * @ param inputParam The input to convert .
 * @ return The converted value . */
public String toCamelUpperCase ( String inputParam ) { } }

implementation:
if ( inputParam == null ) { return null ; } if ( inputParam . isEmpty ( ) ) { return EMPTY ; } char [ ] original = inputParam . toCharArray ( ) ; StringBuilder titleCase = new StringBuilder ( Character . toString ( Character . toLowerCase ( original [ 0 ] ) ) ) ; boolean nextTitleCase = false ; for ( int index = 1 ; index < original . length ; index ++ ) { char c = original [ index ] ; if ( Character . isSpaceChar ( c ) ) { nextTitleCase = true ; continue ; } // Just add . . .
else if ( nextTitleCase ) { c = Character . toTitleCase ( c ) ; nextTitleCase = false ; } titleCase . append ( c ) ; } return titleCase . toString ( ) ;


signature:
public class UtilGlobal { /** * Extract and returns Latitude from { @ code textToCheckParam } applicable to
 * Fluid .
 * @ param textToCheckParam The Latitude and Longitude to extract Latitude from .
 * @ return Geo Latitude from { @ code textToCheckParam } . */
public String getLatitudeFromFluidText ( String textToCheckParam ) { } }

implementation: if ( textToCheckParam == null || textToCheckParam . isEmpty ( ) ) { return EMPTY ; } String [ ] latitudeAndLongitude = textToCheckParam . split ( REG_EX_PIPE ) ; if ( latitudeAndLongitude == null || latitudeAndLongitude . length < 2 ) { latitudeAndLongitude = textToCheckParam . split ( REG_EX_COMMA ) ; } if ( latitudeAndLongitude == null || latitudeAndLongitude . length == 0 ) { return ZERO ; } if ( latitudeAndLongitude . length > 1 ) { return toGoeSafe ( latitudeAndLongitude [ 0 ] ) ; } return ZERO ;


signature:
public class UtilGlobal { /** * Extract and returns Latitude from { @ code textToCheckParam }
 * applicable to ElasticSearch .
 * @ param textToCheckParam The Latitude and Longitude to extract Latitude from .
 * @ return Geo Latitude from { @ code textToCheckParam } . */
public double getLatitudeFromElasticSearchText ( String textToCheckParam ) { } }

implementation: if ( textToCheckParam == null || textToCheckParam . isEmpty ( ) ) { return 0.0 ; } String [ ] latitudeAndLongitude = textToCheckParam . split ( REG_EX_COMMA ) ; if ( latitudeAndLongitude == null || latitudeAndLongitude . length < 2 ) { latitudeAndLongitude = textToCheckParam . split ( REG_EX_PIPE ) ; } if ( latitudeAndLongitude == null || latitudeAndLongitude . length == 0 ) { return 0.0 ; } if ( latitudeAndLongitude . length > 1 ) { return toDoubleSafe ( latitudeAndLongitude [ 0 ] ) ; } return 0.0 ;


signature:
public class UtilGlobal { /** * Extract and returns Longitude from { @ code textToCheckParam }
 * applicable to ElasticSearch .
 * @ param textToCheckParam The Latitude and Longitude to extract Longitude from .
 * @ return Geo Longitude from { @ code textToCheckParam } . */
public double getLongitudeFromElasticSearchText ( String textToCheckParam ) { } }

implementation: if ( textToCheckParam == null || textToCheckParam . trim ( ) . isEmpty ( ) ) { return 0.0 ; } String [ ] latitudeAndLongitude = textToCheckParam . split ( REG_EX_COMMA ) ; if ( latitudeAndLongitude == null || latitudeAndLongitude . length < 2 ) { latitudeAndLongitude = textToCheckParam . split ( REG_EX_PIPE ) ; } if ( latitudeAndLongitude == null || latitudeAndLongitude . length == 0 ) { return 0.0 ; } if ( latitudeAndLongitude . length > 1 ) { return this . toDoubleSafe ( latitudeAndLongitude [ 1 ] ) ; } return 0.0 ;


signature:
public class UtilGlobal { /** * Convert the { @ code toParseParam } to a double .
 * @ param toParseParam The { @ code String } value to convert to { @ code double } .
 * @ return { @ code toParseParam } converted to a { @ code double } . */
public final double toDoubleSafe ( String toParseParam ) { } }

implementation: if ( toParseParam == null || toParseParam . trim ( ) . isEmpty ( ) ) { return 0D ; } try { return Double . parseDouble ( toParseParam ) ; } catch ( NumberFormatException e ) { return 0D ; }


signature:
public class UtilGlobal { /** * Convert the { @ code toParseParam } to a double .
 * @ param toParseParam The { @ code String } value to convert to { @ code double } .
 * @ return { @ code toParseParam } converted to a { @ code double } . */
public final String toGoeSafe ( String toParseParam ) { } }

implementation: if ( toParseParam == null || toParseParam . trim ( ) . isEmpty ( ) ) { return ZERO ; } try { for ( char charToCheck : toParseParam . toCharArray ( ) ) { if ( ! Character . isDigit ( charToCheck ) && '.' != charToCheck ) { return ZERO ; } } if ( toParseParam . length ( ) > 12 ) { return toParseParam . substring ( 0 , 12 ) ; } return toParseParam ; } catch ( NumberFormatException e ) { return ZERO ; }


signature:
public class UtilGlobal { /** * Decodes the { @ code base64StringParam } as { @ code byte [ ] } .
 * @ param base64StringParam String to convert to { @ code byte [ ] } .
 * @ return byte [ ] . */
public static byte [ ] decodeBase64 ( String base64StringParam ) { } }

implementation: if ( base64StringParam == null ) { return null ; } if ( base64StringParam . isEmpty ( ) ) { return new byte [ ] { } ; } return Base64 . getDecoder ( ) . decode ( base64StringParam ) ;


signature:
public class UtilGlobal { /** * Encodes the { @ code bytesParam } as { @ code java . lang . String } .
 * @ param bytesParam bytes to convert to Hex .
 * @ return Hex String in upper case . */
public static String encodeBase16 ( byte [ ] bytesParam ) { } }

implementation: if ( bytesParam == null ) { return null ; } if ( bytesParam . length == 0 ) { return UtilGlobal . EMPTY ; } return DatatypeConverter . printHexBinary ( bytesParam ) . toUpperCase ( ) ;


signature:
public class UtilGlobal { /** * Encodes the { @ code stringParam } as { @ code byte [ ] } .
 * @ param stringParam to convert to bytes .
 * @ return bytes from { @ code stringParam } . */
public static byte [ ] decodeBase16 ( String stringParam ) { } }

implementation: if ( stringParam == null ) { return null ; } if ( stringParam . trim ( ) . isEmpty ( ) ) { return new byte [ ] { } ; } int len = stringParam . length ( ) ; byte [ ] data = new byte [ len / 2 ] ; for ( int i = 0 ; i < len ; i += 2 ) { data [ i / 2 ] = ( byte ) ( ( Character . digit ( stringParam . charAt ( i ) , 16 ) << 4 ) + Character . digit ( stringParam . charAt ( i + 1 ) , 16 ) ) ; } return data ;


signature:
public class UtilGlobal { /** * Encodes the { @ code bytesParam } as { @ code java . lang . String } .
 * @ param bytesParam bytes to convert to Base64.
 * @ return Base64 String . */
public static String encodeBase64 ( byte [ ] bytesParam ) { } }

implementation: if ( bytesParam == null ) { return null ; } if ( bytesParam . length == 0 ) { return UtilGlobal . EMPTY ; } return Base64 . getEncoder ( ) . encodeToString ( bytesParam ) ;


signature:
public class UtilGlobal { /** * Sets the flat value on the { @ code objectToSetFieldOnParam } JSON object .
 * If the { @ code fieldToExtractFromParam } is not provided , nothing will be set .
 * If { @ code fieldNamePrefixParam } or { @ code fieldNameIdPrefixParam } is not set , an
 * { @ link NullPointerException } will be thrown .
 * @ param fieldNamePrefixParam The prefix field name .
 * @ param fieldNameIdPrefixParam The prefix field name for id .
 * @ param fieldToExtractFromParam The field to extract the value from .
 * @ param objectToSetFieldOnParam The JSON object to set the field value on .
 * @ see JSONObject
 * @ see Field */
public void setFlatFieldOnJSONObj ( String fieldNamePrefixParam , String fieldNameIdPrefixParam , Field fieldToExtractFromParam , JSONObject objectToSetFieldOnParam ) { } }

implementation:
if ( fieldToExtractFromParam == null ) { return ; } String fieldName = fieldToExtractFromParam . getFieldNameAsUpperCamel ( ) ; if ( fieldName == null || fieldName . trim ( ) . isEmpty ( ) ) { return ; } String completeFieldName = fieldNamePrefixParam . concat ( fieldName ) ; String completeFieldNameId = fieldNameIdPrefixParam . concat ( fieldName ) ; objectToSetFieldOnParam . put ( completeFieldNameId , fieldToExtractFromParam . getId ( ) ) ; Object fieldValue = fieldToExtractFromParam . getFieldValue ( ) ; if ( fieldValue == null ) { objectToSetFieldOnParam . put ( completeFieldName , JSONObject . NULL ) ; } // Table field . . .
else if ( fieldValue instanceof TableField ) { return ; } // Multiple Choice . . .
else if ( fieldValue instanceof MultiChoice ) { MultiChoice multiChoice = ( MultiChoice ) fieldValue ; // Nothing provided . . .
if ( multiChoice . getSelectedMultiChoices ( ) == null || multiChoice . getSelectedMultiChoices ( ) . isEmpty ( ) ) { objectToSetFieldOnParam . put ( completeFieldName , JSONObject . NULL ) ; return ; } StringBuilder builder = new StringBuilder ( ) ; multiChoice . getSelectedMultiChoices ( ) . forEach ( selectedChoice -> { builder . append ( selectedChoice ) ; builder . append ( ", " ) ; } ) ; String selectVal = builder . toString ( ) ; if ( selectVal != null && ! selectVal . trim ( ) . isEmpty ( ) ) { selectVal = selectVal . substring ( 0 , selectVal . length ( ) - 2 ) ; } objectToSetFieldOnParam . put ( completeFieldName , selectVal ) ; } // Other valid types . . .
else if ( ( fieldValue instanceof Number || fieldValue instanceof Boolean ) || fieldValue instanceof String ) { if ( ( fieldValue instanceof String ) && Field . LATITUDE_AND_LONGITUDE . equals ( fieldToExtractFromParam . getTypeMetaData ( ) ) ) { String formFieldValueStr = fieldValue . toString ( ) ; String latitudeTxt = this . getLatitudeFromFluidText ( formFieldValueStr ) ; String longitudeTxt = this . getLongitudeFromFluidText ( formFieldValueStr ) ; fieldValue = ( latitudeTxt . concat ( UtilGlobal . COMMA ) . concat ( longitudeTxt ) ) ; } objectToSetFieldOnParam . put ( completeFieldName , fieldValue ) ; } // Date . . .
else if ( fieldValue instanceof Date ) { objectToSetFieldOnParam . put ( completeFieldName , ( ( Date ) fieldValue ) . getTime ( ) ) ; }


signature:
public class AGenericListMessageHandler { /** * Checks whether { @ code this } message handler can process
 * the message { @ code messageParam }
 * @ param messageParam The message to check for qualification .
 * @ return The JSONObject .
 * @ see JSONObject */
public Object doesHandlerQualifyForProcessing ( String messageParam ) { } }

implementation:
JSONObject jsonObject = null ; try { jsonObject = new JSONObject ( messageParam ) ; } catch ( JSONException jsonExcept ) { throw new FluidClientException ( "Unable to parse [" + messageParam + "]. " + jsonExcept . getMessage ( ) , jsonExcept , FluidClientException . ErrorCode . JSON_PARSING ) ; } Error fluidError = new Error ( jsonObject ) ; if ( fluidError . getErrorCode ( ) > 0 ) { return fluidError ; } String echo = fluidError . getEcho ( ) ; // We can process the me
if ( this . expectedEchoMessagesBeforeComplete . contains ( echo ) ) { return jsonObject ; } return null ;


signature:
public class AGenericListMessageHandler { /** * ' Handles ' the message .
 * If there was an error , the object will be Error
 * If there was no error , the object will be JSONObject
 * @ param objectToProcess The message to handle in JSON format .
 * @ see Error
 * @ see JSONObject */
@ Override public void handleMessage ( Object objectToProcess ) { } }

implementation:
// There is an error . . .
if ( objectToProcess instanceof Error ) { Error fluidError = ( ( Error ) objectToProcess ) ; this . errors . add ( fluidError ) ; // Do a message callback . . .
if ( this . messageReceivedCallback != null ) { this . messageReceivedCallback . errorMessageReceived ( fluidError ) ; } // If complete future is provided . . .
if ( this . completableFuture != null ) { this . completableFuture . completeExceptionally ( new FluidClientException ( fluidError . getErrorMessage ( ) , fluidError . getErrorCode ( ) ) ) ; } } // No Error . . .
else { JSONObject jsonObject = ( JSONObject ) objectToProcess ; // Uncompress the compressed response . . .
if ( this . compressedResponse ) { CompressedResponse compressedResponse = new CompressedResponse ( jsonObject ) ; byte [ ] compressedJsonList = UtilGlobal . decodeBase64 ( compressedResponse . getDataBase64 ( ) ) ; byte [ ] uncompressedJson = null ; try { uncompressedJson = this . uncompress ( compressedJsonList ) ; } catch ( IOException eParam ) { throw new FluidClientException ( "I/O issue with uncompress. " + eParam . getMessage ( ) , eParam , FluidClientException . ErrorCode . IO_ERROR ) ; } jsonObject = new JSONObject ( new String ( uncompressedJson ) ) ; } T messageForm = this . getNewInstanceBy ( jsonObject ) ; // Add to the list of return values . . .
this . returnValue . add ( messageForm ) ; // Completable future is set , and all response messages received . . .
if ( this . completableFuture != null ) { String echo = messageForm . getEcho ( ) ; if ( echo != null && ! echo . trim ( ) . isEmpty ( ) ) { this . expectedEchoMessagesBeforeComplete . remove ( echo ) ; } // All expected messages received . . .
if ( this . expectedEchoMessagesBeforeComplete . isEmpty ( ) ) { this . completableFuture . complete ( this . returnValue ) ; } } // Do a message callback . . .
if ( this . messageReceivedCallback != null ) { this . messageReceivedCallback . messageReceived ( messageForm ) ; } }


signature:
public class AGenericListMessageHandler { /** * Event for when connection is closed . */
@ Override public void connectionClosed ( ) { } }

implementation:
this . isConnectionClosed = true ; if ( this . completableFuture != null ) { // If there was no error . . .
if ( this . getErrors ( ) . isEmpty ( ) ) { this . completableFuture . complete ( this . returnValue ) ; } // there was an error . . .
else { Error firstFluidError = this . getErrors ( ) . get ( 0 ) ; this . completableFuture . completeExceptionally ( new FluidClientException ( firstFluidError . getErrorMessage ( ) , firstFluidError . getErrorCode ( ) ) ) ; } }


signature:
public class AGenericListMessageHandler { /** * Adds the { @ code expectedMessageEchoParam } echo to expect as a
 * return value before the Web Socket operation may be regarded as complete .
 * @ param expectedMessageEchoParam The echo to expect . */
public void addExpectedMessage ( String expectedMessageEchoParam ) { } }

implementation: if ( expectedMessageEchoParam == null || expectedMessageEchoParam . trim ( ) . isEmpty ( ) ) { return ; } this . expectedEchoMessagesBeforeComplete . add ( expectedMessageEchoParam ) ;


signature:
public class AGenericListMessageHandler { /** * Gets a list of echo messages of the current return values .
 * @ return The return value echo messages . */
private List < String > getEchoMessagesFromReturnValue ( ) { } }

implementation:
List < String > returnListing = new ArrayList ( ) ; if ( this . returnValue == null ) { return returnListing ; } Iterator < T > iterForReturnVal = this . returnValue . iterator ( ) ; // Only add where the ECHO message is set . . .
while ( iterForReturnVal . hasNext ( ) ) { T returnVal = iterForReturnVal . next ( ) ; if ( returnVal . getEcho ( ) == null ) { continue ; } returnListing . add ( returnVal . getEcho ( ) ) ; } return returnListing ;


signature:
public class AGenericListMessageHandler { /** * Checks the local return value echo messages if all
 * of them contain { @ code echoMessageParam } .
 * @ param echoMessageParam The echo messages to check .
 * @ return Whether local return value echo messages contain { @ code echoMessageParam } . */
public boolean doReturnValueEchoMessageContainAll ( List < String > echoMessageParam ) { } }

implementation: if ( echoMessageParam == null || echoMessageParam . isEmpty ( ) ) { return false ; } List < String > allReturnValueEchoMessages = this . getEchoMessagesFromReturnValue ( ) ; for ( String toCheckFor : echoMessageParam ) { if ( ! allReturnValueEchoMessages . contains ( toCheckFor ) ) { return false ; } } return true ;


signature:
public class AGenericListMessageHandler { /** * Uncompress the raw { @ code compressedBytesParam } .
 * @ param compressedBytesParam The compressed bytes to uncompress .
 * @ return Uncompressed bytes .
 * @ throws IOException - If there is an issue during the un - compression . */
protected byte [ ] uncompress ( byte [ ] compressedBytesParam ) throws IOException { } }

implementation:
byte [ ] buffer = new byte [ 1024 ] ; byte [ ] returnVal = null ; ZipInputStream zis = null ; if ( CHARSET == null ) { zis = new ZipInputStream ( new ByteArrayInputStream ( compressedBytesParam ) ) ; } else { zis = new ZipInputStream ( new ByteArrayInputStream ( compressedBytesParam ) , CHARSET ) ; } // get the zip file content
ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; // get the zipped file list entry
ZipEntry ze = zis . getNextEntry ( ) ; if ( ze == null ) { return returnVal ; } int len ; while ( ( len = zis . read ( buffer ) ) > 0 ) { bos . write ( buffer , 0 , len ) ; } zis . closeEntry ( ) ; zis . close ( ) ; bos . flush ( ) ; bos . close ( ) ; returnVal = bos . toByteArray ( ) ; return returnVal ;


signature:
public class PersonalInventoryClient { /** * Retrieves all Personal Inventory items for the logged in user .
 * @ return The Personal Inventory items for the logged in { @ code User } . */
public List < FluidItem > getPersonalInventoryItems ( ) { } }

implementation:
User loggedInUser = new User ( ) ; if ( this . serviceTicket != null ) { loggedInUser . setServiceTicket ( this . serviceTicket ) ; } try { return new FluidItemListing ( this . postJson ( loggedInUser , WS . Path . PersonalInventory . Version1 . getAllByLoggedInUser ( ) ) ) . getListing ( ) ; } // rethrow as a Fluid Client exception .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class PersonalInventoryClient { /** * Remove the item { @ code formToRemoveParam } from the personal inventory .
 * @ param formToRemoveParam The { @ code Form } to remove from personal inventory .
 * @ return The Personal Inventory items removed for { @ code User } . */
public Form removeFromPersonalInventory ( Form formToRemoveParam ) { } }

implementation:
if ( formToRemoveParam != null && this . serviceTicket != null ) { formToRemoveParam . setServiceTicket ( this . serviceTicket ) ; } try { return new Form ( this . postJson ( formToRemoveParam , WS . Path . PersonalInventory . Version1 . removeFromPersonalInventory ( ) ) ) ; } // rethrow as a Fluid Client exception .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class AppRequestToken { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code AppRequestToken }
 * @ 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 ( ) ; // Encrypted Data Base 64 . . .
if ( this . getEncryptedDataBase64 ( ) != null ) { returnVal . put ( JSONMapping . ENCRYPTED_DATA_BASE_64 , this . getEncryptedDataBase64 ( ) ) ; } // Encrypted Data HMAC Base 64 . . .
if ( this . getEncryptedDataHmacBase64 ( ) != null ) { returnVal . put ( JSONMapping . ENCRYPTED_DATA_HMAC_BASE_64 , this . getEncryptedDataHmacBase64 ( ) ) ; } // IV Base 64 . . .
if ( this . getIvBase64 ( ) != null ) { returnVal . put ( JSONMapping . IV_BASE_64 , this . getIvBase64 ( ) ) ; } // Seed Base 64 . . .
if ( this . getSeedBase64 ( ) != null ) { returnVal . put ( JSONMapping . SEED_BASE_64 , this . getSeedBase64 ( ) ) ; } // Service Ticket Base 64 . . .
if ( this . getServiceTicket ( ) != null ) { returnVal . put ( ABaseFluidJSONObject . JSONMapping . SERVICE_TICKET , this . getServiceTicket ( ) ) ; } // Salt . . .
if ( this . getSalt ( ) != null ) { returnVal . put ( JSONMapping . SALT , this . getSalt ( ) ) ; } // Principal Client . . .
if ( this . getPrincipalClient ( ) != null ) { returnVal . put ( JSONMapping . PRINCIPAL_CLIENT , this . getPrincipalClient ( ) ) ; } // Role String . . .
if ( this . getRoleString ( ) != null ) { returnVal . put ( JSONMapping . ROLE_STRING , this . getRoleString ( ) ) ; } // Timestamp . . .
if ( this . getTimestamp ( ) != null ) { returnVal . put ( JSONMapping . TIMESTAMP , this . getTimestamp ( ) ) ; } return returnVal ;


signature:
public class FormContainerClient { /** * Create a new Form Container / Electronic Forms .
 * @ param formParam The Form to create .
 * @ return Created Form Container / Electronic Form .
 * @ see Field */
public Form createFormContainer ( Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . putJson ( formParam , WS . Path . FormContainer . Version1 . formContainerCreate ( ) ) ) ;


signature:
public class FormContainerClient { /** * Create a new Table Record .
 * @ param tableRecordParam The Table Record to create .
 * @ return Created Table Record .
 * @ see TableRecord */
public TableRecord createTableRecord ( TableRecord tableRecordParam ) { } }

implementation: if ( tableRecordParam != null && this . serviceTicket != null ) { tableRecordParam . setServiceTicket ( this . serviceTicket ) ; } return new TableRecord ( this . putJson ( tableRecordParam , WS . Path . FormContainerTableRecord . Version1 . formContainerTableRecordCreate ( ) ) ) ;


signature:
public class FormContainerClient { /** * Update a Form Container / Electronic Form .
 * The table record forms may also be updated with
 * @ param formParam The Form to update .
 * @ return Updated Form Container / Electronic Form .
 * @ see Field
 * @ see TableRecord
 * @ see Form */
public Form updateFormContainer ( Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( formParam , WS . Path . FormContainer . Version1 . formContainerUpdate ( ) ) ) ;


signature:
public class FormContainerClient { /** * Execute the Custom Program with action alias { @ code customWebActionParam } .
 * This method may be used for Form and Table Records .
 * @ param customWebActionParam The custom web action name . Action identifier .
 * @ param formParam The Form to send for 3rd Party execution .
 * @ return Result after the 3rd Party Custom Web Action completed .
 * @ see Field
 * @ see Form
 * @ see com . fluidbpm . program . api . vo . thirdpartylib . ThirdPartyLibrary */
public Form executeCustomWebAction ( String customWebActionParam , Form formParam ) { } }

implementation: return this . executeCustomWebAction ( customWebActionParam , false , null , formParam ) ;


signature:
public class FormContainerClient { /** * Execute the Custom Program with action alias { @ code customWebActionParam } .
 * This method may be used for Form and Table Records .
 * @ param customWebActionParam The custom web action name . Action identifier .
 * @ param isTableRecordParam Is the form a table record form .
 * @ param formContainerTableRecordBelowsToParam The parent form container if table record .
 * @ param formParam The Form to send for 3rd Party execution .
 * @ return Result after the 3rd Party Custom Web Action completed .
 * @ see Field
 * @ see Form
 * @ see TableRecord
 * @ see com . fluidbpm . program . api . vo . thirdpartylib . ThirdPartyLibrary */
public Form executeCustomWebAction ( String customWebActionParam , boolean isTableRecordParam , Long formContainerTableRecordBelowsToParam , Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } if ( customWebActionParam == null || customWebActionParam . trim ( ) . isEmpty ( ) ) { throw new FluidClientException ( "Custom Web Action is mandatory." , FluidClientException . ErrorCode . FIELD_VALIDATE ) ; } try { return new Form ( this . postJson ( formParam , WS . Path . FormContainer . Version1 . executeCustomWebAction ( customWebActionParam , isTableRecordParam , formContainerTableRecordBelowsToParam ) ) ) ; } catch ( UnsupportedEncodingException unsEncExcept ) { throw new FluidClientException ( unsEncExcept . getMessage ( ) , unsEncExcept , FluidClientException . ErrorCode . IO_ERROR ) ; }


signature:
public class FormContainerClient { /** * Deletes the Form Container provided .
 * Id must be set on the Form Container .
 * @ param formContainerParam The Form Container to Delete .
 * @ return The deleted Form Container . */
public Form deleteFormContainer ( Form formContainerParam ) { } }

implementation: if ( formContainerParam != null && this . serviceTicket != null ) { formContainerParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( formContainerParam , WS . Path . FormContainer . Version1 . formContainerDelete ( ) ) ) ;


signature:
public class FormContainerClient { /** * Retrieves Electronic Form Workflow historic information .
 * The Form Id must be provided .
 * @ param formParam The form to retrieve historic data for .
 * @ return Electronic Form Workflow historic data . */
public List < FormFlowHistoricData > getFormFlowHistoricData ( Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new FormFlowHistoricDataListing ( this . postJson ( formParam , WS . Path . FlowItemHistory . Version1 . getByFormContainer ( ) ) ) . getListing ( ) ;


signature:
public class FormContainerClient { /** * Retrieves Electronic Form and Field historic information .
 * The Form Id must be provided .
 * @ param includeCurrentParam Whether the current values should be included .
 * @ param formParam The form to retrieve historic data for .
 * @ return Electronic Form and Field historic data . */
public List < FormHistoricData > getFormAndFieldHistoricData ( Form formParam , boolean includeCurrentParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new FormHistoricDataListing ( this . postJson ( formParam , WS . Path . FormHistory . Version1 . getByFormContainer ( includeCurrentParam ) ) ) . getListing ( ) ;


signature:
public class FormContainerClient { /** * Retrieves Electronic Form and Field historic information for
 * the most recent modification .
 * The Form Id must be provided .
 * @ param formParam The form to retrieve historic data for .
 * @ return Electronic Form and Field historic data . */
public FormHistoricData getMostRecentFormAndFieldHistoricData ( Form formParam ) { } }

implementation: if ( formParam != null && this . serviceTicket != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } return new FormHistoricData ( this . postJson ( formParam , WS . Path . FormHistory . Version1 . getByMostRecentByFormContainer ( ) ) ) ;


signature:
public class FormContainerClient { /** * Retrieves the Form Container by Primary key .
 * @ param formContainerIdParam The Form Container primary key .
 * @ return Form by Primary key . */
public Form getFormContainerById ( Long formContainerIdParam ) { } }

implementation: Form form = new Form ( formContainerIdParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( form , WS . Path . FormContainer . Version1 . getById ( ) ) ) ;


signature:
public class FormContainerClient { /** * Lock the provided form container for logged in user .
 * @ param formParam The form to lock .
 * @ param jobViewParam If retrieved from a view , the lock to view from .
 * @ return The locked form . */
public Form lockFormContainer ( Form formParam , JobView jobViewParam ) { } }

implementation: return this . lockFormContainer ( formParam , jobViewParam , null ) ;


signature:
public class FormContainerClient { /** * Lock the provided form container for logged in user .
 * If { @ code userToLockAsParam } is provided and valid , that user will be used instead .
 * @ param formParam The form to lock .
 * @ param jobViewParam If retrieved from a view , the lock to view from .
 * @ param userToLockAsParam The form will be locked as this user .
 * The logged in user must have permission to perform this action .
 * @ return The locked form . */
public Form lockFormContainer ( Form formParam , JobView jobViewParam , User userToLockAsParam ) { } }

implementation:
if ( this . serviceTicket != null && formParam != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } Long jobViewId = ( jobViewParam == null ) ? null : jobViewParam . getId ( ) ; Long lockAsUserId = ( userToLockAsParam == null ) ? null : userToLockAsParam . getId ( ) ; try { return new Form ( this . postJson ( formParam , WS . Path . FormContainer . Version1 . lockFormContainer ( jobViewId , lockAsUserId ) ) ) ; } // rethrow as a Fluid Client exception .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class FormContainerClient { /** * Unlock the provided form container from the logged in user .
 * Item will not be removed from users Personal Inventory .
 * @ param formParam The form to unlock .
 * @ param unlockAsyncParam Should the unlock be performed asynchronous .
 * @ return The un - locked form . */
public Form unLockFormContainer ( Form formParam , boolean unlockAsyncParam ) { } }

implementation: return this . unLockFormContainer ( formParam , null , unlockAsyncParam , false ) ;


signature:
public class FormContainerClient { /** * Unlock the provided form container from the logged in user .
 * The unlock will be performed asynchronous .
 * Item will not be removed from users Personal Inventory .
 * @ param formParam The form to unlock .
 * @ param userToUnLockAsParam The form will be un - locked as this user .
 * The logged in user must have permission to perform this action .
 * @ return The un - locked form . */
public Form unLockFormContainer ( Form formParam , User userToUnLockAsParam ) { } }

implementation: return this . unLockFormContainer ( formParam , userToUnLockAsParam , true , false ) ;


signature:
public class FormContainerClient { /** * Unlock the provided form container from the logged in user .
 * The unlock will be performed asynchronous .
 * Item will not be removed from users Personal Inventory .
 * @ param formParam The form to unlock .
 * @ param userToUnLockAsParam The form will be un - locked as this user .
 * The logged in user must have permission to perform this action .
 * @ param unlockAsyncParam Should the unlock be performed asynchronous .
 * @ return The un - locked form . */
public Form unLockFormContainer ( Form formParam , User userToUnLockAsParam , boolean unlockAsyncParam ) { } }

implementation: return this . unLockFormContainer ( formParam , userToUnLockAsParam , unlockAsyncParam , false ) ;


signature:
public class FormContainerClient { /** * Unlock the provided form container from the logged in user .
 * @ param formParam The form to unlock .
 * @ param userToUnLockAsParam The form will be un - locked as this user .
 * The logged in user must have permission to perform this action .
 * @ param unlockAsyncParam Should the unlock be performed asynchronous .
 * @ param removeFromPersonalInventoryParam Remove from Personal Inventory when unlocked .
 * @ return The un - locked form . */
public Form unLockFormContainer ( Form formParam , User userToUnLockAsParam , boolean unlockAsyncParam , boolean removeFromPersonalInventoryParam ) { } }

implementation:
if ( this . serviceTicket != null && formParam != null ) { formParam . setServiceTicket ( this . serviceTicket ) ; } Long unLockAsUserId = ( userToUnLockAsParam == null ) ? null : userToUnLockAsParam . getId ( ) ; try { return new Form ( this . postJson ( formParam , WS . Path . FormContainer . Version1 . unLockFormContainer ( unLockAsUserId , unlockAsyncParam , removeFromPersonalInventoryParam ) ) ) ; } // rethrow as a Fluid Client exception .
catch ( JSONException jsonExcept ) { throw new FluidClientException ( jsonExcept . getMessage ( ) , FluidClientException . ErrorCode . JSON_PARSING ) ; }


signature:
public class SQLFormUtil { /** * Retrieves the Table field records as { @ code List < Form > } .
 * @ param electronicFormIdParam The Form Identifier .
 * @ param includeFieldDataParam Whether to populate the return { @ code List < Form > } fields .
 * @ return { @ code List < Form > } records . */
public List < Form > getFormTableForms ( Long electronicFormIdParam , boolean includeFieldDataParam ) { } }

implementation:
List < Form > returnVal = new ArrayList ( ) ; if ( electronicFormIdParam == null ) { return returnVal ; } Map < Long , String > definitionAndTitle = this . formDefUtil . getFormDefinitionIdAndTitle ( ) ; PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Form . GetFormContainersTableFieldFormContainers ) ; 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 . mapFormContainerTo ( definitionAndTitle , resultSet ) ) ; } // When field data must also be included . . .
if ( includeFieldDataParam ) { for ( Form form : returnVal ) { List < Field > formFields = this . fieldUtil . getFormFields ( form . getId ( ) , false , false ) ; form . setFormFields ( formFields ) ; } } } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement , resultSet ) ; } return returnVal ;


signature:
public class SQLFormUtil { /** * Gets the descendants for the { @ code electronicFormIdsParam } Forms .
 * @ param electronicFormIdsParam Identifiers for the Forms to retrieve .
 * @ param includeFieldDataParam Whether to populate the return { @ code List < Form > } fields .
 * @ param includeTableFieldsParam Whether to populate the return { @ code List < Form > } table fields .
 * @ param includeTableFieldFormRecordInfoParam Does table record form data need to be included .
 * @ return { @ code List < Form > } descendants .
 * @ see Form */
@ Override public List < Form > getFormDescendants ( List < Long > electronicFormIdsParam , boolean includeFieldDataParam , boolean includeTableFieldsParam , boolean includeTableFieldFormRecordInfoParam ) { } }

implementation: if ( electronicFormIdsParam == null || electronicFormIdsParam . isEmpty ( ) ) { return null ; } List < Form > returnVal = new ArrayList ( ) ; for ( Long electronicFormId : electronicFormIdsParam ) { List < Form > forTheCycle = this . getFormDescendants ( electronicFormId , includeFieldDataParam , includeTableFieldsParam , includeTableFieldFormRecordInfoParam ) ; if ( forTheCycle == null ) { continue ; } returnVal . addAll ( forTheCycle ) ; } return returnVal ;


signature:
public class SQLFormUtil { /** * Gets the ancestor for the { @ code electronicFormIdParam } Form .
 * @ param electronicFormIdParam Identifier for the Form .
 * @ param includeFieldDataParam Whether to populate the return { @ code Form } fields .
 * @ param includeTableFieldsParam Whether to populate the return { @ code Form } table fields .
 * @ return { @ code Form } descendants .
 * @ see Form */
public Form getFormAncestor ( Long electronicFormIdParam , boolean includeFieldDataParam , boolean includeTableFieldsParam ) { } }

implementation:
if ( electronicFormIdParam == null ) { return null ; } Form returnVal = null ; Map < Long , String > definitionAndTitle = this . formDefUtil . getFormDefinitionIdAndTitle ( ) ; PreparedStatement preparedStatement = null ; ResultSet resultSet = null ; try { ISyntax syntax = SyntaxFactory . getInstance ( ) . getSyntaxFor ( this . getSQLTypeFromConnection ( ) , ISyntax . ProcedureMapping . Form . GetFormContainersParentFormContainer ) ; preparedStatement = this . getConnection ( ) . prepareStatement ( syntax . getPreparedStatement ( ) ) ; preparedStatement . setLong ( 1 , electronicFormIdParam ) ; resultSet = preparedStatement . executeQuery ( ) ; // Iterate each of the form containers . . .
if ( resultSet . next ( ) ) { returnVal = this . mapFormContainerTo ( definitionAndTitle , resultSet ) ; } // When field data must also be included . . .
if ( includeFieldDataParam && returnVal != null ) { returnVal . setFormFields ( this . fieldUtil . getFormFields ( returnVal . getId ( ) , includeTableFieldsParam , false ) ) ; } return returnVal ; } catch ( SQLException sqlError ) { throw new FluidSQLException ( sqlError ) ; } finally { this . closeStatement ( preparedStatement , resultSet ) ; }


signature:
public class SQLFormUtil { /** * Maps the Form to the provided Definition - Id and Title .
 * @ param definitionAndTitleParam Form Definition Id and Title mapping .
 * @ param resultSetParam Result Set used to populate { @ code Form } with .
 * @ return Form
 * @ throws SQLException If no mapping exists for Form Type .
 * @ see ResultSet */
private Form mapFormContainerTo ( Map < Long , String > definitionAndTitleParam , ResultSet resultSetParam ) throws SQLException { } }

implementation:
Long formId = resultSetParam . getLong ( SQLColumnIndex . _01_FORM_ID ) ; String formType = definitionAndTitleParam . get ( resultSetParam . getLong ( SQLColumnIndex . _02_FORM_TYPE ) ) ; String title = resultSetParam . getString ( SQLColumnIndex . _03_TITLE ) ; Date created = resultSetParam . getDate ( SQLColumnIndex . _04_CREATED ) ; Date lastUpdated = resultSetParam . getDate ( SQLColumnIndex . _05_LAST_UPDATED ) ; Long currentUserId = resultSetParam . getLong ( SQLColumnIndex . _06_CURRENT_USER_ID ) ; if ( formType == null ) { throw new SQLException ( "No mapping found for Form Type '" + resultSetParam . getLong ( SQLColumnIndex . _02_FORM_TYPE ) + "'." ) ; } Form toAdd = new Form ( formType ) ; toAdd . setId ( formId ) ; toAdd . setTitle ( title ) ; // Created . . .
if ( created != null ) { toAdd . setDateCreated ( new Date ( created . getTime ( ) ) ) ; } // Last Updated . . .
if ( lastUpdated != null ) { toAdd . setDateLastUpdated ( new Date ( lastUpdated . getTime ( ) ) ) ; } // Current User . . .
if ( currentUserId != null && currentUserId . longValue ( ) > 0 ) { User currentUser = new User ( ) ; currentUser . setId ( currentUserId ) ; toAdd . setCurrentUser ( currentUser ) ; } return toAdd ;


signature:
public class SQLFormUtil { /** * Maps the Form states with the { @ code resultSetParam } .
 * @ param resultSetParam Result Set used to populate { @ code Form } with .
 * @ return Form
 * @ throws SQLException If no mapping exists for Form Type .
 * @ see ResultSet */
private void mapFormContainerStatesTo ( Form previousMappedForm , ResultSet resultSetParam ) throws SQLException { } }

implementation:
if ( previousMappedForm == null ) { return ; } // Form Container State . . .
Long formContainerState = resultSetParam . getLong ( SQLColumnIndex . _07_FORM_CONTAINER_STATE ) ; long formContStateId = ( formContainerState == null ) ? 0 : formContainerState . longValue ( ) ; if ( formContStateId > 0 ) { if ( formContStateId == 1 ) { previousMappedForm . setState ( Form . State . OPEN ) ; } else if ( formContStateId == 2 ) { previousMappedForm . setState ( Form . State . LOCKED ) ; } } Long formContainerFlowState = resultSetParam . getLong ( SQLColumnIndex . _08_FORM_CONTAINER_FLOW_STATE ) ; long formContFlowStateId = ( formContainerFlowState == null ) ? 0 : formContainerFlowState . longValue ( ) ; if ( formContFlowStateId > 0 ) { if ( formContFlowStateId == 1 ) { previousMappedForm . setFlowState ( FluidItem . FlowState . NotInFlow . name ( ) ) ; } else if ( formContFlowStateId == 2 ) { previousMappedForm . setFlowState ( FluidItem . FlowState . WorkInProgress . name ( ) ) ; } else if ( formContFlowStateId == 3 ) { previousMappedForm . setFlowState ( FluidItem . FlowState . UserSend . name ( ) ) ; } else if ( formContFlowStateId == 4 ) { previousMappedForm . setFlowState ( FluidItem . FlowState . UserSendWorkInProgress . name ( ) ) ; } else if ( formContFlowStateId == 5 ) { previousMappedForm . setFlowState ( FluidItem . FlowState . Archive . name ( ) ) ; } }


signature:
public class Role { /** * Convert the comma separated list of roles as objects .
 * @ param roleListingParam The comma separated role listing .
 * Example ; { @ code " Admin , Super Admin , HR , Finance " }
 * @ return The { @ code roleListingParam } as { @ code Role } objects . */
@ XmlTransient public static List < Role > convertToObjects ( String roleListingParam ) { } }

implementation: if ( roleListingParam == null || roleListingParam . trim ( ) . isEmpty ( ) ) { return null ; } String [ ] listOfRoles = roleListingParam . split ( UtilGlobal . REG_EX_COMMA ) ; List < Role > returnVal = new ArrayList < > ( ) ; for ( String roleName : listOfRoles ) { Role roleToAdd = new Role ( ) ; roleToAdd . setName ( roleName . trim ( ) ) ; returnVal . add ( roleToAdd ) ; } return returnVal ;


signature:
public class Role { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code Role }
 * @ 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 . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Description . . .
if ( this . getDescription ( ) != null ) { returnVal . put ( JSONMapping . DESCRIPTION , this . getDescription ( ) ) ; } // Admin Permissions . . .
if ( this . getAdminPermissions ( ) != null && ! this . getAdminPermissions ( ) . isEmpty ( ) ) { JSONArray adminPerArr = new JSONArray ( ) ; for ( String toAdd : this . getAdminPermissions ( ) ) { adminPerArr . put ( toAdd ) ; } returnVal . put ( JSONMapping . ADMIN_PERMISSIONS , adminPerArr ) ; } // Role to Form Definitions . . .
if ( this . getRoleToFormDefinitions ( ) != null && ! this . getRoleToFormDefinitions ( ) . isEmpty ( ) ) { JSONArray roleToFormDefArr = new JSONArray ( ) ; for ( RoleToFormDefinition toAdd : this . getRoleToFormDefinitions ( ) ) { roleToFormDefArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROLE_TO_FORM_DEFINITIONS , roleToFormDefArr ) ; } // Role To Form Field To Form Definition . . .
if ( this . getRoleToFormFieldToFormDefinitions ( ) != null && ! this . getRoleToFormFieldToFormDefinitions ( ) . isEmpty ( ) ) { JSONArray roleToJobViewArr = new JSONArray ( ) ; for ( RoleToFormFieldToFormDefinition toAdd : this . getRoleToFormFieldToFormDefinitions ( ) ) { roleToJobViewArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROLE_TO_FORM_FIELD_TO_FORM_DEFINITIONS , roleToJobViewArr ) ; } // Role to Job Views . . .
if ( this . getRoleToJobViews ( ) != null && ! this . getRoleToJobViews ( ) . isEmpty ( ) ) { JSONArray roleToJobViewArr = new JSONArray ( ) ; for ( RoleToJobView toAdd : this . getRoleToJobViews ( ) ) { roleToJobViewArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROLE_TO_JOB_VIEWS , roleToJobViewArr ) ; } // Role to User Queries . . .
if ( this . getRoleToUserQueries ( ) != null && ! this . getRoleToUserQueries ( ) . isEmpty ( ) ) { JSONArray userQueriesArr = new JSONArray ( ) ; for ( RoleToUserQuery toAdd : this . getRoleToUserQueries ( ) ) { userQueriesArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROLE_TO_USER_QUERIES , userQueriesArr ) ; } return returnVal ;


signature:
public class FormDefinitionClient { /** * Creates a new Form Definition with the Fields inside the definition .
 * @ param formDefinitionParam The Definition to create .
 * @ return The Created Form Definition .
 * @ see Field
 * @ see Form */
public Form createFormDefinition ( Form formDefinitionParam ) { } }

implementation: if ( formDefinitionParam != null && this . serviceTicket != null ) { formDefinitionParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . putJson ( formDefinitionParam , WS . Path . FormDefinition . Version1 . formDefinitionCreate ( ) ) ) ;


signature:
public class FormDefinitionClient { /** * Updates an existing Form Definition with the Fields inside the definition .
 * @ param formDefinitionParam The Definition to update .
 * @ return The Updated Form Definition .
 * @ see Field
 * @ see Form */
public Form updateFormDefinition ( Form formDefinitionParam ) { } }

implementation: if ( formDefinitionParam != null && this . serviceTicket != null ) { formDefinitionParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( formDefinitionParam , WS . Path . FormDefinition . Version1 . formDefinitionUpdate ( ) ) ) ;


signature:
public class FormDefinitionClient { /** * Retrieves the Form Definition by Primary key .
 * @ param formDefinitionIdParam The Form Definition primary key .
 * @ return Form by Primary key . */
public Form getFormDefinitionById ( Long formDefinitionIdParam ) { } }

implementation: Form form = new Form ( formDefinitionIdParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( form , WS . Path . FormDefinition . Version1 . getById ( ) ) ) ;


signature:
public class FormDefinitionClient { /** * Retrieves the Form Definition by Name .
 * @ param formDefinitionNameParam The Form Definition name .
 * @ return Form by Name . */
public Form getFormDefinitionByName ( String formDefinitionNameParam ) { } }

implementation: Form form = new Form ( formDefinitionNameParam ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( form , WS . Path . FormDefinition . Version1 . getByName ( ) ) ) ;


signature:
public class FormDefinitionClient { /** * Retrieves all Form Definitions by logged in user .
 * @ param includeTableRecordTypesParam Include the Table Record form definitions .
 * @ return List of Form Definitions . */
public List < Form > getAllByLoggedInUser ( boolean includeTableRecordTypesParam ) { } }

implementation: Form form = new Form ( ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } if ( includeTableRecordTypesParam ) { return new FormListing ( this . postJson ( form , WS . Path . FormDefinition . Version1 . getAllByLoggedInUserIncludeTableTypes ( ) ) ) . getListing ( ) ; } else { return new FormListing ( this . postJson ( form , WS . Path . FormDefinition . Version1 . getAllByLoggedInUser ( ) ) ) . getListing ( ) ; }


signature:
public class FormDefinitionClient { /** * Retrieves all Form Definitions where the logged in user can
 * create a new instance of the { @ code Form } .
 * @ return List of Form Definitions . */
public List < Form > getAllByLoggedInUserWhereCanCreateInstanceOf ( ) { } }

implementation: Form form = new Form ( ) ; if ( this . serviceTicket != null ) { form . setServiceTicket ( this . serviceTicket ) ; } return new FormListing ( this . postJson ( form , WS . Path . FormDefinition . Version1 . getAllByLoggedInAndCanCreateInstanceOf ( ) ) ) . getListing ( ) ;


signature:
public class FormDefinitionClient { /** * Deletes the Form Definition provided .
 * Id must be set on the Form Definition .
 * @ param formDefinitionParam The Form Definition to Delete .
 * @ return The deleted Form Definition . */
public Form deleteFormDefinition ( Form formDefinitionParam ) { } }

implementation: if ( formDefinitionParam != null && this . serviceTicket != null ) { formDefinitionParam . setServiceTicket ( this . serviceTicket ) ; } return new Form ( this . postJson ( formDefinitionParam , WS . Path . FormDefinition . Version1 . formDefinitionDelete ( ) ) ) ;


signature:
public class CacheUtil { /** * Retrieves the { @ code CachedFieldValue } value stored under
 * the params .
 * @ param formDefIdParam The Form Definition Id .
 * @ param formContIdParam The Form Container Id .
 * @ param formFieldIdParam The Form Field Id .
 * @ return Storage Key */
public CachedFieldValue getCachedFieldValueFrom ( Long formDefIdParam , Long formContIdParam , Long formFieldIdParam ) { } }

implementation:
if ( ( formDefIdParam == null || formContIdParam == null ) || formFieldIdParam == null ) { return null ; } String storageKey = this . getStorageKeyFrom ( formDefIdParam , formContIdParam , formFieldIdParam ) ; Object objWithKey ; try { objWithKey = this . memcachedClient . get ( storageKey ) ; } // Changed for Java 1.6 compatibility . . .
catch ( MemcachedException e ) { throw new FluidCacheException ( "Unable to get Field value for '" + storageKey + "'." + "Contact administrator. " + e . getMessage ( ) , e ) ; } catch ( TimeoutException e ) { throw new FluidCacheException ( "Unable to get Field value for '" + storageKey + "'." + "Contact administrator. " + e . getMessage ( ) , e ) ; } catch ( InterruptedException e ) { throw new FluidCacheException ( "Unable to get Field value for '" + storageKey + "'." + "Contact administrator. " + e . getMessage ( ) , e ) ; } return this . getCacheFieldValueFromObject ( objWithKey ) ;


signature:
public class CacheUtil { /** * Converts the { @ code objWithKeyParam } Object to { @ code CachedFieldValue } .
 * @ param objWithKeyParam The retrieved cached object .
 * @ return CachedFieldValue from { @ code objWithKeyParam } . */
@ SuppressWarnings ( "unchecked" ) private CachedFieldValue getCacheFieldValueFromObject ( Object objWithKeyParam ) { } }

implementation:
if ( objWithKeyParam == null ) { return null ; } // Get Word . . .
Method methodGetWord = CacheUtil . getMethod ( objWithKeyParam . getClass ( ) , CustomCode . IWord . METHOD_getWord ) ; // Get Value . . .
Method methodGetValue = CacheUtil . getMethod ( objWithKeyParam . getClass ( ) , CustomCode . ADataType . METHOD_getValue ) ; // Word . . .
Object getWordObj = CacheUtil . invoke ( methodGetWord , objWithKeyParam ) ; String getWordVal = null ; if ( getWordObj instanceof String ) { getWordVal = ( String ) getWordObj ; } // Value . . .
Object getValueObj ; if ( FlowJobType . MULTIPLE_CHOICE . equals ( getWordVal ) ) { MultiChoice multiChoice = new MultiChoice ( ) ; // Available Choices . . .
Method methodAvailableChoices = getMethod ( objWithKeyParam . getClass ( ) , CustomCode . MultipleChoice . METHOD_getAvailableChoices ) ; Object availChoicesObj = CacheUtil . invoke ( methodAvailableChoices , objWithKeyParam ) ; if ( availChoicesObj instanceof List ) { multiChoice . setAvailableMultiChoices ( ( List ) availChoicesObj ) ; } // Selected . . .
Method methodSelectedChoices = getMethod ( objWithKeyParam . getClass ( ) , CustomCode . MultipleChoice . METHOD_getSelectedChoices ) ; Object selectedChoicesObj = invoke ( methodSelectedChoices , objWithKeyParam ) ; if ( selectedChoicesObj instanceof List ) { multiChoice . setSelectedMultiChoices ( ( List ) selectedChoicesObj ) ; } getValueObj = multiChoice ; } else { getValueObj = CacheUtil . invoke ( methodGetValue , objWithKeyParam ) ; } if ( getValueObj == null ) { return null ; } if ( getWordVal == null ) { throw new FluidCacheException ( "Get Word value is 'null'. Not allowed." ) ; } CachedFieldValue returnVal = new CachedFieldValue ( ) ; returnVal . dataType = getWordVal ; returnVal . cachedFieldValue = getValueObj ; return returnVal ;


signature:
public class CacheUtil { /** * Retrieves the java method from class { @ code clazzParam } .
 * @ param clazzParam The class .
 * @ param nameParam The class name .
 * @ return Method from { @ code clazzParam } and { @ code nameParam } . */
@ SuppressWarnings ( "unchecked" ) private static Method getMethod ( Class clazzParam , String nameParam ) { } }

implementation: try { if ( clazzParam == null || nameParam == null ) { return null ; } Method returnVal = clazzParam . getDeclaredMethod ( nameParam ) ; returnVal . setAccessible ( true ) ; return returnVal ; } catch ( NoSuchMethodException e ) { throw new FluidCacheException ( "Unable to get method '" + nameParam + "'. " + e . getMessage ( ) , e ) ; }


signature:
public class CacheUtil { /** * Invokes the { @ code methodParam } method on { @ code objParam } .
 * @ param methodParam The method to invoke .
 * @ param objParam The object to invoke the method on .
 * @ return The result of the invoked object . */
private static Object invoke ( Method methodParam , Object objParam ) { } }

implementation:
try { return methodParam . invoke ( objParam ) ; } // Changed for Java 1.6 compatibility . . .
catch ( InvocationTargetException e ) { throw new FluidCacheException ( "Unable to invoke method '" + methodParam . getName ( ) + "'. " + e . getMessage ( ) , e ) ; } catch ( IllegalAccessException e ) { throw new FluidCacheException ( "Unable to invoke method '" + methodParam . getName ( ) + "'. " + e . getMessage ( ) , e ) ; } catch ( IllegalArgumentException e ) { throw new FluidCacheException ( "Unable to invoke method '" + methodParam . getName ( ) + "'. " + e . getMessage ( ) , e ) ; }


signature:
public class CacheUtil { /** * Generates the storage key the provided parameters .
 * @ param formDefIdParam The Form Definition Id .
 * @ param formContIdParam The Form Container Id .
 * @ param formFieldIdParam The Form Field Id .
 * @ return Storage Key */
private String getStorageKeyFrom ( Long formDefIdParam , Long formContIdParam , Long formFieldIdParam ) { } }

implementation:
StringBuilder stringBuff = new StringBuilder ( ) ; // Form Definition . . .
if ( formDefIdParam == null ) { stringBuff . append ( NULL ) ; } else { stringBuff . append ( formDefIdParam . toString ( ) ) ; } stringBuff . append ( DASH ) ; // Form Container . . .
if ( formContIdParam == null ) { stringBuff . append ( NULL ) ; } else { stringBuff . append ( formContIdParam . toString ( ) ) ; } stringBuff . append ( DASH ) ; // Form Field . . .
if ( formFieldIdParam == null ) { stringBuff . append ( NULL ) ; } else { stringBuff . append ( formFieldIdParam . toString ( ) ) ; } return stringBuff . toString ( ) ;


signature:
public class CacheUtil { /** * Creates an instance of MemcachedClient .
 * @ return MemcachedClient */
private MemcachedClient initXMemcachedClient ( ) { } }

implementation:
if ( this . memcachedClient != null && ! this . memcachedClient . isShutdown ( ) ) { return this . memcachedClient ; } try { this . memcachedClient = new XMemcachedClient ( this . cacheHost , this . cachePort ) ; return this . memcachedClient ; } // Unable to create client with connection .
catch ( IOException e ) { throw new FluidCacheException ( "Unable to create MemCache client. " + e . getMessage ( ) , e ) ; }


signature:
public class CacheUtil { /** * Closes the Memcached client connection . */
public void shutdown ( ) { } }

implementation: if ( this . memcachedClient != null && ! this . memcachedClient . isShutdown ( ) ) { try { this . memcachedClient . shutdown ( ) ; } catch ( IOException eParam ) { throw new FluidCacheException ( "Unable to create shutdown MemCache client. " + eParam . getMessage ( ) , eParam ) ; } }


signature:
public class FlowStepRule { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FlowStepRule }
 * @ 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 ( ) ; // Order . . .
if ( this . getOrder ( ) != null ) { returnVal . put ( JSONMapping . ORDER , this . getOrder ( ) ) ; } // Rule . . .
if ( this . getRule ( ) != null ) { returnVal . put ( JSONMapping . RULE , this . getRule ( ) ) ; } // Current Typed Syntax . . .
if ( this . getCurrentTypedSyntax ( ) != null ) { returnVal . put ( JSONMapping . CURRENT_TYPED_SYNTAX , this . getCurrentTypedSyntax ( ) ) ; } // Flow . . .
if ( this . getFlow ( ) != null ) { returnVal . put ( JSONMapping . FLOW , this . getFlow ( ) . toJsonObject ( ) ) ; } // Flow Step . . .
if ( this . getFlowStep ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STEP , this . getFlowStep ( ) . toJsonObject ( ) ) ; } // Next Valid Syntax Words . . .
if ( this . getNextValidSyntaxWords ( ) != null && ! this . getNextValidSyntaxWords ( ) . isEmpty ( ) ) { JSONArray jsonArrayOfValidWords = new JSONArray ( ) ; for ( String validWord : this . getNextValidSyntaxWords ( ) ) { jsonArrayOfValidWords . put ( validWord ) ; } returnVal . put ( JSONMapping . NEXT_VALID_SYNTAX_WORDS , jsonArrayOfValidWords ) ; } return returnVal ;


signature:
public class SQLUtilWebSocketGetDescendantsClient { /** * Retrieves all the Descendants ( Forms ) for the { @ code formToGetTableFormsForParam } .
 * @ param formToGetDescendantsForParam The Fluid Form to get Descendants for .
 * @ return The { @ code formToGetDescendantsForParam } Descendants as { @ code Form } ' s . */
public List < FormListing > getDescendantsSynchronized ( Form ... formToGetDescendantsForParam ) { } }

implementation:
if ( formToGetDescendantsForParam == null || formToGetDescendantsForParam . length == 0 ) { return null ; } // Start a new request . . .
String uniqueReqId = this . initNewRequest ( ) ; // Mass data fetch . . .
int numberOfSentForms = 0 ; if ( this . massFetch ) { FormListing listingToSend = new FormListing ( ) ; List < Form > listOfValidForms = new ArrayList ( ) ; for ( Form formToSend : formToGetDescendantsForParam ) { if ( formToSend == null ) { throw new FluidClientException ( "Cannot provide 'null' for Form." , FluidClientException . ErrorCode . ILLEGAL_STATE_ERROR ) ; } listOfValidForms . add ( new Form ( formToSend . getId ( ) ) ) ; } listingToSend . setEcho ( UUID . randomUUID ( ) . toString ( ) ) ; listingToSend . setListing ( listOfValidForms ) ; // Send the actual message . . .
this . sendMessage ( listingToSend , uniqueReqId ) ; numberOfSentForms ++ ; } else { // Single . . .
// Send all the messages . . .
for ( Form formToSend : formToGetDescendantsForParam ) { this . setEchoIfNotSet ( formToSend ) ; // Send the actual message . . .
this . sendMessage ( formToSend , uniqueReqId ) ; numberOfSentForms ++ ; } } try { List < FormListing > returnValue = this . getHandler ( uniqueReqId ) . getCF ( ) . get ( this . getTimeoutInMillis ( ) , TimeUnit . MILLISECONDS ) ; // Connection was closed . . this is a problem . . . .
if ( this . getHandler ( uniqueReqId ) . isConnectionClosed ( ) ) { throw new FluidClientException ( "SQLUtil-WebSocket-GetDescendants: " + "The connection was closed by the server prior to the response received." , FluidClientException . ErrorCode . IO_ERROR ) ; } return returnValue ; } catch ( InterruptedException exceptParam ) { // Interrupted . . .
throw new FluidClientException ( "SQLUtil-WebSocket-Interrupted-GetDescendants: " + exceptParam . getMessage ( ) , exceptParam , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } catch ( ExecutionException executeProblem ) { // Error on the web - socket . . .
Throwable cause = executeProblem . getCause ( ) ; // Fluid client exception . . .
if ( cause instanceof FluidClientException ) { throw ( FluidClientException ) cause ; } else { throw new FluidClientException ( "SQLUtil-WebSocket-GetDescendants: " + cause . getMessage ( ) , cause , FluidClientException . ErrorCode . STATEMENT_EXECUTION_ERROR ) ; } } catch ( TimeoutException eParam ) { // Timeout . . .
String errMessage = this . getExceptionMessageVerbose ( "SQLUtil-WebSocket-GetDescendants" , uniqueReqId , numberOfSentForms ) ; throw new FluidClientException ( errMessage , FluidClientException . ErrorCode . IO_ERROR ) ; } finally { this . removeHandler ( uniqueReqId ) ; }


signature:
public class ABaseUtil { /** * Retrieves a property and returns the value as { @ code java . lang . String } .
 * @ param propertiesParam The origin of the properties .
 * @ param propertyKeyParam The property key .
 * @ return The property value . */
protected static String getStringPropertyFromProperties ( Properties propertiesParam , String propertyKeyParam ) { } }

implementation: if ( propertiesParam == null || propertiesParam . isEmpty ( ) ) { return null ; } return propertiesParam . getProperty ( propertyKeyParam ) ;


signature:
public class ABaseUtil { /** * Retrieves a property and returns the value as { @ code int } .
 * @ param propertiesParam The origin of the properties .
 * @ param propertyKeyParam The property key .
 * @ return The property value as an { @ code int } . */
protected static int getIntPropertyFromProperties ( Properties propertiesParam , String propertyKeyParam ) { } }

implementation: String strProp = getStringPropertyFromProperties ( propertiesParam , propertyKeyParam ) ; if ( strProp == null || strProp . trim ( ) . isEmpty ( ) ) { return - 1 ; } try { return Integer . parseInt ( strProp ) ; } catch ( NumberFormatException nfe ) { return - 1 ; }


signature:
public class ABaseUtil { /** * Returns - 1 if there is a problem with conversion .
 * @ param toParseParam The { @ code String } value to convert to { @ code long } .
 * @ return { @ code long } primitive version of { @ code toParseParam } . */
protected long toLongSafe ( String toParseParam ) { } }

implementation: if ( toParseParam == null || toParseParam . trim ( ) . isEmpty ( ) ) { return - 1 ; } try { return Long . parseLong ( toParseParam . trim ( ) ) ; } catch ( NumberFormatException e ) { return - 1 ; }


signature:
public class FluidItem { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code FluidItem }
 * @ 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 ( ) ; // Flow . . .
if ( this . getFlow ( ) != null ) { returnVal . put ( JSONMapping . FLOW , this . getFlow ( ) ) ; } // Form . . .
if ( this . getForm ( ) != null ) { returnVal . put ( JSONMapping . FORM , this . getForm ( ) . toJsonObject ( ) ) ; } // User Fields . . .
if ( this . getUserFields ( ) != null && ! this . getUserFields ( ) . isEmpty ( ) ) { JSONArray fieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getUserFields ( ) ) { fieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . USER_FIELDS , fieldsArr ) ; } // Route Fields . . .
if ( this . getRouteFields ( ) != null && ! this . getRouteFields ( ) . isEmpty ( ) ) { JSONArray fieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getRouteFields ( ) ) { fieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ROUTE_FIELDS , fieldsArr ) ; } // Global Fields . . .
if ( this . getGlobalFields ( ) != null && ! this . getGlobalFields ( ) . isEmpty ( ) ) { JSONArray fieldsArr = new JSONArray ( ) ; for ( Field toAdd : this . getGlobalFields ( ) ) { fieldsArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . GLOBAL_FIELDS , fieldsArr ) ; } // Attachments . . .
if ( this . getAttachments ( ) != null ) { JSONArray jsonArray = new JSONArray ( ) ; for ( Attachment toAdd : this . getAttachments ( ) ) { jsonArray . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . ATTACHMENTS , jsonArray ) ; } // Flow State . . .
if ( this . getFlowState ( ) != null ) { returnVal . put ( JSONMapping . FLOW_STATE , this . getFlowState ( ) . toString ( ) ) ; } return returnVal ;


signature:
public class FluidItem { /** * 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 . FLUID_ITEM_ID , this . getId ( ) == null ? JSONObject . NULL : this . getId ( ) ) ; // Flow State . . .
returnVal . put ( FlatFormJSONMapping . FLOW_STATE , ( this . getFlowState ( ) == null ) ? JSONObject . NULL : this . getFlowState ( ) . name ( ) ) ; // Populate the Form . . .
JSONObject formJSONObjFlat = ( this . getForm ( ) == null ) ? null : this . getForm ( ) . convertToFlatJSONObject ( ) ; if ( formJSONObjFlat != null ) { formJSONObjFlat . keySet ( ) . forEach ( ( toAdd ) -> { returnVal . put ( toAdd , formJSONObjFlat . get ( toAdd ) ) ; } ) ;


signature:
public class FormFieldToFormDefinition { /** * 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 ( ) ) ; } // Form Definition . . .
if ( this . getFormDefinition ( ) != null ) { returnVal . put ( JSONMapping . FORM_DEFINITION , this . getFormDefinition ( ) . toJsonObject ( ) ) ; } return returnVal ;


signature:
public class NormalizedUserProfile { /** * Gets a comma seperated list of providers from { @ code Identity } ' s .
 * @ return Text list of Providers for user { @ code Identities } .
 * @ see NormalizedUserProfile # getIdentities ( ) */
public String getListOfProvidersFromIdentities ( ) { } }

implementation: if ( this . getIdentities ( ) == null || this . getIdentities ( ) . isEmpty ( ) ) { return "" ; } StringBuilder returnVal = new StringBuilder ( ) ; for ( Identity identity : this . getIdentities ( ) ) { returnVal . append ( identity . getProvider ( ) ) ; returnVal . append ( "," ) ; } String toString = returnVal . toString ( ) ; return toString . substring ( 0 , toString . length ( ) - 1 ) ;


signature:
public class NormalizedUserProfile { /** * Conversion to { @ code JSONObject } from Java Object .
 * @ return { @ code JSONObject } representation of { @ code NormalizedUserProfile }
 * @ 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 ( ) ; // User Id . . .
if ( this . getUserId ( ) != null ) { returnVal . put ( JSONMapping . USER_ID , this . getUserId ( ) ) ; } // Name . . .
if ( this . getName ( ) != null ) { returnVal . put ( JSONMapping . NAME , this . getName ( ) ) ; } // Email . . .
if ( this . getEmail ( ) != null ) { returnVal . put ( JSONMapping . EMAIL , this . getEmail ( ) ) ; } // Email Verified . . .
returnVal . put ( JSONMapping . EMAIL_VERIFIED , this . isEmailVerified ( ) ) ; // Nickname . . .
if ( this . getNickname ( ) != null ) { returnVal . put ( JSONMapping . NICKNAME , this . getNickname ( ) ) ; } // Picture . . .
if ( this . getPicture ( ) != null ) { returnVal . put ( JSONMapping . PICTURE , this . getPicture ( ) ) ; } // Given Name . . .
if ( this . getGivenName ( ) != null ) { returnVal . put ( JSONMapping . GIVEN_NAME , this . getGivenName ( ) ) ; } // Family Name . . .
if ( this . getFamilyName ( ) != null ) { returnVal . put ( JSONMapping . FAMILY_NAME , this . getFamilyName ( ) ) ; } // Locale . . .
if ( this . getLocale ( ) != null ) { returnVal . put ( JSONMapping . LOCALE , this . getLocale ( ) ) ; } // Identities . . .
if ( this . getIdentities ( ) != null && ! this . getIdentities ( ) . isEmpty ( ) ) { JSONArray identitiesArr = new JSONArray ( ) ; for ( Identity toAdd : this . getIdentities ( ) ) { identitiesArr . put ( toAdd . toJsonObject ( ) ) ; } returnVal . put ( JSONMapping . IDENTITIES , identitiesArr ) ; } return returnVal ;