| org.opencms.jsp.CmsJspActionElement com.alkacon.opencms.formgenerator.CmsFormHandler
All known Subclasses: com.alkacon.opencms.registration.CmsRegistrationFormHandler,
CmsFormHandler | public class CmsFormHandler extends CmsJspActionElement (Code) | | The form handler controls the html or mail output of a configured email form.
Provides methods to determine the action that takes place and methods to create different
output formats of a submitted form.
author: Andreas Zahner author: Thomas Weckert author: Jan Baudisch version: $Revision: 1.5 $ since: 7.0.4 |
ACTION_CONFIRMED | final public static String ACTION_CONFIRMED(Code) | | Request parameter value for the form action parameter: correct the input.
|
ACTION_CORRECT_INPUT | final public static String ACTION_CORRECT_INPUT(Code) | | Request parameter value for the form action parameter: correct the input.
|
ACTION_DOWNLOAD_DATA_1 | final public static String ACTION_DOWNLOAD_DATA_1(Code) | | Request parameter value for the form action parameter: Jump to the download page of the csv data (allow only for offline project!!!).
|
ACTION_DOWNLOAD_DATA_2 | final public static String ACTION_DOWNLOAD_DATA_2(Code) | | Request parameter value for the form action parameter: Download the csv data.
|
ACTION_SUBMIT | final public static String ACTION_SUBMIT(Code) | | Request parameter value for the form action parameter: form submitted.
|
ATTRIBUTE_FILEITEMS | final public static String ATTRIBUTE_FILEITEMS(Code) | | Name of the file item session attribute.
|
ERROR_MANDATORY | final public static String ERROR_MANDATORY(Code) | | Form error: mandatory field not filled out.
|
ERROR_VALIDATION | final public static String ERROR_VALIDATION(Code) | | Form error: validation error of input.
|
MACRO_DATE | final public static String MACRO_DATE(Code) | | Macro name for the date macro that can be used in mail text fields.
|
MACRO_FORMDATA | final public static String MACRO_FORMDATA(Code) | | Macro name for the form data macro that can be used in mail text fields.
|
PARAM_FORMACTION | final public static String PARAM_FORMACTION(Code) | | Request parameter name for the hidden form action parameter to determine the action.
|
m_errors | protected Map m_errors(Code) | | Contains eventual validation errors.
|
m_formConfiguration | protected CmsForm m_formConfiguration(Code) | | The form configuration object.
|
m_hiddenFields | protected String m_hiddenFields(Code) | | Temporarily stores the fields as hidden fields in the String.
|
m_initial | protected boolean m_initial(Code) | | Flag indicating if the form is displayed for the first time.
|
m_isValidatedCorrect | protected Boolean m_isValidatedCorrect(Code) | | Boolean indicating if the form is validated correctly.
|
m_macroResolver | protected transient CmsMacroResolver m_macroResolver(Code) | | Needed to implant form fields into the mail text.
|
m_messages | protected CmsMessages m_messages(Code) | | The localized messages for the form handler.
|
m_mulipartFileItems | protected List m_mulipartFileItems(Code) | | The multipart file items.
|
m_parameterMap | protected Map m_parameterMap(Code) | | The map of request parameters.
|
CmsFormHandler | public CmsFormHandler(PageContext context, HttpServletRequest req, HttpServletResponse res) throws Exception(Code) | | Constructor, creates the necessary form configuration objects.
Parameters: context - the JSP page context object Parameters: req - the JSP request Parameters: res - the JSP response throws: Exception - if creating the form configuration objects fails |
CmsFormHandler | public CmsFormHandler(PageContext context, HttpServletRequest req, HttpServletResponse res, String formConfigUri) throws Exception(Code) | | Constructor, creates the necessary form configuration objects using a given configuration file URI.
Parameters: context - the JSP page context object Parameters: req - the JSP request Parameters: res - the JSP response Parameters: formConfigUri - URI of the form configuration file, if not provided, current URI is used for configuration throws: Exception - if creating the form configuration objects fails |
convertToHtmlValue | public String convertToHtmlValue(String value)(Code) | | Replaces line breaks with html <br>.
Parameters: value - the value to substitute the substituted value |
convertToPlainValue | public String convertToPlainValue(String value)(Code) | | Replaces html <br> with line breaks.
Parameters: value - the value to substitute the substituted value |
convertValue | public String convertValue(String value, String outputType)(Code) | | Converts a given String value to the desired output format.
The following output formats are possible:
- "html" meaning that <br> tags are added
- "plain" or any other String value meaning that <br> tags are removed
Parameters: value - the String value to convert Parameters: outputType - the type of the resulting output the converted String in the desired output format |
createHiddenFields | public String createHiddenFields()(Code) | | Returns the configured form field values as hidden input fields.
the configured form field values as hidden input fields |
createInternetAddresses | protected List createInternetAddresses(String mailAddresses) throws AddressException(Code) | | Creates a list of internet addresses (email) from a semicolon separated String.
Parameters: mailAddresses - a semicolon separated String with email addresses list of internet addresses (email) throws: AddressException - if an email address is not correct |
createMailTextFromFields | public String createMailTextFromFields(boolean isHtmlMail, boolean isConfirmationMail)(Code) | | Creates the output String of the submitted fields for email creation.
Parameters: isHtmlMail - if true, the output is formatted as HTML, otherwise as plain text Parameters: isConfirmationMail - if true, the text for the confirmation mail is created, otherwise the text for mail receiver the output String of the submitted fields for email creation |
downloadData | public boolean downloadData()(Code) | | Returns if the data download should be initiated.
true if the data download should be initiated, otherwise false |
getErrors | public Map getErrors()(Code) | | Returns the errors found when validating the form.
the errors found when validating the form |
getFormCheckText | public String getFormCheckText()(Code) | | Returns the check page text, after resolving macros.
the check page text |
getFormConfiguration | public CmsForm getFormConfiguration()(Code) | | Returns the form configuration.
the form configuration |
getFormConfirmationText | public String getFormConfirmationText()(Code) | | Returns the confirmation text, after resolving macros.
the confirmation text |
getMessages | public CmsMessages getMessages()(Code) | | Returns the localized messages.
the localized messages |
getParameter | protected String getParameter(String parameter)(Code) | | Returns the request parameter with the specified name.
Parameters: parameter - the parameter to return the parameter value |
getParameterMap | public Map getParameterMap()(Code) | | Returns the map of request parameters.
the map of request parameters |
getUploadFile | public FileItem getUploadFile(I_CmsField isFileUploadField)(Code) | | Return null or the file item for the given field in
case it is of type
CmsFileUploadField .
Parameters: isFileUploadField - the field to the the file item of null or the file item for the given field in case it is of type CmsFileUploadField |
hasValidationErrors | public boolean hasValidationErrors()(Code) | | Returns if the submitted values contain validation errors.
true if the submitted values contain validation errors, otherwise false |
init | public void init(HttpServletRequest req, String formConfigUri) throws Exception(Code) | | Initializes the form handler and creates the necessary configuration objects.
Parameters: req - the JSP request Parameters: formConfigUri - URI of the form configuration file, if not provided, current URI is used for configuration throws: Exception - if creating the form configuration objects fails |
isInitial | public boolean isInitial()(Code) | | Returns if the form is displayed for the first time.
true if the form is displayed for the first time, otherwise false |
sendConfirmationMail | public void sendConfirmationMail() throws Exception(Code) | | Sends the confirmation mail with the form data to the specified email address.
throws: Exception - if sending the confirmation mail fails |
sendData | public boolean sendData()(Code) | | Sends the collected data due to the configuration of the form
(email, database or both).
true if successful |
sendDatabase | protected boolean sendDatabase() throws Exception(Code) | | Stores the given form data in the database.
true if successful throws: Exception - if something goes wrong |
sendMail | protected boolean sendMail()(Code) | | Sends the mail with the form data to the specified recipients.
If configured, sends also a confirmation mail to the form submitter.
true if the mail has been successfully sent, otherwise false |
setFormConfiguration | protected void setFormConfiguration(CmsForm configuration)(Code) | | Sets the form configuration.
Parameters: configuration - the form configuration |
setInitial | protected void setInitial(boolean initial)(Code) | | Sets if the form is displayed for the first time.
Parameters: initial - true if the form is displayed for the first time, otherwise false |
setMessages | protected void setMessages(CmsMessages messages)(Code) | | Sets the localized messages.
Parameters: messages - the localized messages |
showCheck | public boolean showCheck()(Code) | | Returns if the optional check page should be displayed.
true if the optional check page should be displayed, otherwise false |
showDownloadData | public boolean showDownloadData()(Code) | | Returns if the data download page should be displayed.
true if the data download page should be displayed, otherwise false |
showForm | public boolean showForm()(Code) | | Returns if the input form should be displayed.
true if the input form should be displayed, otherwise false |
showTemplate | public boolean showTemplate()(Code) | | Returns if template head or other HTML should be inclulded (the page does not serve as a download page).
true if template head or other HTML should be inclulded (the page does not serve as a download page) |
useInFormDataMacro | protected boolean useInFormDataMacro(I_CmsField field)(Code) | | Checks if the given field should be used in form data macros.
Parameters: field - the field to check if the given field should be used in form data macros |
validate | public boolean validate()(Code) | | Validation method that checks the given input fields.
All errors are stored in the member m_errors Map, with the input field name as key
and the error message String as value.
true if all necessary fields can be validated, otherwise false |
Methods inherited from org.opencms.jsp.CmsJspActionElement | public void editable(boolean isEditable) throws JspException(Code)(Java Doc) public void editable(boolean isEditable, String filename) throws JspException(Code)(Java Doc) public void editable(String provider, String mode, String filename) throws JspException(Code)(Java Doc) public void editableManualClose(boolean needsClose) throws JspException(Code)(Java Doc) public boolean editableManualOpen() throws JspException(Code)(Java Doc) public String getContent(String target)(Code)(Java Doc) public String getContent(String target, String element, Locale locale)(Code)(Java Doc) public CmsMessages getMessages(String bundleName, Locale locale)(Code)(Java Doc) public CmsMessages getMessages(String bundleName, String language)(Code)(Java Doc) public CmsMessages getMessages(String bundleName, String language, String defaultLanguage)(Code)(Java Doc) public CmsMessages getMessages(String bundleName, String language, String country, String variant, String defaultLanguage)(Code)(Java Doc) public CmsJspNavBuilder getNavigation()(Code)(Java Doc) public String img(String target, CmsImageScaler scaler, Map attributes)(Code)(Java Doc) public String img(String target, CmsImageScaler scaler, Map attributes, boolean partialTag)(Code)(Java Doc) public void include(String target) throws JspException(Code)(Java Doc) public void include(String target, String element) throws JspException(Code)(Java Doc) public void include(String target, String element, boolean editable) throws JspException(Code)(Java Doc) public void include(String target, String element, boolean editable, Map parameterMap) throws JspException(Code)(Java Doc) public void include(String target, String element, Map parameterMap) throws JspException(Code)(Java Doc) public void includeSilent(String target, String element)(Code)(Java Doc) public void includeSilent(String target, String element, boolean editable)(Code)(Java Doc) public void includeSilent(String target, String element, boolean editable, Map parameterMap)(Code)(Java Doc) public void includeSilent(String target, String element, Map parameterMap)(Code)(Java Doc) public String info(String property)(Code)(Java Doc) public String label(String label)(Code)(Java Doc) public String link(String target)(Code)(Java Doc) public Map properties()(Code)(Java Doc) public Map properties(String file)(Code)(Java Doc) public String property(String name)(Code)(Java Doc) public String property(String name, String file)(Code)(Java Doc) public String property(String name, String file, String defaultValue)(Code)(Java Doc) public String property(String name, String file, String defaultValue, boolean escapeHtml)(Code)(Java Doc) public boolean template(String element)(Code)(Java Doc) public boolean template(String elementlist, boolean checkall)(Code)(Java Doc) public boolean template(String element, String elementlist, boolean checkall)(Code)(Java Doc) public String toAbsolute(String target)(Code)(Java Doc) public String user(String property)(Code)(Java Doc)
|
|
|