Java Doc for CmsFormHandler.java in  » Content-Management-System » opencms » com » alkacon » opencms » formgenerator » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Content Management System » opencms » com.alkacon.opencms.formgenerator 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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



Field Summary
final public static  StringACTION_CONFIRMED
     Request parameter value for the form action parameter: correct the input.
final public static  StringACTION_CORRECT_INPUT
     Request parameter value for the form action parameter: correct the input.
final public static  StringACTION_DOWNLOAD_DATA_1
     Request parameter value for the form action parameter: Jump to the download page of the csv data (allow only for offline project!!!).
final public static  StringACTION_DOWNLOAD_DATA_2
     Request parameter value for the form action parameter: Download the csv data.
final public static  StringACTION_SUBMIT
     Request parameter value for the form action parameter: form submitted.
final public static  StringATTRIBUTE_FILEITEMS
     Name of the file item session attribute.
final public static  StringERROR_MANDATORY
     Form error: mandatory field not filled out.
final public static  StringERROR_VALIDATION
     Form error: validation error of input.
final public static  StringMACRO_DATE
     Macro name for the date macro that can be used in mail text fields.
final public static  StringMACRO_FORMDATA
     Macro name for the form data macro that can be used in mail text fields.
final public static  StringPARAM_FORMACTION
     Request parameter name for the hidden form action parameter to determine the action.
protected  Mapm_errors
     Contains eventual validation errors.
protected  CmsFormm_formConfiguration
     The form configuration object.
protected  Stringm_hiddenFields
     Temporarily stores the fields as hidden fields in the String.
protected  booleanm_initial
     Flag indicating if the form is displayed for the first time.
protected  Booleanm_isValidatedCorrect
     Boolean indicating if the form is validated correctly.
protected transient  CmsMacroResolverm_macroResolver
     Needed to implant form fields into the mail text.
protected  CmsMessagesm_messages
     The localized messages for the form handler.
protected  Listm_mulipartFileItems
     The multipart file items.
protected  Mapm_parameterMap
     The map of request parameters.

Constructor Summary
public  CmsFormHandler(PageContext context, HttpServletRequest req, HttpServletResponse res)
    
public  CmsFormHandler(PageContext context, HttpServletRequest req, HttpServletResponse res, String formConfigUri)
    

Method Summary
public  StringconvertToHtmlValue(String value)
    
public  StringconvertToPlainValue(String value)
    
public  StringconvertValue(String value, String outputType)
    
public  StringcreateHiddenFields()
    
protected  ListcreateInternetAddresses(String mailAddresses)
    
public  StringcreateMailTextFromFields(boolean isHtmlMail, boolean isConfirmationMail)
    
public  booleandownloadData()
    
public  MapgetErrors()
    
public  StringgetFormCheckText()
    
public  CmsFormgetFormConfiguration()
    
public  StringgetFormConfirmationText()
    
public  CmsMessagesgetMessages()
    
protected  StringgetParameter(String parameter)
    
public  MapgetParameterMap()
    
public  FileItemgetUploadFile(I_CmsField isFileUploadField)
    
public  booleanhasValidationErrors()
    
public  voidinit(HttpServletRequest req, String formConfigUri)
    
public  booleanisInitial()
    
public  voidsendConfirmationMail()
    
public  booleansendData()
    
protected  booleansendDatabase()
    
protected  booleansendMail()
    
protected  voidsetFormConfiguration(CmsForm configuration)
    
protected  voidsetInitial(boolean initial)
    
protected  voidsetMessages(CmsMessages messages)
    
public  booleanshowCheck()
    
public  booleanshowDownloadData()
    
public  booleanshowForm()
    
public  booleanshowTemplate()
    
protected  booleanuseInFormDataMacro(I_CmsField field)
    
public  booleanvalidate()
    

Field Detail
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.




Constructor Detail
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





Method Detail
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




Fields inherited from org.opencms.jsp.CmsJspActionElement
final public static CmsMessageContainer NOT_INITIALIZED(Code)(Java Doc)

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)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.