Class SystemProfileHelper


  • public class SystemProfileHelper
    extends Object
    Provides convenient access to the SystemProfile elements in a form's seed XML.
    • Field Detail

      • MODE_ENTRY

        public static final String MODE_ENTRY
        Implies that the form is rendered in interactive mode for fill-in
        See Also:
        Constant Field Values
      • MODE_OFFLINE_SUBMIT

        public static final String MODE_OFFLINE_SUBMIT
        Implies that the form is rendered in flattened mode after an offline submission
        See Also:
        Constant Field Values
      • MODE_RECEIPT

        public static final String MODE_RECEIPT
        Implies that the form is rendered in flattened mode for receipting
        See Also:
        Constant Field Values
      • RECEIPT_MODE_DELIVERY

        public static final String RECEIPT_MODE_DELIVERY
        Implies that the receipt has been rendered for delivery
        See Also:
        Constant Field Values
      • FORM_EVENT_LOGGING_MODE_FIELD

        public static final String FORM_EVENT_LOGGING_MODE_FIELD
        The 'Field' form event logging mode.
        See Also:
        Constant Field Values
      • OFFLINE_SUBMIT_ELEMENT

        public static final String OFFLINE_SUBMIT_ELEMENT
        The XML node holding offline submission information
        See Also:
        Constant Field Values
      • OFFLINE_SUBMIT_ACTION_TYPE

        public static final String OFFLINE_SUBMIT_ACTION_TYPE
        The XML element storing the offline submission action
        See Also:
        Constant Field Values
      • OFFLINE_SUBMIT_ACTION_URL

        public static final String OFFLINE_SUBMIT_ACTION_URL
        The XML element storing the offline submission return URL
        See Also:
        Constant Field Values
      • OFFLINE_SUBMIT_ERROR_MESSAGE

        public static final String OFFLINE_SUBMIT_ERROR_MESSAGE
        The XML element storing the offline submission error message if the action type is SystemProfileHelper#OFFLINE_SUBMIT_ACTION_TYPE_ERROR
        See Also:
        Constant Field Values
      • ELEMENT_SERVICES

        public static final String ELEMENT_SERVICES
        The XML node holding information about services used by the form
        See Also:
        Constant Field Values
      • ELEMENT_SERVICES_ADDRESS_LOOKUP

        public static final String ELEMENT_SERVICES_ADDRESS_LOOKUP
        The XML node holding information about address lookup services used by the form
        See Also:
        Constant Field Values
      • ELEMENT_SHARING

        public static final String ELEMENT_SHARING
        The XML node holding information about form sharing
        See Also:
        Constant Field Values
      • SYSTEM_PROFILE_XPATH

        public static final String SYSTEM_PROFILE_XPATH
        The XPath to the SystemProfile element.
        See Also:
        Constant Field Values
      • SYSTEM_PROFILE_XPATH_COMPOSER

        public static final String SYSTEM_PROFILE_XPATH_COMPOSER
        The XPath to the Composer SystemProfile element.
        See Also:
        Constant Field Values
      • SAVE_CHALLENGE_MODAL_PAGE

        public static final String SAVE_CHALLENGE_MODAL_PAGE
        The 'SaveChallenge' model page.
        See Also:
        Constant Field Values
    • Constructor Detail

      • SystemProfileHelper

        public SystemProfileHelper​(Document document,
                                   TemplateVersion templateVersion)
        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
        public SystemProfileHelper​(Document document,
                                   boolean composerForm)
        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 XML
        composerForm - the rendered form type is Composer SmartForm
      • SystemProfileHelper

        public SystemProfileHelper​(Document document)
        Create a SystemProfileHelper for the given XML document.
        Parameters:
        document - the non-null form seed XML
    • Method Detail

      • setFormVersion

        @Deprecated
        public void setFormVersion​(TemplateVersion templateVersion)
        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

        public void setAutoSaveDisabled​(Boolean value)
        Sets whether autosave is disabled.
        Parameters:
        value - whether autosave shall be disabled
      • getComposerDataVersion

        public String getComposerDataVersion()
        Gets the Composer data version.
        Returns:
        the Composer data version
      • setComposerDataVersion

        public void setComposerDataVersion​(String value)
        Sets the Composer data version.
        Parameters:
        value - the new Composer data version
      • getExternalAnalyticsID

        public String getExternalAnalyticsID()
        Gets the External Analytics ID value.
        Returns:
        the External Analytics ID value
        Since:
        4.2.1
      • setExternalAnalyticsID

        public void setExternalAnalyticsID​(String value)
        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

        public String 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

        public String 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

        public String getHostContext()
        Return the HostContext value [ Page | IFrame | FieldWorker ].
        Returns:
        the value of the HostContext element, or null if not defined
      • setFormDataServiceUrl

        public void setFormDataServiceUrl​(String value)
        Set the form data service URL.
        Parameters:
        value - the new value of the FormDataServiceUrl element
      • getFormDataServiceUrl

        public String 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

        public void setFormCode​(String value)
        Set the form code.
        Parameters:
        value - the new value of the FormCode element
      • setHostContext

        public void setHostContext​(String value)
        Set the host context.
        Parameters:
        value - the new value of the HostContext element
      • getReceiptMode

        public String getReceiptMode()
        Return the receipt mode.
        Returns:
        the value of the ReceiptMode element
      • setReceiptMode

        public void setReceiptMode​(String value)
        Set the receipt mode.
        Parameters:
        value - the new value of the ReceiptNumber element
      • getReceiptNumber

        public String getReceiptNumber()
        Return the receipt number.
        Returns:
        the value of the ReceiptNumber element
      • setReceiptNumber

        public void setReceiptNumber​(String value)
        Set the receipt number.
        Parameters:
        value - the new value of the ReceiptNumber element
      • getReferer

        public String 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

        public void setReferer​(String value)
        Set the referer.
        Parameters:
        value - the new value of the Referer element
      • getRedirectTarget

        public String getRedirectTarget()
        Return the redirect target.
        Returns:
        the value of the RedirectTarget element
      • setRedirectTarget

        public void setRedirectTarget​(String value)
        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

        public String 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

        public void setRequestLogKey​(Object value)
        Set the request log key.
        Parameters:
        value - the new value of the RequestLogKey element
      • getRevisionNumber

        public String getRevisionNumber()
        Returns:
        the submission revision number
        Since:
        3.6.0
      • setRevisionNumber

        public void setRevisionNumber​(String value)
        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

        public Boolean 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

        public void setTestMode​(Boolean value)
        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

        public String 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

        public void setDisplayMode​(String value)
        Set the display mode.
        Parameters:
        value - the new value of the DisplayMode element (one of MODE_ENTRY, SystemProfileHelper#MODE_DELIVERY_RECEIPT and MODE_RECEIPT)
      • getServerBuildNumber

        public String 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

        public void setServerBuildNumber​(String value)
        Set the server build number.
        Parameters:
        value - the new value of the ServerBuildNumber element
      • setSubmissionExpiryDate

        public void setSubmissionExpiryDate​(String value)
        Set the submission expiry date.
        Parameters:
        value - the new value of the SubmissionExpiryDate element
      • getSavedMessage

        public String getSavedMessage()
        Return the saved message.
        Returns:
        the value of the SavedMessage element
      • setSavedMessage

        public void setSavedMessage​(String value)
        Set the saved message.
        Parameters:
        value - the new value of the SavedMessage element
      • getSubmissionMessage

        public String getSubmissionMessage()
        Return the submission message.
        Returns:
        the value of the SubmissionMessage element
      • setSubmissionMessage

        public void setSubmissionMessage​(String value)
        Set the submission message.
        Parameters:
        value - the new value of the SubmissionMessage element
      • getSubmissionNumber

        public String 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

        public void setSubmissionNumber​(Object value)
        Set the submission OID.
        Parameters:
        value - the new value of the SubmissionNumber element
      • getSubmissionType

        public String 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

        public void setSubmissionType​(String value)
        Set the submission status.
        Parameters:
        value - the new value of the SubmissionType element (one of Submission.FORM_STATUS_VALUES)
      • getOnlineSaveEnabledFlag

        public String 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

        public void setOnlineSaveEnabledFlag​(Object value)
        Set the online save enabled flag.
        Parameters:
        value - the new value of the OnlineSaveEnabledFlag element
      • setPercentageCompleted

        public void setPercentageCompleted​(String value)
        Set the form submission percentage completed.
        Parameters:
        value - the form submission percentage completed
        Since:
        4.0.0
      • getPercentageCompleted

        public Integer getPercentageCompleted()
        Return the form submission percentage completed.
        Returns:
        the form submission percentage completed
        Since:
        4.0.0
      • getSubmitDateString

        public String 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

        public void setSubmitDateString​(String value)
        Set the formatted date and time of submission.
        Parameters:
        value - the new value of the SubmitDateString element
      • getTaskKey

        public String getTaskKey()
        Return the task key associated with the submission.
        Returns:
        the value of the TaskKey element
      • setTaskKey

        public void setTaskKey​(String value)
        Set the task key associated with the submission.
        Parameters:
        value - the new value of the TaskKey element
      • getTrackingCode

        public String getTrackingCode()
        Return the tracking code associated with the submission.
        Returns:
        the value of the TrackingCode element
        Since:
        4.0.0
      • setTrackingCode

        public void setTrackingCode​(String value)
        Set the tracking code associated with the submission.
        Parameters:
        value - the submission tracking code
        Since:
        4.0.0
      • getTransactionScore

        public Integer 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

        public String getTemplateVersionNumber()
        Return the form template version number that was used.
        Returns:
        the value of the TemplateVersionNumber element
      • setTemplateVersionNumber

        public void setTemplateVersionNumber​(String value)
        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

        public String getRequestDateString()
        Gets the request date string.
        Returns:
        the request date string
      • setRequestDateString

        public void setRequestDateString​(String value)
        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

        public String 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

        public void setUserName​(String userName)
        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

        public String getUserName()
        Returns:
        the logged in user name prefilled in the system profile.
        Since:
        4.0.0
      • setOfflineSubmitActionType

        public void setOfflineSubmitActionType​(String value)
        Set the offline submission action type.
        Parameters:
        value - the new action type
      • setOfflineSubmitActionUrl

        public void setOfflineSubmitActionUrl​(String value)
        Set the offline submission action URL.
        Parameters:
        value - the new action URL
      • setOfflineSubmitErrorMessage

        public void setOfflineSubmitErrorMessage​(String value)
        Set the offline submission error message.
        Parameters:
        value - the new error message
      • setOfflineSubmitKey

        public void setOfflineSubmitKey​(String value)
        Sets the offline submit key.
        Parameters:
        value - the new offline submit key
      • getAddressLookupCount

        public int getAddressLookupCount()
                                  throws NumberFormatException
        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

        public Map<String,​Integer> getServiceUsage()
        Retrieve the list of services and their usage counts for all elements in the ELEMENT_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

        public String 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

        public String 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

        public String 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

        public String getJobAvailableRoutes()
        Return the job available routes.
        Returns:
        the job available routes
        Since:
        4.0.0
      • setJobAvailableRoutes

        public void setJobAvailableRoutes​(String value)
        Set the job available routes.
        Parameters:
        value - the job available routes
        Since:
        4.0.0
      • getJobReferenceNumber

        public String getJobReferenceNumber()
        Return the job reference number.
        Returns:
        the job reference number
        Since:
        4.0.0
      • setJobReferenceNumber

        public void setJobReferenceNumber​(String value)
        Set the job reference number.
        Parameters:
        value - the job reference number
        Since:
        4.0.0
      • getJobRouteName

        public String getJobRouteName()
        Return the job route name.
        Returns:
        the job route name
        Since:
        4.0.0
      • setJobRouteName

        public void setJobRouteName​(String value)
        Set the job route name.
        Parameters:
        value - the job route name
        Since:
        4.0.0
      • getJobStepName

        public String getJobStepName()
        Return the job step name.
        Returns:
        the job step name
        Since:
        4.0.0
      • setJobStepName

        public void setJobStepName​(String value)
        Set the job step name.
        Parameters:
        value - the job step name
        Since:
        4.0.0
      • getJobAssignee

        public String getJobAssignee()
        Return the job action task assignee.
        Returns:
        the job action task assignee
        Since:
        4.1.8
      • setJobAssignee

        public void setJobAssignee​(String value)
        Set the job task assignee.
        Parameters:
        value - job task assignee
      • getJobAssignRepeatIndex

        public String getJobAssignRepeatIndex()
        Return the job action task assign repeat index.
        Returns:
        the job action task assign repeat index
        Since:
        4.1.8
      • setJobAssignRepeatIndex

        public void setJobAssignRepeatIndex​(Integer value)
        Set the job action task assign repeat index.
        Parameters:
        value - the job action task assign repeat index
        Since:
        4.1.8
      • getJobAssignRepeatItem

        public String getJobAssignRepeatItem()
        Return the job action task assign repeat item.
        Returns:
        the job action task assign repeat item
        Since:
        4.1.8
      • setJobAssignRepeatItem

        public void setJobAssignRepeatItem​(String value)
        Set the job action task assign repeat item.
        Parameters:
        value - the job action task assign repeat item
        Since:
        4.1.8
      • clearAndGetJobStepTasksElement

        public Element 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

        public SystemProfileHelper setInsightsEnabled​(boolean value)
        Specify whether Transact Insights is enabled
        Parameters:
        value - specify whether Transact Insights is enable.
        Returns:
        the system profile helper
        Since:
        4.3.3
      • setInsightsAccessToken

        public SystemProfileHelper setInsightsAccessToken​(String value)
        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

        public SystemProfileHelper setInsightsEndpoint​(String value)
        Specify the Transact Insights endpoint URL.
        Parameters:
        value - the Transact Insights endpoint URL.
        Returns:
        the system profile helper
        Since:
        4.3.3
      • setInsightsAddressHash

        public SystemProfileHelper setInsightsAddressHash​(String value)
        Specify the Transact Insights Address hash.
        Parameters:
        value - the Transact Insights Address hash.
        Returns:
        the system profile helper
        Since:
        5.0.0
      • setInsightsRequestUrl

        public SystemProfileHelper setInsightsRequestUrl​(String value)
        Specify the Transact Insights request URL.
        Parameters:
        value - the Transact Insights request URL.
        Returns:
        the system profile helper
        Since:
        18.05.0
      • setInsightsStartTime

        public SystemProfileHelper setInsightsStartTime()
        Specify the Transact Insights Start Time.
        Since:
        5.1.0