Package com.avoka.fc.core.util
Class PortalUtils
- java.lang.Object
-
- com.avoka.fc.core.util.PortalUtils
-
public class PortalUtils extends Object
Provides utility methods related to portals.
-
-
Field Summary
Fields Modifier and Type Field Description static String
FORM_PROPERTIES
The "formProperties" page model key.static String
PROPERTY_CLIENT_LOGO_URL
The auxiliary property holding the URL of the client logo
-
Constructor Summary
Constructors Constructor Description PortalUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
addContextToPath(Portal portal, String path)
Return a URL locating a resource relative to a portal's context path.static String
addContextToPath(String portalContext, String path)
Return a URL locating a resource relative to a portal's context path.static Map<String,String>
addFormAndVersionProperties(org.apache.click.Page page, Form form)
Add the form and template version property values to the given page model, and return the map.static String
addHttpsContextToPath(Portal portal, String path)
Return a URL locating a resource relative to a portal's context path.static String
addHttpsContextToPath(String portalContext, String path)
Return a URL locating a resource relative to a portal's context path.static Map<String,Object>
createTemplateModel(org.apache.click.Page page)
Return a model of the specified Click pagestatic String
getAccountPendingPath(Portal portal, UserAccount userAccount)
Return the account pending page path for the user.static String
getAdminFormEditPath(Long formId)
Return the form edit URL on the admin console.static String
getDefaultPortalPath(String pathName)
Return a URL locating a portal page on the default portal.static String
getFormDataServletUrl(Portal portal, boolean htmlForm)
Return the URL to access the dynamic form data servlet.static String
getFormErrorPath(Portal portal)
Return the URL to the"Form Error"
page on the given portal.static String
getFormLandingPagePath(Form form, Portal portal)
Return the landing page URL for the given form.static String
getFormLandingPagePath(Portal portal, String formCode)
Return the landing page URL for the given portal and form code.static String
getFormLandingPath(Portal portal)
Return the URL to the"Form Landing"
page on the given portal.static String
getFormNotFoundPath(HttpServletRequest request)
Return the URL to the"Form Not Found"
page for the given request.static String
getFormPagePath(Portal portal, String formCode, boolean registrationFlag)
Return the form page URL for the given portal, form code and registration flag.static String
getFormPageURL(Form form, Portal portal)
Return the URL to the form 'plugin' page for the portal.static String
getFormPath(Form form, Portal portal)
Return the form 'plug-in' page path for the form.static String
getFormPath(Portal portal)
Return the form 'plug-in' page path for the portal.static String
getFormReceiptURL(Portal portal, String submitKey)
Return the URL to access a rendered receipt.static String
getFormReceiptURL(Portal portal, String submitKey, String renderMode)
Return the URL to access a rendered receipt.static String
getFormReceiptURL(Submission submission, Portal portal)
Return the URL to access a rendered receipt.static String
getFormRenderURL(Form form, Portal portal)
Return the URL to access a rendered form.static String
getFormRenderURL(Form form, Portal portal, boolean includeSessionId)
Return the URL to access a rendered form.static String
getFormRenderURL(Form form, TemplateVersion templateVersion, boolean includePDFParams)
Return the form render URL including PDF open parameters if a PDF formstatic String
getFormRenderURL(Submission submission, Portal portal)
Return the URL to access a rendered saved form.static String
getFormRenderURL(String portalContext, TemplateVersion version)
Return the URL to access a rendered form.static String
getFormRenderURL(String portalContext, String formCode)
Deprecated.static String
getFormRenderURL(String portalContext, String formCode, boolean pdfForm)
Return the URL to access a rendered form.static String
getFormRenderURL(String portalContext, String formCode, String formType)
Return the URL to access a rendered form.static String
getFormSavedUrl(Portal portal, Submission submission)
Provide a return to saved form URL.static String
getFormSavedUrlWithReferenceNumber(Portal portal, Submission submission)
Provide a return to saved form URL with the submission reference number URL prefill parameter.static String
getFormTermsPagePath(Portal portal)
Return the URL to the"Form Terms and Conditions"
page on the given portal.static Map<String,String>
getFormVersionProperties(Form form, HttpServletRequest request)
Return the form template version property value map.static String
getFriendlyFormURL(Form form, Portal portal)
Return the Friendly URL for a given formstatic String
getFriendlyFormURL(String portalContext, String clientCode, String formName)
Return the Friendly URL for a given form, client and portalstatic List<String>
getListFromFilterConfig(FilterConfig filterConfig, String initParameter)
static String
getNotAuthorizedPath(Portal portal)
Return the URL to the"Not Authorized"
page on the given portal.static String
getNotSupportedPath(Portal portal)
Return the URL to the"Not Supported"
page on the given portal.static String
getOffLinePath(Portal portal)
Return the URL to the"Offline"
page on the given portal.static String
getOptionalPath(Portal portal, String pathName)
Returns a URL locating a portal page on a given portal or null if page not definedstatic String
getPath(Portal portal, String pageName)
Returns a URL locating a portal page on a given portal.static Portal
getPortal(HttpServletRequest request)
Return the SmartForm Manager portal associated with the specified request.static String
getPortalContext(HttpServletRequest request)
Extract the portal context URL from the given requeststatic String
getPropertyDeploy(Form form, String propertyName)
Return the property deploy value for a specific form and property namestatic String
getReceiptChallengeUrl(Portal portal, Submission submission)
Provide a receipt challenge URL.static String
getSafeFieldValue(String value, Class entityClass, String propertyName)
Return an escaped and Cayenne property length limited value.static String
getSaveChallengeUrl(Portal portal, Submission submission)
Provide a return to form saved challenge URL.static String
getSaveChallengeUrl(Portal portal, TemplateVersion version)
Provide a return to form saved challenge URL.static String
getSavedFormRenderURL(Submission submission, Portal portal, boolean useCurrentTemplateVersion)
Return the URL to access a rendered saved form, including additional PDF zoom parameters.static String
getSecureFormPath(Portal portal)
Return the URL to the"Secure Form"
page on the given portal.static String
getSecureFormReceiptURL(Submission submission, Portal portal)
Return the URL to securely access a rendered receipt (the user will be asked to log in).static String
getSecureFormRenderURL(Form form, Portal portal)
Return the URL to access a rendered form.static String
getSecureFormRenderURL(Submission submission, Portal portal)
Return the URL to access a rendered saved form.static String
getSecureFormRenderURL(Submission submission, Portal portal, boolean useCurrentTemplateVersion)
Return the URL to access a rendered saved form.static String
getSecureFormRenderURL(TemplateVersion version, Portal portal)
Return the URL to access a rendered form.static String
getSecureSubmissionSavedPath(Portal portal)
Return the URL to the"Submission Saved Secure"
page on the given portal.static String
getServerBusyPath(Portal portal)
Return the URL to the"Secure Form"
page on the given portal.static String
getSessionExpiredPath(Portal portal)
Return the form session expired page path for the portal.static String
getSessionExpiredPath(Submission submission)
Return the form session expired page path for the portal.static String
getSessionReestablishedPath(Portal portal)
Return the form session reestablished page path for the portal.static String
getSignatureReceiptURL(Portal portal, String submitKey, String renderMode)
Return the URL to access a signature receipt.static String
getSubmissionAttachmentPath(Portal portal)
Return the URL to the"Submission Attachment"
page on the given portal.static String
getSubmissionAttachmentSecurePath(Portal portal)
Return the URL to the"Submission Attachment Secure"
page on the given portal.static String
getSubmissionCancelledPath(Submission submission, Portal portal)
Return the URL to the custom cancelled page URL specified on the submission's form or otherwise the"Submission Cancelled"
page on the given portal.static String
getSubmissionConfirmationPath(Portal portal)
Return the URL to the"Submission Confirmation"
page on the given portal.static String
getSubmissionConfirmationSecurePath(Portal portal)
Return the URL to the"Submission Confirmation Secure"
page on the given portal.static String
getSubmissionEmailVerificationURL(Portal portal, Submission submission)
Return the full URL for the"Submission Email Verification"
page on the given portal and submission.static String
getSubmissionErrorsPath(Portal portal)
Return the URL to the"Submission Errors"
page on the given portal.static String
getSubmissionExpiredPath(Portal portal)
Return the URL to the"Submission Expired"
page on the given portal.static String
getSubmissionExpiredPath(Portal portal, Form form)
Return the URL to the"Submission Expired"
page on the given portal and portal.static String
getSubmissionFailedPath(Portal portal)
Return the URL to the"Submission Failed"
page on the given portal.static String
getSubmissionHostedPaymentPath(Portal portal)
Return the URL to the"Submission Payment Hosted"
page on the given portal.static String
getSubmissionHostedPaymentSecurePath(Portal portal)
Return the URL to the"Submission Payment Hosted Secure"
page on the given portal.static String
getSubmissionPaymentCompletePath(Portal portal)
Return the URL to the"Submission Payment Complete"
page on the given portal.static String
getSubmissionSavedPath(Portal portal)
Return the URL to the"Submission Saved"
page on the given portal.static String
getSubmissionWetSignaturePath(Portal portal)
Return the URL to thePortalPage.PAGE_Submission_Wet_Signature
page on the given portal.static String
getSubmissionWetSignatureSecurePath(Portal portal)
Return the URL to thePortalPage.PAGE_Submission_Wet_Signature_Secure
page on the given portal.static boolean
isRequestingOfflinePath(HttpServletRequest request, Portal portal)
Return whether a user is requesting the"Offline"
page for the given portalstatic String
mergeSubmissionRedirectUrlTemplate(String template, Submission submission, HttpServletRequest request)
Merge a redirect URL Velocity template with a model consisting of the submission ($submission), the HTTP servlet request ($request) and the data extract values ($formDataMap).static boolean
onSubmitCheck(org.apache.click.control.Form form, String pagePath, HttpServletRequest request, HttpServletResponse response)
Calls the performSubmitCheckstatic boolean
onSubmitCheck(org.apache.click.control.Form form, org.apache.click.Page page, Class<? extends org.apache.click.Page> pageClass)
Calls the performSubmitCheckstatic boolean
performSubmitCheck(org.apache.click.control.Form form)
Perform a back button submit check, returning true if the request is valid or false otherwise.static void
redirectToNextPage(Submission submission, HttpServletRequest request, HttpServletResponse response)
Set a redirect to the next suitable page for a submissionstatic String
renderTemplate(String template, org.apache.click.Page page)
Render the Velocity template contents using the context of the provided page.static void
setRedirectFromPagePath(String pagePath, Map<String,?> params, HttpServletRequest request, HttpServletResponse response)
Redirect the request to the specified location with the given parameters.
-
-
-
Field Detail
-
PROPERTY_CLIENT_LOGO_URL
public static final String PROPERTY_CLIENT_LOGO_URL
The auxiliary property holding the URL of the client logo- See Also:
- Constant Field Values
-
FORM_PROPERTIES
public static final String FORM_PROPERTIES
The "formProperties" page model key.- See Also:
- Constant Field Values
-
-
Method Detail
-
renderTemplate
public static String renderTemplate(String template, org.apache.click.Page page)
Render the Velocity template contents using the context of the provided page.- Parameters:
template
- velocity templatepage
- the page context- Returns:
- the rendered velocity template
-
getPortal
public static Portal getPortal(HttpServletRequest request)
Return the SmartForm Manager portal associated with the specified request. The portal is looked up by context path.- Parameters:
request
- the HTTP servlet request- Returns:
- the portal associated from the request, null if no portal matches the request context
-
getFormLandingPagePath
public static String getFormLandingPagePath(Form form, Portal portal)
Return the landing page URL for the given form.- Parameters:
form
- the non-null formportal
- a forms portal (required)- Returns:
- the full landing page URL
-
getFormLandingPagePath
public static String getFormLandingPagePath(Portal portal, String formCode)
Return the landing page URL for the given portal and form code.- Parameters:
portal
- the non-null portalformCode
- the form code of a form associated with the portal- Returns:
- the full landing page URL
-
getFriendlyFormURL
public static String getFriendlyFormURL(Form form, Portal portal)
Return the Friendly URL for a given form- Parameters:
form
- the non-null form containing references to a valid client and portalportal
- a forms portal- Returns:
- the full Friendly URL
-
getFriendlyFormURL
public static String getFriendlyFormURL(String portalContext, String clientCode, String formName)
Return the Friendly URL for a given form, client and portal- Parameters:
portalContext
- the URL associated with the portalclientCode
- the client code of the client that the form belongs toformName
- the name of the form- Returns:
- the full Friendly URL
-
getFormRenderURL
@Deprecated public static String getFormRenderURL(String portalContext, String formCode)
Deprecated.Return the URL to access a rendered form.- Parameters:
portalContext
- the URL associated with the form's portalformCode
- the form code of the form- Returns:
- the full form render URL
-
getFormRenderURL
public static String getFormRenderURL(Form form, TemplateVersion templateVersion, boolean includePDFParams)
Return the form render URL including PDF open parameters if a PDF form- Parameters:
form
- the formtemplateVersion
- the template versionincludePDFParams
- include the PDF open parameters- Returns:
- the PDF form render URL
-
getFormRenderURL
public static String getFormRenderURL(String portalContext, String formCode, boolean pdfForm)
Return the URL to access a rendered form.- Parameters:
portalContext
- the URL associated with the form's portalformCode
- the form code of the formpdfForm
- the is a PDF form- Returns:
- the full form render URL
-
getFormRenderURL
public static String getFormRenderURL(String portalContext, String formCode, String formType)
Return the URL to access a rendered form.- Parameters:
portalContext
- the URL associated with the form's portalformCode
- the form code of the formformType
- the form type- Returns:
- the full form render URL
- Since:
- 17.10.0
-
getFormRenderURL
public static String getFormRenderURL(String portalContext, TemplateVersion version)
Return the URL to access a rendered form.- Parameters:
portalContext
- the URL associated with the form's portalversion
- the form version- Returns:
- the full form render URL
- Since:
- 17.10.0
-
getSecureFormRenderURL
public static String getSecureFormRenderURL(Form form, Portal portal)
Return the URL to access a rendered form. Users will have to log on to access the form.- Parameters:
form
- the non-null formportal
- a forms portal (required)- Returns:
- the full secure form render URL
-
getSecureFormRenderURL
public static String getSecureFormRenderURL(TemplateVersion version, Portal portal)
Return the URL to access a rendered form. Users will have to log on to access the form.- Parameters:
version
- the form version to renderportal
- a forms portal (required)- Returns:
- the full secure form render URL
- Since:
- 18.10.0
-
getSecureFormRenderURL
public static String getSecureFormRenderURL(Submission submission, Portal portal)
Return the URL to access a rendered saved form. Users will have to log on to access the form. When rendering the form, the original form template version will be used.- Parameters:
submission
- the non-null saved submission which is associated with a valid portal (required)portal
- a forms portal (required)- Returns:
- the full secure form render URL, or null if neither the submission nor the form is not associated with the portal
-
getSecureFormRenderURL
public static String getSecureFormRenderURL(Submission submission, Portal portal, boolean useCurrentTemplateVersion)
Return the URL to access a rendered saved form. Users will have to log on to access the form.- Parameters:
submission
- the non-null saved submission which is associated with a valid portal (required)portal
- a forms portal (required)useCurrentTemplateVersion
- a flag that determines whether to use the form's current template version when rendering the receipt, or to use the same template version that was used when the form was originally rendered- Returns:
- the full secure form render URL
-
getFormRenderURL
public static String getFormRenderURL(Form form, Portal portal)
Return the URL to access a rendered form.- Parameters:
form
- the non-null formportal
- a forms portal (required)- Returns:
- the full form render URL
-
getFormRenderURL
public static String getFormRenderURL(Form form, Portal portal, boolean includeSessionId)
Return the URL to access a rendered form.- Parameters:
form
- the non-null form which is associated with a valid portalportal
- a forms portal (required)includeSessionId
- specify whether to include the jsessionid in the URL- Returns:
- the full form render URL
-
getFormRenderURL
public static String getFormRenderURL(Submission submission, Portal portal)
Return the URL to access a rendered saved form. When rendering the form, the original form template version will be used.- Parameters:
submission
- the non-null saved submissionportal
- a forms portal- Returns:
- the full form render URL
-
getFormDataServletUrl
public static String getFormDataServletUrl(Portal portal, boolean htmlForm)
Return the URL to access the dynamic form data servlet.- Parameters:
portal
- the non-null portalhtmlForm
- whether the form in question is a HTML form- Returns:
- the full dynamic form data servlet URL
-
getSavedFormRenderURL
public static String getSavedFormRenderURL(Submission submission, Portal portal, boolean useCurrentTemplateVersion)
Return the URL to access a rendered saved form, including additional PDF zoom parameters. Users will have to log on to access the form.- Parameters:
submission
- the non-null saved submissionportal
- a form portal that the submission is visible onuseCurrentTemplateVersion
- a flag that determines whether to use the form's current template version when rendering the receipt, or to use the same template version that was used when the form was originally rendered- Returns:
- the full form render URL or null if the submission is not associated with a portal
-
getFormReceiptURL
public static String getFormReceiptURL(Portal portal, String submitKey)
Return the URL to access a rendered receipt.- Parameters:
portal
- a forms portal associated with the submission or its formsubmitKey
- the surrogate key of the submission- Returns:
- the full receipt render URL
-
getFormReceiptURL
public static String getFormReceiptURL(Portal portal, String submitKey, String renderMode)
Return the URL to access a rendered receipt.- Parameters:
portal
- a forms portal associated with the submission or its formsubmitKey
- the surrogate key of the submissionrenderMode
- how to render the receipt to the user (seeParams.REQUEST_RenderMode
)- Returns:
- the full receipt render URL, or null if the submission or portal could not be resolved
-
getSignatureReceiptURL
public static String getSignatureReceiptURL(Portal portal, String submitKey, String renderMode)
Return the URL to access a signature receipt.- Parameters:
portal
- a forms portal associated with the submission or its formsubmitKey
- the surrogate key of the submissionrenderMode
- how to render the receipt to the user (seeParams.REQUEST_RenderMode
)- Returns:
- the full signature receipt render URL, or null if the submission or portal could not be resolved
-
getFormReceiptURL
public static String getFormReceiptURL(Submission submission, Portal portal)
Return the URL to access a rendered receipt.- Parameters:
submission
- the non-null submission associated with a valid portalportal
- a forms portal on which the submission is visible- Returns:
- the full receipt render URL, or null if the submission is not associated with a portal
-
getSecureFormReceiptURL
public static String getSecureFormReceiptURL(Submission submission, Portal portal)
Return the URL to securely access a rendered receipt (the user will be asked to log in).- Parameters:
submission
- the non-null submission associated with a valid portalportal
- a forms portal on which the submission is visible- Returns:
- the full secure receipt render URL, or null if the submission is not associated with a portal
- Since:
- 5.1.0
-
addContextToPath
public static String addContextToPath(Portal portal, String path)
Return a URL locating a resource relative to a portal's context path. A slash character ('/') will be inserted between the two path components if necessary.- Parameters:
portal
- the portal to be used to determine the context pathpath
- the relative path to be appended to the portal context path- Returns:
- the full URL combining the portal context and relative paths
-
addContextToPath
public static String addContextToPath(String portalContext, String path)
Return a URL locating a resource relative to a portal's context path. A slash character ('/') will be inserted between the two path components if necessary.- Parameters:
portalContext
- the portal context pathpath
- the relative path to be appended to the portal context path- Returns:
- the full URL combining the portal context and relative paths
-
addHttpsContextToPath
public static String addHttpsContextToPath(Portal portal, String path)
Return a URL locating a resource relative to a portal's context path. A slash character ('/') will be inserted between the two path components if necessary. This method will return a URL that uses the HTTPS protocol.- Parameters:
portal
- the portal to be used to determine the context pathpath
- the relative path to be appended to the portal context path- Returns:
- the full URL combining the portal context and relative paths
-
addHttpsContextToPath
public static String addHttpsContextToPath(String portalContext, String path)
Return a URL locating a resource relative to a portal's context path. A slash character ('/') will be inserted between the two path components if necessary. This method will return a URL that uses the HTTPS protocol.- Parameters:
portalContext
- the portal context pathpath
- the relative path to be appended to the portal context path- Returns:
- the full URL combining the portal context and relative paths
-
getDefaultPortalPath
public static String getDefaultPortalPath(String pathName) throws ApplicationException
Return a URL locating a portal page on the default portal.- Parameters:
pathName
- the name of the portal page that shall be located (_PortalPage.NAME_PROPERTY
)- Returns:
- the full URL of the specified portal page on the default portal
- Throws:
ApplicationException
- if no portal is marked as the default, or no PortalPage object with the specified name exists for the default portal
-
getPath
public static String getPath(Portal portal, String pageName) throws ApplicationException
Returns a URL locating a portal page on a given portal.- Parameters:
portal
- the non-null portalpageName
- the name (not empty) of the portal page that shall be located (_PortalPage.NAME_PROPERTY
)- Returns:
- the full URL of the specified portal page on the given portal
- Throws:
ApplicationException
- if no PortalPage object with the specified name exists for the portal
-
getAdminFormEditPath
public static String getAdminFormEditPath(Long formId)
Return the form edit URL on the admin console.- Parameters:
formId
- the OID of the form- Returns:
- the URL to the form edit page, or an empty string if the admin console portal could not be located
- Since:
- 4.0.0
-
getOptionalPath
public static String getOptionalPath(Portal portal, String pathName)
Returns a URL locating a portal page on a given portal or null if page not defined- Parameters:
portal
- the non-null portalpathName
- the name (not empty) of the portal page that shall be located (_PortalPage.NAME_PROPERTY
)- Returns:
- the full URL of the specified portal page on the given portal
-
getAccountPendingPath
public static String getAccountPendingPath(Portal portal, UserAccount userAccount)
Return the account pending page path for the user.- Parameters:
portal
- a forms portal (required)userAccount
- the user account (required)- Returns:
- the Account Pending page path on the portal for the specified user.
-
getFormErrorPath
public static String getFormErrorPath(Portal portal)
Return the URL to the"Form Error"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Form Error"
portal page
-
getFormLandingPath
public static String getFormLandingPath(Portal portal)
Return the URL to the"Form Landing"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Form Landing"
portal page
-
getFormNotFoundPath
public static String getFormNotFoundPath(HttpServletRequest request)
Return the URL to the"Form Not Found"
page for the given request.- Parameters:
request
- the non-nullHttpServletRequest
- Returns:
- the full URL of the
"Form Not Found"
portal page
-
getFormPath
public static String getFormPath(Portal portal)
Return the form 'plug-in' page path for the portal.- Parameters:
portal
- the form portal- Returns:
- the form 'plug-in' page path for the portal.
-
getFormPath
public static String getFormPath(Form form, Portal portal)
Return the form 'plug-in' page path for the form.- Parameters:
form
- the form (required)portal
- a forms portal (required)- Returns:
- the form 'plug-in' page path for the form, using the configured portal and form code.
-
getFormPageURL
public static String getFormPageURL(Form form, Portal portal)
Return the URL to the form 'plugin' page for the portal.- Parameters:
form
- the form to get the render URL forportal
- a forms portal associated with the form- Returns:
- the URL to the form 'plugin' page for the portal.
-
getFormPagePath
public static String getFormPagePath(Portal portal, String formCode, boolean registrationFlag)
Return the form page URL for the given portal, form code and registration flag.- Parameters:
portal
- the non-null portalformCode
- the form code of a form associated with the portalregistrationFlag
- whether the form requires registration- Returns:
- the full form page URL
-
getFormTermsPagePath
public static String getFormTermsPagePath(Portal portal)
Return the URL to the"Form Terms and Conditions"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Incompatible Reader Version"
portal page
-
getFormSavedUrl
public static String getFormSavedUrl(Portal portal, Submission submission)
Provide a return to saved form URL.- Parameters:
portal
- the associated portalsubmission
- the form submission- Returns:
- a return to saved form URL
- Since:
- 3.6.0
-
getSaveChallengeUrl
public static String getSaveChallengeUrl(Portal portal, Submission submission)
Provide a return to form saved challenge URL.- Parameters:
portal
- the associated portalsubmission
- the form submission- Returns:
- a return to form save challenge URL
- Since:
- 4.0.0
-
getReceiptChallengeUrl
public static String getReceiptChallengeUrl(Portal portal, Submission submission)
Provide a receipt challenge URL.- Parameters:
portal
- the associated portalsubmission
- the form submission- Returns:
- a receipt challenge URL
- Since:
- 5.1.0
-
getSaveChallengeUrl
public static String getSaveChallengeUrl(Portal portal, TemplateVersion version)
Provide a return to form saved challenge URL.- Parameters:
portal
- the associated portalversion
- the form template version- Returns:
- a return to form save challenge URL
- Since:
- 4.1.0
-
getFormSavedUrlWithReferenceNumber
public static String getFormSavedUrlWithReferenceNumber(Portal portal, Submission submission)
Provide a return to saved form URL with the submission reference number URL prefill parameter.- Parameters:
portal
- the associated portalsubmission
- the form submission- Returns:
- a return to saved form URL
- Since:
- 4.0.0
-
getNotAuthorizedPath
public static String getNotAuthorizedPath(Portal portal)
Return the URL to the"Not Authorized"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Not Authorized"
portal page
-
getNotSupportedPath
public static String getNotSupportedPath(Portal portal)
Return the URL to the"Not Supported"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Not Supported"
portal page
-
getOffLinePath
public static String getOffLinePath(Portal portal)
Return the URL to the"Offline"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Offline"
portal page
-
isRequestingOfflinePath
public static boolean isRequestingOfflinePath(HttpServletRequest request, Portal portal)
Return whether a user is requesting the"Offline"
page for the given portal- Parameters:
request
- the HTTP servlet requestportal
- the non-null portal- Returns:
- whether the request relates to the portal's
"Offline"
page
-
getServerBusyPath
public static String getServerBusyPath(Portal portal)
Return the URL to the"Secure Form"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Secure Form"
portal page
-
getSessionExpiredPath
public static String getSessionExpiredPath(Portal portal)
Return the form session expired page path for the portal.- Parameters:
portal
- the form portal- Returns:
- the form session expired page path for the portal
- Since:
- 4.1.0
-
getSessionExpiredPath
public static String getSessionExpiredPath(Submission submission)
Return the form session expired page path for the portal.- Parameters:
submission
- the form submission- Returns:
- the form session expired page path for the portal
- Since:
- 5.0.0
-
getSessionReestablishedPath
public static String getSessionReestablishedPath(Portal portal)
Return the form session reestablished page path for the portal.- Parameters:
portal
- the form portal- Returns:
- the form session reestablished page path for the portal
- Since:
- 4.1.0
-
getSecureFormPath
public static String getSecureFormPath(Portal portal)
Return the URL to the"Secure Form"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Secure Form"
portal page
-
getSubmissionAttachmentPath
public static String getSubmissionAttachmentPath(Portal portal)
Return the URL to the"Submission Attachment"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Attachment"
portal page
-
getSubmissionAttachmentSecurePath
public static String getSubmissionAttachmentSecurePath(Portal portal)
Return the URL to the"Submission Attachment Secure"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Attachment Secure"
portal page
-
getSubmissionCancelledPath
public static String getSubmissionCancelledPath(Submission submission, Portal portal)
Return the URL to the custom cancelled page URL specified on the submission's form or otherwise the"Submission Cancelled"
page on the given portal.- Parameters:
submission
- the submission (optional)portal
- the non-null portal- Returns:
- the full URL of the
"Submission Cancelled"
portal page
-
getSubmissionConfirmationPath
public static String getSubmissionConfirmationPath(Portal portal)
Return the URL to the"Submission Confirmation"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Confirmation"
portal page
-
getSubmissionConfirmationSecurePath
public static String getSubmissionConfirmationSecurePath(Portal portal)
Return the URL to the"Submission Confirmation Secure"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Confirmation Secure"
portal page
-
getSubmissionEmailVerificationURL
public static String getSubmissionEmailVerificationURL(Portal portal, Submission submission)
Return the full URL for the"Submission Email Verification"
page on the given portal and submission.- Parameters:
portal
- the non-null portalsubmission
- the submission (required)- Returns:
- the full URL of the
"Submission Email Verification"
portal page
-
getSubmissionErrorsPath
public static String getSubmissionErrorsPath(Portal portal)
Return the URL to the"Submission Errors"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Errors"
portal page
-
getSubmissionExpiredPath
public static String getSubmissionExpiredPath(Portal portal)
Return the URL to the"Submission Expired"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Expired"
portal page
-
getSubmissionExpiredPath
public static String getSubmissionExpiredPath(Portal portal, Form form)
Return the URL to the"Submission Expired"
page on the given portal and portal.- Parameters:
portal
- the portal (required)form
- the form (required)- Returns:
- the full URL of the
"Submission Expired"
portal page - Since:
- 3.6.0
-
getSubmissionFailedPath
public static String getSubmissionFailedPath(Portal portal)
Return the URL to the"Submission Failed"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Failed"
portal page
-
getSubmissionHostedPaymentPath
public static String getSubmissionHostedPaymentPath(Portal portal)
Return the URL to the"Submission Payment Hosted"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Payment Hosted"
portal page
-
getSubmissionHostedPaymentSecurePath
public static String getSubmissionHostedPaymentSecurePath(Portal portal)
Return the URL to the"Submission Payment Hosted Secure"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Payment Hosted Secure"
portal page
-
getSubmissionPaymentCompletePath
public static String getSubmissionPaymentCompletePath(Portal portal)
Return the URL to the"Submission Payment Complete"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Payment Complete"
portal page
-
getSubmissionSavedPath
public static String getSubmissionSavedPath(Portal portal)
Return the URL to the"Submission Saved"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Saved"
portal page
-
getSecureSubmissionSavedPath
public static String getSecureSubmissionSavedPath(Portal portal)
Return the URL to the"Submission Saved Secure"
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
"Submission Saved Secure"
portal page
-
getSubmissionWetSignaturePath
public static String getSubmissionWetSignaturePath(Portal portal)
Return the URL to thePortalPage.PAGE_Submission_Wet_Signature
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
PortalPage.PAGE_Submission_Wet_Signature
portal page
-
getSubmissionWetSignatureSecurePath
public static String getSubmissionWetSignatureSecurePath(Portal portal)
Return the URL to thePortalPage.PAGE_Submission_Wet_Signature_Secure
page on the given portal.- Parameters:
portal
- the non-null portal- Returns:
- the full URL of the
PortalPage.PAGE_Submission_Wet_Signature_Secure
portal page
-
getPropertyDeploy
public static String getPropertyDeploy(Form form, String propertyName)
Return the property deploy value for a specific form and property name- Parameters:
form
- the formpropertyName
- the name of the property deploy that shall be resolved- Returns:
- the value of the PropertyDeploy object for the given form and property name, or null if no such value exists
-
getFormVersionProperties
public static Map<String,String> getFormVersionProperties(Form form, HttpServletRequest request)
Return the form template version property value map.- Parameters:
form
- the formrequest
- the user request- Returns:
- the added form properties map
- Since:
- 4.0.0
-
addFormAndVersionProperties
public static Map<String,String> addFormAndVersionProperties(org.apache.click.Page page, Form form)
Add the form and template version property values to the given page model, and return the map.- Parameters:
page
- the page to add the "form" and "formProperties" toform
- the form- Returns:
- the added form properties map.
-
setRedirectFromPagePath
public static void setRedirectFromPagePath(String pagePath, Map<String,?> params, HttpServletRequest request, HttpServletResponse response)
Redirect the request to the specified location with the given parameters.- Parameters:
pagePath
- the targeting page relative path (required)params
- the request parameter (required))request
- HttpServletRequest (required))response
- HttpServletResponse (required))- Since:
- 21.11.0
-
getPortalContext
public static String getPortalContext(HttpServletRequest request)
Extract the portal context URL from the given request- Parameters:
request
- the HTTP servlet request- Returns:
- The part of the URL consisting of protocol, host name and context path. For example, if the request URL is "http://www.formcenter.org/myportal/login.htm", the call will return "http://www.formcenter.org/myportal/".
-
createTemplateModel
public static Map<String,Object> createTemplateModel(org.apache.click.Page page)
Return a model of the specified Click page- Parameters:
page
- the Click page- Returns:
- a map containing all fields and their values
-
redirectToNextPage
public static void redirectToNextPage(Submission submission, HttpServletRequest request, HttpServletResponse response)
Set a redirect to the next suitable page for a submission- Parameters:
submission
- the submission (required)request
- the HTTP servlet request (required)response
- the HTTP servlet response (required)
-
getSafeFieldValue
public static String getSafeFieldValue(String value, Class entityClass, String propertyName)
Return an escaped and Cayenne property length limited value.- Parameters:
value
- the value to escape and length limitentityClass
- the Cayenne entity classpropertyName
- the Cayenne entity field name- Returns:
- the escaped and field length limited value
- Since:
- 3.6.0
-
mergeSubmissionRedirectUrlTemplate
public static String mergeSubmissionRedirectUrlTemplate(String template, Submission submission, HttpServletRequest request)
Merge a redirect URL Velocity template with a model consisting of the submission ($submission), the HTTP servlet request ($request) and the data extract values ($formDataMap).- Parameters:
template
- the URL template string (required)submission
- the submission (required)request
- the HTTP servlet request (optional though the template string may contain references to it)- Returns:
- the string resulting from the merge operation
- Since:
- 4.1.0
-
onSubmitCheck
public static boolean onSubmitCheck(org.apache.click.control.Form form, org.apache.click.Page page, Class<? extends org.apache.click.Page> pageClass)
Calls the performSubmitCheck- Returns:
- true if the submit is OK otherwise performs a redirect
- Since:
- 19.11.0
-
onSubmitCheck
public static boolean onSubmitCheck(org.apache.click.control.Form form, String pagePath, HttpServletRequest request, HttpServletResponse response)
Calls the performSubmitCheck- Parameters:
form
- org.apache.click.control.Form (required))pagePath
- the targeting page relative path (required)request
- HttpServletRequest (required))response
- HttpServletResponse (required))- Returns:
- boolean true if the submit is OK otherwise performs a redirect
- Since:
- 21.11.0
-
performSubmitCheck
public static boolean performSubmitCheck(org.apache.click.control.Form form)
Perform a back button submit check, returning true if the request is valid or false otherwise. This method will add a submit check token to the form as a hidden field, and to the session.- Returns:
- true if the submit is OK or false otherwise
- Since:
- 19.11.0
-
getListFromFilterConfig
public static List<String> getListFromFilterConfig(FilterConfig filterConfig, String initParameter)
-
-