Package com.avoka.fc.core.util
Class PortalUtils
java.lang.Object
com.avoka.fc.core.util.PortalUtils
Provides utility methods related to portals.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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.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.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
getFormNotFoundPath
(jakarta.servlet.http.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.getFormVersionProperties
(Form form, jakarta.servlet.http.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 portalgetListFromFilterConfig
(jakarta.servlet.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
Returns a URL locating a portal page on a given portal.static Portal
getPortal
(jakarta.servlet.http.HttpServletRequest request) Return the SmartForm Manager portal associated with the specified request.static String
getPortalContext
(jakarta.servlet.http.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
getSubmissionAttachmentPath
(Portal portal) Return the URL to the"Submission Attachment"
page on the given portal.static String
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
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
Return the URL to the"Submission Payment Hosted Secure"
page on the given portal.static String
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 boolean
Return whether the clientKey"clientKey"
needs to be added to render url of the given portalstatic boolean
isRequestingOfflinePath
(jakarta.servlet.http.HttpServletRequest request, Portal portal) Return whether a user is requesting the"Offline"
page for the given portalstatic boolean
isValidFileName
(String fileName) Return true if the specified filename is valid.static String
mergeSubmissionRedirectUrlTemplate
(String template, Submission submission, jakarta.servlet.http.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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Redirect the request to the specified location with the given parameters.
-
Field Details
-
PROPERTY_CLIENT_LOGO_URL
The auxiliary property holding the URL of the client logo- See Also:
-
FORM_PROPERTIES
The "formProperties" page model key.- See Also:
-
-
Constructor Details
-
PortalUtils
public PortalUtils()
-
-
Method Details
-
renderTemplate
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
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
-
getFriendlyFormURL
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
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.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
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
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
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
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
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
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
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
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
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
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
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
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
-
getFormReceiptURL
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
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
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
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
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
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
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
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
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
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
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
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
-
getFormNotFoundPath
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
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
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
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
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
-
getFormSavedUrl
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
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
Provide a receipt challenge URL.- Parameters:
portal
- the associated portalsubmission
- the form submission- Returns:
- a receipt challenge URL
- Since:
- 5.1.0
-
getSaveChallengeUrl
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
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
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
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
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(jakarta.servlet.http.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
-
isClientKeyRequiredForRenderUrl
Return whether the clientKey"clientKey"
needs to be added to render url of the given portal- Parameters:
portal
- the non-null portal- Returns:
- whether the clientKey
"clientKey"
is required for render url - Since:
- 23.10.0
-
getServerBusyPath
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-
getPropertyDeploy
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, jakarta.servlet.http.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
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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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
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
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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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
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, jakarta.servlet.http.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, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.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
-
isValidFileName
Return true if the specified filename is valid.- Parameters:
fileName
- the filename to validate- Returns:
- true if the given filename is valid
- Throws:
ApplicationException
- if the reg expression is invalid- Since:
- 24.4.0
-