Interface SubmissionTargetResolver

  • All Known Implementing Classes:
    SubmissionTargetResolverImpl

    public interface SubmissionTargetResolver
    Provides an interface for the submission target resolver. It contains some utility methods to resolve various type of URL Path based on a submission.
    • Field Detail

      • SUBMISSION_ACTION_ASSIGNED

        static final String SUBMISSION_ACTION_ASSIGNED
        Implies that the next action is to review the saved form
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_SAVED

        static final String SUBMISSION_ACTION_SAVED
        Implies that the next action is to review the saved form
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_ATTACHMENT

        static final String SUBMISSION_ACTION_ATTACHMENT
        Implies that the next action is to add attachments
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_PAYMENT

        static final String SUBMISSION_ACTION_PAYMENT
        Implies that the next action is to make payment
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_SIGNATURE

        static final String SUBMISSION_ACTION_SIGNATURE
        Implies that the next action is to sign the form
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_AUTHENTICATION

        static final String SUBMISSION_ACTION_AUTHENTICATION
        Implies that the next action is to authenticate
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_COMPLETED

        static final String SUBMISSION_ACTION_COMPLETED
        Implies that the next action is to view the confirmation page
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_EXPIRY

        static final String SUBMISSION_ACTION_EXPIRY
        Implies that the form has expired and cannot be submitted
        See Also:
        Constant Field Values
      • SUBMISSION_ACTION_ERROR

        static final String SUBMISSION_ACTION_ERROR
        Implies that the next action is to view an error page
        See Also:
        Constant Field Values
    • Method Detail

      • resolvePath

        String resolvePath​(Submission submission)
        Resolve the next action path for the given submission.
        Parameters:
        submission - the submission
        Returns:
        the url path
      • resolvePathAndRedirect

        void resolvePathAndRedirect​(HttpServletRequest request,
                                    HttpServletResponse response,
                                    Submission submission)
        Resolve the next action path for the given submission and redirect to that target.
        Parameters:
        request - the http request
        response - the http response
        submission - the submission
      • resolvePath

        String resolvePath​(HttpServletRequest request,
                           Submission submission)
        Resolve a path given a http request, a submission and its associated submission data bean.
        Parameters:
        request - the http request
        submission - the submission
        Returns:
        the url path
      • resolveAction

        Map<String,​String> resolveAction​(HttpServletRequest request,
                                               Submission submission)
        Resolve a submission action given a http request, a submission and its associated submission data bean. The submission action string returned is one of the action constants defined in SubmissionTargetResolver, e.g. SUBMISSION_ACTION_ATTACHMENT
        Parameters:
        request - the http request
        submission - the submission
        Returns:
        a map containing entries for SUBMISSION_ACTION (the next action) and SUBMISSION_LINK_URL (a URL to the next page)
      • resolveFormExpiryPath

        String resolveFormExpiryPath​(HttpServletRequest request,
                                     SubmissionDataBean submissionData)
        Resolve an URL path if a form is expired.
        Parameters:
        request - the http request
        submissionData - the submission data bean
        Returns:
        the URL path
      • resolveErrorPath

        String resolveErrorPath​(HttpServletRequest request,
                                SubmissionDataBean submissionData,
                                Throwable error,
                                ErrorLog errorLog)
        Resolve an URL path if there is an error occurs during the form process.
        Parameters:
        request - the http request
        submissionData - the submission data bean
        error - the throwable error
        errorLog - the associated error log
        Returns:
        the URL path
      • handleOnlineSubmission

        void handleOnlineSubmission​(Submission submission,
                                    HttpServletRequest request,
                                    HttpServletResponse response)
        Handle an online submission, redirecting the response to the next page.
        Parameters:
        submission - the submission
        request - the HTTP servlet request
        response - the HTTP servlet response