Package com.avoka.fc.core.util.xml
Class SystemProfileHelper
java.lang.Object
com.avoka.fc.core.util.xml.SystemProfileHelper
Provides convenient access to the SystemProfile elements in a form's seed XML.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The XML node holding information about jobstatic final String
The XML node holding information about services used by the formstatic final String
The XML node holding information about address lookup services used by the formstatic final String
The XML node holding information about form sharingstatic final String
The 'Field' form event logging mode.static final String
Implies that the form is rendered in interactive mode for fill-instatic final String
Implies that the form is rendered in flattened mode after an offline submissionstatic final String
Implies that the form is rendered in flattened mode for receiptingstatic final String
The XML element storing the offline submission actionstatic final String
The XML element storing the offline submission return URLstatic final String
The XML node holding offline submission informationstatic final String
The XML element storing the offline submission error message if the action type isinvalid reference
SystemProfileHelper#OFFLINE_SUBMIT_ACTION_TYPE_ERROR
static final String
Implies that the receipt has been rendered for deliverystatic final String
The 'SaveChallenge' model page.static final String
The XPath to the SystemProfile element.static final String
The XPath to the Composer SystemProfile element. -
Constructor Summary
ConstructorDescriptionSystemProfileHelper
(Document document) Create a SystemProfileHelper for the given XML document.SystemProfileHelper
(Document document, boolean composerForm) Deprecated.SystemProfileHelper
(Document document, TemplateVersion templateVersion) Create a SystemProfileHelper for the given XML document. -
Method Summary
Modifier and TypeMethodDescriptionReturn the job step tasks element.void
Clear out the sharing element.int
Retrieve the address lookup count recorded by the form.Gets the Composer data version.Return the display mode.Gets the External Analytics ID value.Return the form code.Return the form code, or null if not defined.Return the form data service URL.Return the HostContext value [ Page | IFrame | FieldWorker ].Return the job action task assignee.Return the job action task assign repeat index.Return the job action task assign repeat item.Return the job available routes.Return the job reference number.Return the job route name.Return the job step name.Return the online save enabled flag.Return the form submission percentage completed.Return the receipt mode.Return the receipt number.Return the redirect target.Return the referer.Gets the request date string.Return the request log key.Return the saved message.Return the server build number.Retrieve the list of services and their usage counts for all elements in theELEMENT_SERVICES
element.Return the string containing the email addresses the user wants to share the form with.Return the string containing the email body to be used in submission sharing.Return the string containing the sender name to be used in submission sharing.Return the submission message.Return the submission OID.Return the submission status.Return the formatted date and time of submission.Return the task key associated with the submission.Return the form template version number that was used.Return the test mode flag.Return the tracking code associated with the submission.Return the transaction score associated with the submission.Return whether the user profile should be updated on submission according to user property mappings.boolean
Determine whether the display mode flag is setboolean
Determine whether the form code is setboolean
Checks for request date string.boolean
Determine whether the request log key is setboolean
Determine whether the template version number is setboolean
Determine whether the test mode flag is setboolean
Returns whether autosave is disabledboolean
Return true if Transact Insights has been enabled.boolean
Return whether the user wants to share the form.boolean
Return true if the submission type is 'Abandoned'.boolean
Return true if the submission type is 'Ineligible'.boolean
Return true if the submission type is 'Saved'.boolean
Return true if the submission type is 'Submitted'.boolean
Return whether the user profile should be updated on submission according to user property mappings.void
Clear SystemProfile elements so the seed XML document can be reused in a new form render.void
setAutoSaveDisabled
(Boolean value) Sets whether autosave is disabled.void
setComposerDataVersion
(String value) Sets the Composer data version.void
setDisplayMode
(String value) Set the display mode.void
setExternalAnalyticsID
(String value) Sets the External Analytics ID value.void
setFormCode
(String value) Set the form code.void
setFormDataServiceUrl
(String value) Set the form data service URL.void
setFormVersion
(TemplateVersion templateVersion) Deprecated.void
setHostContext
(String value) Set the host context.setInsightsAccessToken
(String value) Specify the Transact Insights OAuth access token.setInsightsAddressHash
(String value) Specify the Transact Insights Address hash.setInsightsEnabled
(boolean value) Specify whether Transact Insights is enabledsetInsightsEndpoint
(String value) Specify the Transact Insights endpoint URL.setInsightsRequestUrl
(String value) Specify the Transact Insights request URL.Specify the Transact Insights Start Time.void
setJobAssignee
(String value) Set the job task assignee.void
setJobAssignRepeatIndex
(Integer value) Set the job action task assign repeat index.void
setJobAssignRepeatItem
(String value) Set the job action task assign repeat item.void
setJobAvailableRoutes
(String value) Set the job available routes.void
setJobReferenceNumber
(String value) Set the job reference number.void
setJobRouteName
(String value) Set the job route name.void
setJobStepName
(String value) Set the job step name.void
setOfflineSubmitActionType
(String value) Set the offline submission action type.void
setOfflineSubmitActionUrl
(String value) Set the offline submission action URL.void
Set the offline submission error message.void
setOfflineSubmitKey
(String value) Sets the offline submit key.void
setOnlineSaveEnabledFlag
(Object value) Set the online save enabled flag.void
setPercentageCompleted
(String value) Set the form submission percentage completed.void
setReceiptMode
(String value) Set the receipt mode.void
setReceiptNumber
(String value) Set the receipt number.void
setRedirectTarget
(String value) Set the redirect target.void
setReferer
(String value) Set the referer.void
setRequestDateString
(String value) Sets the request date string.void
setRequestLogKey
(Object value) Set the request log key.void
setRevisionNumber
(String value) Set the revision number associated with the submission.void
Set the Form XML ModalPage element to 'SaveChallenge'.void
setSavedMessage
(String value) Set the saved message.void
setServerBuildNumber
(String value) Set the server build number.void
setSubmissionExpiryDate
(String value) Set the submission expiry date.void
setSubmissionMessage
(String value) Set the submission message.void
setSubmissionNumber
(Object value) Set the submission OID.void
setSubmissionType
(String value) Set the submission status.void
setSubmitDateString
(String value) Set the formatted date and time of submission.void
setTaskKey
(String value) Set the task key associated with the submission.void
setTemplateVersionNumber
(String value) Set the form template version number.void
setTestMode
(Boolean value) Set the test mode flag.void
setTrackingCode
(String value) Set the tracking code associated with the submission.void
setUpdateUserProfile
(boolean value) Set whether the user profile should be updated on submission according to user property mappings.void
setUserName
(String userName) Set whether the user logged in user name of an SFM user when opening the form.
-
Field Details
-
MODE_ENTRY
Implies that the form is rendered in interactive mode for fill-in- See Also:
-
MODE_OFFLINE_SUBMIT
Implies that the form is rendered in flattened mode after an offline submission- See Also:
-
MODE_RECEIPT
Implies that the form is rendered in flattened mode for receipting- See Also:
-
RECEIPT_MODE_DELIVERY
Implies that the receipt has been rendered for delivery- See Also:
-
FORM_EVENT_LOGGING_MODE_FIELD
The 'Field' form event logging mode.- See Also:
-
OFFLINE_SUBMIT_ELEMENT
The XML node holding offline submission information- See Also:
-
OFFLINE_SUBMIT_ACTION_TYPE
The XML element storing the offline submission action- See Also:
-
OFFLINE_SUBMIT_ACTION_URL
The XML element storing the offline submission return URL- See Also:
-
OFFLINE_SUBMIT_ERROR_MESSAGE
The XML element storing the offline submission error message if the action type isinvalid reference
SystemProfileHelper#OFFLINE_SUBMIT_ACTION_TYPE_ERROR
- See Also:
-
ELEMENT_SERVICES
The XML node holding information about services used by the form- See Also:
-
ELEMENT_SERVICES_ADDRESS_LOOKUP
The XML node holding information about address lookup services used by the form- See Also:
-
ELEMENT_SHARING
The XML node holding information about form sharing- See Also:
-
ELEMENT_JOB
The XML node holding information about job- See Also:
-
SYSTEM_PROFILE_XPATH
The XPath to the SystemProfile element.- See Also:
-
SYSTEM_PROFILE_XPATH_COMPOSER
The XPath to the Composer SystemProfile element.- See Also:
-
SAVE_CHALLENGE_MODAL_PAGE
The 'SaveChallenge' model page.- See Also:
-
-
Constructor Details
-
SystemProfileHelper
Create a SystemProfileHelper for the given XML document.- Parameters:
document
- the XML form document (required)templateVersion
- the form version (required)- Since:
- 17.10.3
-
SystemProfileHelper
Deprecated.Create a SystemProfileHelper for the given XML document. Note: The form type is used when the document does not have a system profile element. For Composer SmartForms, the new element is created in a different location, so as to be consistent with Composer. If the document already contains a system profile element (e.g. during submission processing), the form type is irrelevant.- Parameters:
document
- the non-null form seed XMLcomposerForm
- the rendered form type is Composer SmartForm
-
SystemProfileHelper
Create a SystemProfileHelper for the given XML document.- Parameters:
document
- the non-null form seed XML
-
-
Method Details
-
setFormVersion
Deprecated.Specify the form template version the SystemProfile should support.- Parameters:
templateVersion
- the form template version (required)- Since:
- 17.10.0
-
resetSystemProfile
public void resetSystemProfile()Clear SystemProfile elements so the seed XML document can be reused in a new form render. -
setSaveChallengeModalPage
public void setSaveChallengeModalPage()Set the Form XML ModalPage element to 'SaveChallenge'.- Since:
- 4.1.0
-
isSubmissionTypeAbandoned
public boolean isSubmissionTypeAbandoned()Return true if the submission type is 'Abandoned'.- Returns:
- true if the submission type is 'Abandoned'
-
isSubmissionTypeIneligible
public boolean isSubmissionTypeIneligible()Return true if the submission type is 'Ineligible'.- Returns:
- true if the submission type is 'Ineligible'
- Since:
- 5.1.0
-
isSubmissionTypeSaved
public boolean isSubmissionTypeSaved()Return true if the submission type is 'Saved'.- Returns:
- true if the submission type is 'Saved'
-
isSubmissionTypeSubmitted
public boolean isSubmissionTypeSubmitted()Return true if the submission type is 'Submitted'.- Returns:
- true if the submission type is 'Submitted'
-
isAutoSaveDisabled
public boolean isAutoSaveDisabled()Returns whether autosave is disabled- Returns:
- true if autosave is disabled
-
setAutoSaveDisabled
Sets whether autosave is disabled.- Parameters:
value
- whether autosave shall be disabled
-
getComposerDataVersion
Gets the Composer data version.- Returns:
- the Composer data version
-
setComposerDataVersion
Sets the Composer data version.- Parameters:
value
- the new Composer data version
-
getExternalAnalyticsID
Gets the External Analytics ID value.- Returns:
- the External Analytics ID value
- Since:
- 4.2.1
-
setExternalAnalyticsID
Sets the External Analytics ID value.- Parameters:
value
- the External Analytics ID value.- Since:
- 4.2.1
-
hasFormCode
public boolean hasFormCode()Determine whether the form code is set- Returns:
- whether the FormCode element is set
-
getFormCode
Return the form code. Note that this call will fail if the FormCode element does not exist.- Returns:
- the value of the FormCode element
-
getFormCodeOptional
Return the form code, or null if not defined.- Returns:
- the value of the FormCode element, or null if not defined.
- Since:
- 4.2.0
-
getHostContext
Return the HostContext value [ Page | IFrame | FieldWorker ].- Returns:
- the value of the HostContext element, or null if not defined
-
setFormDataServiceUrl
Set the form data service URL.- Parameters:
value
- the new value of the FormDataServiceUrl element
-
getFormDataServiceUrl
Return the form data service URL. Note that this call will fail if the FormDataServiceUrl element does not exist.- Returns:
- the value of the FormDataServiceUrl element
-
setFormCode
Set the form code.- Parameters:
value
- the new value of the FormCode element
-
setHostContext
Set the host context.- Parameters:
value
- the new value of the HostContext element
-
getReceiptMode
Return the receipt mode.- Returns:
- the value of the ReceiptMode element
-
setReceiptMode
Set the receipt mode.- Parameters:
value
- the new value of the ReceiptNumber element
-
getReceiptNumber
Return the receipt number.- Returns:
- the value of the ReceiptNumber element
-
setReceiptNumber
Set the receipt number.- Parameters:
value
- the new value of the ReceiptNumber element
-
getReferer
Return the referer. Note that this call will fail if the Referer element does not exist.- Returns:
- the value of the Referer element
-
setReferer
Set the referer.- Parameters:
value
- the new value of the Referer element
-
getRedirectTarget
Return the redirect target.- Returns:
- the value of the RedirectTarget element
-
setRedirectTarget
Set the redirect target.- Parameters:
value
- the new value of the RedirectTarget element
-
hasRequestLogKey
public boolean hasRequestLogKey()Determine whether the request log key is set- Returns:
- whether the RequestLogKey element is set
-
getRequestLogKey
Return the request log key. Note that this call will fail if the RequestLogKey element does not exist.- Returns:
- the value of the RequestLogKey element
-
setRequestLogKey
Set the request log key.- Parameters:
value
- the new value of the RequestLogKey element
-
getRevisionNumber
- Returns:
- the submission revision number
- Since:
- 3.6.0
-
setRevisionNumber
Set the revision number associated with the submission.- Parameters:
value
- the new value of the TaskKey element- Since:
- 3.6.0
-
hasTestMode
public boolean hasTestMode()Determine whether the test mode flag is set- Returns:
- whether the TestMode element is set
-
getTestMode
Return the test mode flag. If the element is null then this method will return false- Returns:
- the value of the TestMode element
-
setTestMode
Set the test mode flag.- Parameters:
value
- the new value of the TestMode element
-
hasDisplayMode
public boolean hasDisplayMode()Determine whether the display mode flag is set- Returns:
- whether the DisplayMode element is set
-
getDisplayMode
Return the display mode. Note that this call will fail if the DisplayMode element does not exist.- Returns:
- the value of the DisplayMode element
-
setDisplayMode
Set the display mode.- Parameters:
value
- the new value of the DisplayMode element (one ofMODE_ENTRY
,invalid reference
SystemProfileHelper#MODE_DELIVERY_RECEIPT
MODE_RECEIPT
)
-
getServerBuildNumber
Return the server build number. Note that this call will fail if the ServerBuildNumber element does not exist.- Returns:
- the value of the ServerBuildNumber element
-
setServerBuildNumber
Set the server build number.- Parameters:
value
- the new value of the ServerBuildNumber element
-
setSubmissionExpiryDate
Set the submission expiry date.- Parameters:
value
- the new value of the SubmissionExpiryDate element
-
getSavedMessage
Return the saved message.- Returns:
- the value of the SavedMessage element
-
setSavedMessage
Set the saved message.- Parameters:
value
- the new value of the SavedMessage element
-
getSubmissionMessage
Return the submission message.- Returns:
- the value of the SubmissionMessage element
-
setSubmissionMessage
Set the submission message.- Parameters:
value
- the new value of the SubmissionMessage element
-
getSubmissionNumber
Return the submission OID. Note that this call will fail if the SubmissionNumber element does not exist.- Returns:
- the value of the SubmissionNumber element
-
setSubmissionNumber
Set the submission OID.- Parameters:
value
- the new value of the SubmissionNumber element
-
getSubmissionType
Return the submission status. Note that this call will fail if the SubmissionType element does not exist.- Returns:
- the value of the SubmissionType element
-
setSubmissionType
Set the submission status.- Parameters:
value
- the new value of the SubmissionType element (one ofSubmission.FORM_STATUS_VALUES
)
-
getOnlineSaveEnabledFlag
Return the online save enabled flag. Note that this call will fail if the OnlineSaveEnabledFlag element does not exist.- Returns:
- the value of the OnlineSaveEnabledFlag element
-
setOnlineSaveEnabledFlag
Set the online save enabled flag.- Parameters:
value
- the new value of the OnlineSaveEnabledFlag element
-
setPercentageCompleted
Set the form submission percentage completed.- Parameters:
value
- the form submission percentage completed- Since:
- 4.0.0
-
getPercentageCompleted
Return the form submission percentage completed.- Returns:
- the form submission percentage completed
- Since:
- 4.0.0
-
getSubmitDateString
Return the formatted date and time of submission. Note that this call will fail if the SubmitDateString element does not exist.- Returns:
- the value of the SubmitDateString element
-
setSubmitDateString
Set the formatted date and time of submission.- Parameters:
value
- the new value of the SubmitDateString element
-
getTaskKey
Return the task key associated with the submission.- Returns:
- the value of the TaskKey element
-
setTaskKey
Set the task key associated with the submission.- Parameters:
value
- the new value of the TaskKey element
-
getTrackingCode
Return the tracking code associated with the submission.- Returns:
- the value of the TrackingCode element
- Since:
- 4.0.0
-
setTrackingCode
Set the tracking code associated with the submission.- Parameters:
value
- the submission tracking code- Since:
- 4.0.0
-
getTransactionScore
Return the transaction score associated with the submission.- Returns:
- the transaction score
- Since:
- 4.0.0
-
hasTemplateVersionNumber
public boolean hasTemplateVersionNumber()Determine whether the template version number is set- Returns:
- whether the TemplateVersionNumber element is set
-
getTemplateVersionNumber
Return the form template version number that was used.- Returns:
- the value of the TemplateVersionNumber element
-
setTemplateVersionNumber
Set the form template version number.- Parameters:
value
- the new value of the TemplateVersionNumber element
-
hasRequestDateString
public boolean hasRequestDateString()Checks for request date string.- Returns:
- true, if successful
-
getRequestDateString
Gets the request date string.- Returns:
- the request date string
-
setRequestDateString
Sets the request date string.- Parameters:
value
- the new request date string
-
isUpdateUserProfile
public boolean isUpdateUserProfile()Return whether the user profile should be updated on submission according to user property mappings.- Returns:
- the value of the UpdateUserProfile element
-
getUpdateUserProfile
Return whether the user profile should be updated on submission according to user property mappings.- Returns:
- the value of the UpdateUserProfile element
-
setUpdateUserProfile
public void setUpdateUserProfile(boolean value) Set whether the user profile should be updated on submission according to user property mappings.- Parameters:
value
- the new value of the UpdateUserProfile element
-
setUserName
Set whether the user logged in user name of an SFM user when opening the form. Note: Externally managed users, where no user account object exists in SFM.- Parameters:
userName
- the user login at form render time
-
getUserName
- Returns:
- the logged in user name prefilled in the system profile.
- Since:
- 4.0.0
-
setOfflineSubmitActionType
Set the offline submission action type.- Parameters:
value
- the new action type
-
setOfflineSubmitActionUrl
Set the offline submission action URL.- Parameters:
value
- the new action URL
-
setOfflineSubmitErrorMessage
Set the offline submission error message.- Parameters:
value
- the new error message
-
setOfflineSubmitKey
Sets the offline submit key.- Parameters:
value
- the new offline submit key
-
getAddressLookupCount
Retrieve the address lookup count recorded by the form.- Returns:
- the address lookup count recorded by the form
- Throws:
NumberFormatException
- if the count could not be parsed as an int- Since:
- 3.6.0
-
getServiceUsage
Retrieve the list of services and their usage counts for all elements in theELEMENT_SERVICES
element. If a service entry does not have a numeric value, it is not included in the map. If multiple entries with the same names exist, they will be added together.- Returns:
- a map of services and the recorded usage counts
- Since:
- 4.2.0
-
getSharingEmailAddresses
Return the string containing the email addresses the user wants to share the form with. If multiple email addresses are specified, they should be separated by commas.- Returns:
- the string containing email addresses for submission sharing
- Since:
- 4.0.0
-
getSharingEmailBody
Return the string containing the email body to be used in submission sharing.- Returns:
- the string containing the email body for submission sharing
- Since:
- 4.0.0
-
getSharingSenderName
Return the string containing the sender name to be used in submission sharing.- Returns:
- the string containing the sender name for submission sharing
- Since:
- 4.0.0
-
clearSharingElement
public void clearSharingElement()Clear out the sharing element.- Since:
- 4.0.0
-
getJobAvailableRoutes
Return the job available routes.- Returns:
- the job available routes
- Since:
- 4.0.0
-
setJobAvailableRoutes
Set the job available routes.- Parameters:
value
- the job available routes- Since:
- 4.0.0
-
getJobReferenceNumber
Return the job reference number.- Returns:
- the job reference number
- Since:
- 4.0.0
-
setJobReferenceNumber
Set the job reference number.- Parameters:
value
- the job reference number- Since:
- 4.0.0
-
getJobRouteName
Return the job route name.- Returns:
- the job route name
- Since:
- 4.0.0
-
setJobRouteName
Set the job route name.- Parameters:
value
- the job route name- Since:
- 4.0.0
-
getJobStepName
Return the job step name.- Returns:
- the job step name
- Since:
- 4.0.0
-
setJobStepName
Set the job step name.- Parameters:
value
- the job step name- Since:
- 4.0.0
-
getJobAssignee
Return the job action task assignee.- Returns:
- the job action task assignee
- Since:
- 4.1.8
-
setJobAssignee
Set the job task assignee.- Parameters:
value
- job task assignee
-
getJobAssignRepeatIndex
Return the job action task assign repeat index.- Returns:
- the job action task assign repeat index
- Since:
- 4.1.8
-
setJobAssignRepeatIndex
Set the job action task assign repeat index.- Parameters:
value
- the job action task assign repeat index- Since:
- 4.1.8
-
getJobAssignRepeatItem
Return the job action task assign repeat item.- Returns:
- the job action task assign repeat item
- Since:
- 4.1.8
-
setJobAssignRepeatItem
Set the job action task assign repeat item.- Parameters:
value
- the job action task assign repeat item- Since:
- 4.1.8
-
clearAndGetJobStepTasksElement
Return the job step tasks element. Note this method will remove any- Returns:
- the job step tasks element.
- Since:
- 4.2.0
-
isInsightsEnabled
public boolean isInsightsEnabled()Return true if Transact Insights has been enabled.- Returns:
- true if Transact Insights has been enabled.
- Since:
- 5.0.0
-
setInsightsEnabled
Specify whether Transact Insights is enabled- Parameters:
value
- specify whether Transact Insights is enable.- Returns:
- the system profile helper
- Since:
- 4.3.3
-
setInsightsAccessToken
Specify the Transact Insights OAuth access token.- Parameters:
value
- the Transact Insights OAuth access token.- Returns:
- the system profile helper
- Since:
- 4.3.3
-
setInsightsEndpoint
Specify the Transact Insights endpoint URL.- Parameters:
value
- the Transact Insights endpoint URL.- Returns:
- the system profile helper
- Since:
- 4.3.3
-
setInsightsAddressHash
Specify the Transact Insights Address hash.- Parameters:
value
- the Transact Insights Address hash.- Returns:
- the system profile helper
- Since:
- 5.0.0
-
setInsightsRequestUrl
Specify the Transact Insights request URL.- Parameters:
value
- the Transact Insights request URL.- Returns:
- the system profile helper
- Since:
- 18.05.0
-
setInsightsStartTime
Specify the Transact Insights Start Time.- Since:
- 5.1.0
-