org.opencms.frontend.templateone.form
Class CmsForm

java.lang.Object
  extended by org.opencms.frontend.templateone.form.CmsForm

public class CmsForm
extends java.lang.Object

Represents an input form with all configured fields and options.

Provides the necessary information to create an input form, email messages and confirmation outputs.

Since:
6.0.0

Field Summary
static java.lang.String MAILTYPE_HTML
          Mail type: html mail.
static java.lang.String MAILTYPE_TEXT
          Mail type: text mail.
static java.lang.String NODE_CAPTCHA
          Configuration node name for the optional captcha.
static java.lang.String NODE_CAPTCHA_CHARACTERS
          Configuration node name for the optional captcha.
static java.lang.String NODE_CAPTCHA_PRESET
          Configuration node name for the optional captcha.
static java.lang.String NODE_CONFIRMATIONMAILCHECKBOXLABEL
          Configuration node name for the confirmation mail checkbox label text.
static java.lang.String NODE_CONFIRMATIONMAILENABLED
          Configuration node name for the confirmation mail enabled node.
static java.lang.String NODE_CONFIRMATIONMAILFIELD
          Configuration node name for the confirmation mail input field node.
static java.lang.String NODE_CONFIRMATIONMAILOPTIONAL
          Configuration node name for the confirmation mail optional flag node.
static java.lang.String NODE_CONFIRMATIONMAILSUBJECT
          Configuration node name for the confirmation mail subject node.
static java.lang.String NODE_CONFIRMATIONMAILTEXT
          Configuration node name for the confirmation mail text node.
static java.lang.String NODE_EMAIL
          Configuration node name for the Email node.
static java.lang.String NODE_FIELDDEFAULTVALUE
          Configuration node name for the field value node.
static java.lang.String NODE_FIELDERRORMESSAGE
          Configuration node name for the field error message node.
static java.lang.String NODE_FIELDITEM
          Configuration node name for the field item node.
static java.lang.String NODE_FIELDLABEL
          Configuration node name for the field description node.
static java.lang.String NODE_FIELDMANDATORY
          Configuration node name for the field mandatory node.
static java.lang.String NODE_FIELDTYPE
          Configuration node name for the field type node.
static java.lang.String NODE_FIELDVALIDATION
          Configuration node name for the field validation node.
static java.lang.String NODE_FORMATTRIBUTES
          Configuration node name for the form attributes node.
static java.lang.String NODE_FORMCHECKTEXT
          Configuration node name for the form check page text node.
static java.lang.String NODE_FORMCONFIRMATION
          Configuration node name for the form confirmation text node.
static java.lang.String NODE_FORMFIELDATTRIBUTES
          Configuration node name for the form field attributes node.
static java.lang.String NODE_FORMTEXT
          Configuration node name for the form text node.
static java.lang.String NODE_INPUTFIELD
          Configuration node name for the input field node.
static java.lang.String NODE_ITEMDESCRIPTION
          Configuration node name for the item description node.
static java.lang.String NODE_ITEMSELECTED
          Configuration node name for the item selected node.
static java.lang.String NODE_ITEMVALUE
          Configuration node name for the item value node.
static java.lang.String NODE_MAILBCC
          Configuration node name for the Email bcc recipient(s) node.
static java.lang.String NODE_MAILCC
          Configuration node name for the Email cc recipient(s) node.
static java.lang.String NODE_MAILFROM
          Configuration node name for the Email sender address node.
static java.lang.String NODE_MAILSUBJECT
          Configuration node name for the Email subject node.
static java.lang.String NODE_MAILTEXT
          Configuration node name for the Email text node.
static java.lang.String NODE_MAILTO
          Configuration node name for the Email recipient(s) node.
static java.lang.String NODE_MAILTYPE
          Configuration node name for the Email type node.
static java.lang.String NODE_OPTIONALCONFIGURATION
          Configuration node name for the optional form configuration.
static java.lang.String NODE_OPTIONALCONFIRMATION
          Configuration node name for the optional confirmation mail configuration.
static java.lang.String NODE_SHOWCHECK
          Configuration node name for the Show check page node.
static java.lang.String NODE_TARGET_URI
          Configuration node name for the optional target URI.
static java.lang.String PARAM_SENDCONFIRMATION
          Request parameter name for the optional send confirmation email checkbox.
 
Constructor Summary
CmsForm(CmsFormHandler jsp, org.opencms.i18n.CmsMessages messages, boolean initial)
          Default constructor which parses the configuration file.
CmsForm(CmsFormHandler jsp, org.opencms.i18n.CmsMessages messages, boolean initial, java.lang.String formConfigUri, java.lang.String formAction)
          Constructor which parses the configuration file using a given configuration file URI.
 
Method Summary
protected  void addField(I_CmsField field)
          Adds a field to the form.
 boolean captchaFieldIsOnCheckPage()
          Tests, if the captcha field (if configured at all) should be displayed on the check page.
 boolean captchaFieldIsOnInputPage()
          Tests, if the captcha field (if configured at all) should be displayed on the input page.
 CmsCaptchaField getCaptchaField()
          Returns the (opt.) captcha field of this form.
 java.util.List getConfigurationErrors()
          Returns the form configuration errors.
 java.lang.String getConfirmationMailCheckboxLabel()
          Returns the label for the optional confirmation mail checkbox on the input form.
 int getConfirmationMailField()
          Returns the index number of the input field containing the email address for the optional confirmation mail.
 java.lang.String getConfirmationMailSubject()
          Returns the subject of the optional confirmation mail.
 java.lang.String getConfirmationMailText()
          Returns the text of the optional confirmation mail.
 java.lang.String getConfirmationMailTextPlain()
          Returns the plain text of the optional confirmation mail.
 java.util.List getFields()
          Returns a list of field objects for the online form.
 java.lang.String getFieldStringValueByName(java.lang.String fieldName)
          Returns the value for a field specified by it's name (Xpath).
 java.lang.String getFormAttributes()
          Returns the global form attributes.
 java.lang.String getFormCheckText()
          Returns the form check text.
 java.lang.String getFormConfirmationText()
          Returns the form confirmation text.
 java.lang.String getFormFieldAttributes()
          Returns the optional form input field attributes.
 java.lang.String getFormText()
          Returns the form text.
 java.lang.String getMailBCC()
          Returns the mail bcc recipient(s).
 java.lang.String getMailCC()
          Returns the mail cc recipient(s).
 java.lang.String getMailFrom()
          Returns the mail sender address.
 java.lang.String getMailSubject()
          Returns the mail subject.
 java.lang.String getMailSubjectPrefix()
          Returns the mail subject prefix.
 java.lang.String getMailText()
          Returns the mail text.
 java.lang.String getMailTextPlain()
          Returns the mail text as plain text.
 java.lang.String getMailTo()
          Returns the mail recipient(s).
 java.lang.String getMailType()
          Returns the mail type ("text" or "html").
 boolean getShowCheck()
          Returns if the check page should be shown.
static java.lang.String getStaticType()
          Returns the resource type name of XML content forms.
 java.lang.String getTargetUri()
          Returns the target URI of this form.
 boolean hasCaptchaField()
          Tests if a captcha field is configured for this form.
 boolean hasConfigurationErrors()
          Returns if the form has configuration errors.
 boolean hasMandatoryFields()
          Returns true if at least one of the configured fields is mandatory.
 boolean hasTargetUri()
          Tests if this form has a target URI specified.
 void init(CmsFormHandler jsp, org.opencms.i18n.CmsMessages messages, boolean initial, java.lang.String formConfigUri, java.lang.String formAction)
          Initializes the form configuration and creates the necessary form field objects.
 boolean isCheckPageSubmitted()
          Tests if the check page was submitted.
 boolean isConfirmationMailEnabled()
          Returns if the optional confirmation mail is enabled.
 boolean isConfirmationMailOptional()
          Returns if the confirmation mail if optional, i.e. selectable by the form submitter.
 boolean isInputFormSubmitted()
          Tests if the input page was submitted.
protected  java.lang.String readSelectedFromRequest(I_CmsField field, java.lang.String value)
          Marks the individual items of checkboxes, selectboxes and radiobuttons as selected depending on the given request parameters.
 I_CmsField removeCaptchaField()
          Removes the captcha field from the list of all fields, if present.
protected  void removeField(I_CmsField field)
          Removes a field from the form fields.
protected  void setConfigurationErrors(java.util.List configurationErrors)
          Sets the form configuration errors.
protected  void setConfirmationMailCheckboxLabel(java.lang.String confirmationMailCheckboxLabel)
          Sets the label for the optional confirmation mail checkbox on the input form.
protected  void setConfirmationMailEnabled(boolean confirmationMailEnabled)
          Sets if the optional confirmation mail is enabled.
protected  void setConfirmationMailField(int confirmationMailFieldName)
          Sets the index number of the input field containing the email address for the optional confirmation mail.
protected  void setConfirmationMailOptional(boolean confirmationMailOptional)
          Sets if the confirmation mail if optional, i.e. selectable by the form submitter.
protected  void setConfirmationMailSubject(java.lang.String confirmationMailSubject)
          Sets the subject of the optional confirmation mail.
protected  void setConfirmationMailText(java.lang.String confirmationMailText)
          Sets the text of the optional confirmation mail.
protected  void setConfirmationMailTextPlain(java.lang.String confirmationMailTextPlain)
          Sets the plain text of the optional confirmation mail.
protected  void setFormAttributes(java.lang.String formAttributes)
          Sets the global form attributes.
protected  void setFormCheckText(java.lang.String formCheckText)
          Sets the form check text.
protected  void setFormConfirmationText(java.lang.String formConfirmationText)
          Sets the form confirmation text.
protected  void setFormFieldAttributes(java.lang.String formFieldAttributes)
          Sets the optional form input field attributes.
protected  void setFormText(java.lang.String formText)
          Sets the form text.
protected  void setHasMandatoryFields(boolean hasMandatoryFields)
          Sets if at least one of the configured fields is mandatory.
protected  void setMailBCC(java.lang.String mailBCC)
          Sets the mail bcc recipient(s).
protected  void setMailCC(java.lang.String mailCC)
          Sets the mail cc recipient(s).
protected  void setMailFrom(java.lang.String mailFrom)
          Sets the mail sender address.
protected  void setMailSubject(java.lang.String mailSubject)
          Sets the mail subject.
protected  void setMailSubjectPrefix(java.lang.String mailSubjectPrefix)
          Sets the mail subject prefix.
protected  void setMailText(java.lang.String mailText)
          Sets the mail text.
protected  void setMailTextPlain(java.lang.String mailTextPlain)
          Sets the mail text as plain text.
protected  void setMailTo(java.lang.String mailTo)
          Sets the mail recipient(s).
protected  void setMailType(java.lang.String mailType)
          Sets the mail type ("text" or "html").
protected  void setShowCheck(boolean showCheck)
          Sets if the check page should be shown.
protected  void setTargetUri(java.lang.String targetUri)
          Sets the target URI of this form.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAILTYPE_HTML

public static final java.lang.String MAILTYPE_HTML
Mail type: html mail.

See Also:
Constant Field Values

MAILTYPE_TEXT

public static final java.lang.String MAILTYPE_TEXT
Mail type: text mail.

See Also:
Constant Field Values

NODE_CAPTCHA

public static final java.lang.String NODE_CAPTCHA
Configuration node name for the optional captcha.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILCHECKBOXLABEL

public static final java.lang.String NODE_CONFIRMATIONMAILCHECKBOXLABEL
Configuration node name for the confirmation mail checkbox label text.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILENABLED

public static final java.lang.String NODE_CONFIRMATIONMAILENABLED
Configuration node name for the confirmation mail enabled node.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILFIELD

public static final java.lang.String NODE_CONFIRMATIONMAILFIELD
Configuration node name for the confirmation mail input field node.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILOPTIONAL

public static final java.lang.String NODE_CONFIRMATIONMAILOPTIONAL
Configuration node name for the confirmation mail optional flag node.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILSUBJECT

public static final java.lang.String NODE_CONFIRMATIONMAILSUBJECT
Configuration node name for the confirmation mail subject node.

See Also:
Constant Field Values

NODE_CONFIRMATIONMAILTEXT

public static final java.lang.String NODE_CONFIRMATIONMAILTEXT
Configuration node name for the confirmation mail text node.

See Also:
Constant Field Values

NODE_EMAIL

public static final java.lang.String NODE_EMAIL
Configuration node name for the Email node.

See Also:
Constant Field Values

NODE_FIELDDEFAULTVALUE

public static final java.lang.String NODE_FIELDDEFAULTVALUE
Configuration node name for the field value node.

See Also:
Constant Field Values

NODE_FIELDERRORMESSAGE

public static final java.lang.String NODE_FIELDERRORMESSAGE
Configuration node name for the field error message node.

See Also:
Constant Field Values

NODE_FIELDITEM

public static final java.lang.String NODE_FIELDITEM
Configuration node name for the field item node.

See Also:
Constant Field Values

NODE_FIELDLABEL

public static final java.lang.String NODE_FIELDLABEL
Configuration node name for the field description node.

See Also:
Constant Field Values

NODE_FIELDMANDATORY

public static final java.lang.String NODE_FIELDMANDATORY
Configuration node name for the field mandatory node.

See Also:
Constant Field Values

NODE_FIELDTYPE

public static final java.lang.String NODE_FIELDTYPE
Configuration node name for the field type node.

See Also:
Constant Field Values

NODE_FIELDVALIDATION

public static final java.lang.String NODE_FIELDVALIDATION
Configuration node name for the field validation node.

See Also:
Constant Field Values

NODE_FORMATTRIBUTES

public static final java.lang.String NODE_FORMATTRIBUTES
Configuration node name for the form attributes node.

See Also:
Constant Field Values

NODE_FORMCHECKTEXT

public static final java.lang.String NODE_FORMCHECKTEXT
Configuration node name for the form check page text node.

See Also:
Constant Field Values

NODE_FORMCONFIRMATION

public static final java.lang.String NODE_FORMCONFIRMATION
Configuration node name for the form confirmation text node.

See Also:
Constant Field Values

NODE_FORMFIELDATTRIBUTES

public static final java.lang.String NODE_FORMFIELDATTRIBUTES
Configuration node name for the form field attributes node.

See Also:
Constant Field Values

NODE_FORMTEXT

public static final java.lang.String NODE_FORMTEXT
Configuration node name for the form text node.

See Also:
Constant Field Values

NODE_INPUTFIELD

public static final java.lang.String NODE_INPUTFIELD
Configuration node name for the input field node.

See Also:
Constant Field Values

NODE_ITEMDESCRIPTION

public static final java.lang.String NODE_ITEMDESCRIPTION
Configuration node name for the item description node.

See Also:
Constant Field Values

NODE_ITEMSELECTED

public static final java.lang.String NODE_ITEMSELECTED
Configuration node name for the item selected node.

See Also:
Constant Field Values

NODE_ITEMVALUE

public static final java.lang.String NODE_ITEMVALUE
Configuration node name for the item value node.

See Also:
Constant Field Values

NODE_MAILBCC

public static final java.lang.String NODE_MAILBCC
Configuration node name for the Email bcc recipient(s) node.

See Also:
Constant Field Values

NODE_MAILCC

public static final java.lang.String NODE_MAILCC
Configuration node name for the Email cc recipient(s) node.

See Also:
Constant Field Values

NODE_MAILFROM

public static final java.lang.String NODE_MAILFROM
Configuration node name for the Email sender address node.

See Also:
Constant Field Values

NODE_MAILSUBJECT

public static final java.lang.String NODE_MAILSUBJECT
Configuration node name for the Email subject node.

See Also:
Constant Field Values

NODE_MAILTEXT

public static final java.lang.String NODE_MAILTEXT
Configuration node name for the Email text node.

See Also:
Constant Field Values

NODE_MAILTO

public static final java.lang.String NODE_MAILTO
Configuration node name for the Email recipient(s) node.

See Also:
Constant Field Values

NODE_MAILTYPE

public static final java.lang.String NODE_MAILTYPE
Configuration node name for the Email type node.

See Also:
Constant Field Values

NODE_OPTIONALCONFIGURATION

public static final java.lang.String NODE_OPTIONALCONFIGURATION
Configuration node name for the optional form configuration.

See Also:
Constant Field Values

NODE_OPTIONALCONFIRMATION

public static final java.lang.String NODE_OPTIONALCONFIRMATION
Configuration node name for the optional confirmation mail configuration.

See Also:
Constant Field Values

NODE_SHOWCHECK

public static final java.lang.String NODE_SHOWCHECK
Configuration node name for the Show check page node.

See Also:
Constant Field Values

NODE_TARGET_URI

public static final java.lang.String NODE_TARGET_URI
Configuration node name for the optional target URI.

See Also:
Constant Field Values

PARAM_SENDCONFIRMATION

public static final java.lang.String PARAM_SENDCONFIRMATION
Request parameter name for the optional send confirmation email checkbox.

See Also:
Constant Field Values

NODE_CAPTCHA_PRESET

public static final java.lang.String NODE_CAPTCHA_PRESET
Configuration node name for the optional captcha.

See Also:
Constant Field Values

NODE_CAPTCHA_CHARACTERS

public static final java.lang.String NODE_CAPTCHA_CHARACTERS
Configuration node name for the optional captcha.

See Also:
Constant Field Values
Constructor Detail

CmsForm

public CmsForm(CmsFormHandler jsp,
               org.opencms.i18n.CmsMessages messages,
               boolean initial)
        throws java.lang.Exception
Default constructor which parses the configuration file.

Parameters:
jsp - the initialized CmsJspActionElement to access the OpenCms API
messages - the localized messages
initial - if true, field values are filled with values specified in the configuration file, otherwise from the request
Throws:
java.lang.Exception - if parsing the configuration fails

CmsForm

public CmsForm(CmsFormHandler jsp,
               org.opencms.i18n.CmsMessages messages,
               boolean initial,
               java.lang.String formConfigUri,
               java.lang.String formAction)
        throws java.lang.Exception
Constructor which parses the configuration file using a given configuration file URI.

Parameters:
jsp - the initialized CmsJspActionElement to access the OpenCms API
messages - the localized messages
initial - if true, field values are filled with values specified in the configuration file, otherwise from the request
formConfigUri - URI of the form configuration file, if not provided, current URI is used for configuration
formAction - the desired action submiktted by the form
Throws:
java.lang.Exception - if parsing the configuration fails
Method Detail

getStaticType

public static java.lang.String getStaticType()
Returns the resource type name of XML content forms.

Returns:
the resource type name of XML content forms

captchaFieldIsOnCheckPage

public boolean captchaFieldIsOnCheckPage()
Tests, if the captcha field (if configured at all) should be displayed on the check page.

Returns:
true, if the captcha field should be displayed on the check page

captchaFieldIsOnInputPage

public boolean captchaFieldIsOnInputPage()
Tests, if the captcha field (if configured at all) should be displayed on the input page.

Returns:
true, if the captcha field should be displayed on the input page

getCaptchaField

public CmsCaptchaField getCaptchaField()
Returns the (opt.) captcha field of this form.

Returns:
the (opt.) captcha field of this form

getConfigurationErrors

public java.util.List getConfigurationErrors()
Returns the form configuration errors.

Returns:
the form configuration errors

getConfirmationMailCheckboxLabel

public java.lang.String getConfirmationMailCheckboxLabel()
Returns the label for the optional confirmation mail checkbox on the input form.

Returns:
the label for the optional confirmation mail checkbox on the input form

getConfirmationMailField

public int getConfirmationMailField()
Returns the index number of the input field containing the email address for the optional confirmation mail.

Returns:
the index number of the input field containing the email address for the optional confirmation mail

getConfirmationMailSubject

public java.lang.String getConfirmationMailSubject()
Returns the subject of the optional confirmation mail.

Returns:
the subject of the optional confirmation mail

getConfirmationMailText

public java.lang.String getConfirmationMailText()
Returns the text of the optional confirmation mail.

Returns:
the text of the optional confirmation mail

getConfirmationMailTextPlain

public java.lang.String getConfirmationMailTextPlain()
Returns the plain text of the optional confirmation mail.

Returns:
the plain text of the optional confirmation mail

getFields

public java.util.List getFields()
Returns a list of field objects for the online form.

Returns:
a list of field objects for the online form

getFieldStringValueByName

public java.lang.String getFieldStringValueByName(java.lang.String fieldName)
Returns the value for a field specified by it's name (Xpath).

Parameters:
fieldName - the field's name (Xpath)
Returns:
the field value, or null

getFormAttributes

public java.lang.String getFormAttributes()
Returns the global form attributes.

Returns:
the global form attributes

getFormCheckText

public java.lang.String getFormCheckText()
Returns the form check text.

Returns:
the form check text

getFormConfirmationText

public java.lang.String getFormConfirmationText()
Returns the form confirmation text.

Returns:
the form confirmation text

getFormFieldAttributes

public java.lang.String getFormFieldAttributes()
Returns the optional form input field attributes.

Returns:
the optional form input field attributes

getFormText

public java.lang.String getFormText()
Returns the form text.

Returns:
the form text

getMailBCC

public java.lang.String getMailBCC()
Returns the mail bcc recipient(s).

Returns:
the mail bcc recipient(s)

getMailCC

public java.lang.String getMailCC()
Returns the mail cc recipient(s).

Returns:
the mail cc recipient(s)

getMailFrom

public java.lang.String getMailFrom()
Returns the mail sender address.

Returns:
the mail sender address

getMailSubject

public java.lang.String getMailSubject()
Returns the mail subject.

Returns:
the mail subject

getMailSubjectPrefix

public java.lang.String getMailSubjectPrefix()
Returns the mail subject prefix.

Returns:
the mail subject prefix

getMailText

public java.lang.String getMailText()
Returns the mail text.

Returns:
the mail text

getMailTextPlain

public java.lang.String getMailTextPlain()
Returns the mail text as plain text.

Returns:
the mail text as plain text

getMailTo

public java.lang.String getMailTo()
Returns the mail recipient(s).

Returns:
the mail recipient(s)

getMailType

public java.lang.String getMailType()
Returns the mail type ("text" or "html").

Returns:
the mail type

getShowCheck

public boolean getShowCheck()
Returns if the check page should be shown.

Returns:
true if the check page should be shown, otherwise false

getTargetUri

public java.lang.String getTargetUri()
Returns the target URI of this form.

This optional target URI can be used to redirect the user to an OpenCms page instead of displaying a confirmation text from the form's XML content.

Returns:
the target URI

hasCaptchaField

public boolean hasCaptchaField()
Tests if a captcha field is configured for this form.

Returns:
true, if a captcha field is configured for this form

hasConfigurationErrors

public boolean hasConfigurationErrors()
Returns if the form has configuration errors.

Returns:
true if the form has configuration errors, otherwise false

hasMandatoryFields

public boolean hasMandatoryFields()
Returns true if at least one of the configured fields is mandatory.

Returns:
true if at least one of the configured fields is mandatory, otherwise false

hasTargetUri

public boolean hasTargetUri()
Tests if this form has a target URI specified.

This optional target URI can be used to redirect the user to an OpenCms page instead of displaying a confirmation text from the form's XML content.

Returns:
the target URI

init

public void init(CmsFormHandler jsp,
                 org.opencms.i18n.CmsMessages messages,
                 boolean initial,
                 java.lang.String formConfigUri,
                 java.lang.String formAction)
          throws java.lang.Exception
Initializes the form configuration and creates the necessary form field objects.

Parameters:
jsp - the initialized CmsJspActionElement to access the OpenCms API
messages - the localized messages
initial - if true, field values are filled with values specified in the XML configuration
formConfigUri - URI of the form configuration file, if not provided, current URI is used for configuration
formAction - the desired action submitted by the form
Throws:
java.lang.Exception - if parsing the configuration fails

isCheckPageSubmitted

public boolean isCheckPageSubmitted()
Tests if the check page was submitted.

Returns:
true, if the check page was submitted

isConfirmationMailEnabled

public boolean isConfirmationMailEnabled()
Returns if the optional confirmation mail is enabled.

Returns:
true if the optional confirmation mail is enabled, otherwise false

isConfirmationMailOptional

public boolean isConfirmationMailOptional()
Returns if the confirmation mail if optional, i.e. selectable by the form submitter.

Returns:
true if the confirmation mail if optional, i.e. selectable by the form submitter, otherwise false

isInputFormSubmitted

public boolean isInputFormSubmitted()
Tests if the input page was submitted.

Returns:
true, if the input page was submitted

removeCaptchaField

public I_CmsField removeCaptchaField()
Removes the captcha field from the list of all fields, if present.

Returns:
the removed captcha field, or null

addField

protected void addField(I_CmsField field)
Adds a field to the form.

Parameters:
field - the field to be added to the form

readSelectedFromRequest

protected java.lang.String readSelectedFromRequest(I_CmsField field,
                                                   java.lang.String value)
Marks the individual items of checkboxes, selectboxes and radiobuttons as selected depending on the given request parameters.

Parameters:
field - the current field
value - the value of the input field
Returns:
"true" if the current item is selected or checked, otherwise false

removeField

protected void removeField(I_CmsField field)
Removes a field from the form fields.

Parameters:
field - the field to be removed

setConfigurationErrors

protected void setConfigurationErrors(java.util.List configurationErrors)
Sets the form configuration errors.

Parameters:
configurationErrors - the form configuration errors

setConfirmationMailCheckboxLabel

protected void setConfirmationMailCheckboxLabel(java.lang.String confirmationMailCheckboxLabel)
Sets the label for the optional confirmation mail checkbox on the input form.

Parameters:
confirmationMailCheckboxLabel - the label for the optional confirmation mail checkbox on the input form

setConfirmationMailEnabled

protected void setConfirmationMailEnabled(boolean confirmationMailEnabled)
Sets if the optional confirmation mail is enabled.

Parameters:
confirmationMailEnabled - true if the optional confirmation mail is enabled, otherwise false

setConfirmationMailField

protected void setConfirmationMailField(int confirmationMailFieldName)
Sets the index number of the input field containing the email address for the optional confirmation mail.

Parameters:
confirmationMailFieldName - the name of the input field containing the email address for the optional confirmation mail

setConfirmationMailOptional

protected void setConfirmationMailOptional(boolean confirmationMailOptional)
Sets if the confirmation mail if optional, i.e. selectable by the form submitter.

Parameters:
confirmationMailOptional - true if the confirmation mail if optional, i.e. selectable by the form submitter, otherwise false

setConfirmationMailSubject

protected void setConfirmationMailSubject(java.lang.String confirmationMailSubject)
Sets the subject of the optional confirmation mail.

Parameters:
confirmationMailSubject - the subject of the optional confirmation mail

setConfirmationMailText

protected void setConfirmationMailText(java.lang.String confirmationMailText)
Sets the text of the optional confirmation mail.

Parameters:
confirmationMailText - the text of the optional confirmation mail

setConfirmationMailTextPlain

protected void setConfirmationMailTextPlain(java.lang.String confirmationMailTextPlain)
Sets the plain text of the optional confirmation mail.

Parameters:
confirmationMailTextPlain - the plain text of the optional confirmation mail

setFormAttributes

protected void setFormAttributes(java.lang.String formAttributes)
Sets the global form attributes.

Parameters:
formAttributes - the global form attributes

setFormCheckText

protected void setFormCheckText(java.lang.String formCheckText)
Sets the form check text.

Parameters:
formCheckText - the form confirmation text

setFormConfirmationText

protected void setFormConfirmationText(java.lang.String formConfirmationText)
Sets the form confirmation text.

Parameters:
formConfirmationText - the form confirmation text

setFormFieldAttributes

protected void setFormFieldAttributes(java.lang.String formFieldAttributes)
Sets the optional form input field attributes.

Parameters:
formFieldAttributes - the optional form input field attributes

setFormText

protected void setFormText(java.lang.String formText)
Sets the form text.

Parameters:
formText - the form text

setHasMandatoryFields

protected void setHasMandatoryFields(boolean hasMandatoryFields)
Sets if at least one of the configured fields is mandatory.

Parameters:
hasMandatoryFields - true if at least one of the configured fields is mandatory, otherwise false

setMailBCC

protected void setMailBCC(java.lang.String mailBCC)
Sets the mail bcc recipient(s).

Parameters:
mailBCC - the mail bcc recipient(s)

setMailCC

protected void setMailCC(java.lang.String mailCC)
Sets the mail cc recipient(s).

Parameters:
mailCC - the mail cc recipient(s)

setMailFrom

protected void setMailFrom(java.lang.String mailFrom)
Sets the mail sender address.

Parameters:
mailFrom - the mail sender address

setMailSubject

protected void setMailSubject(java.lang.String mailSubject)
Sets the mail subject.

Parameters:
mailSubject - the mail subject

setMailSubjectPrefix

protected void setMailSubjectPrefix(java.lang.String mailSubjectPrefix)
Sets the mail subject prefix.

Parameters:
mailSubjectPrefix - the mail subject prefix

setMailText

protected void setMailText(java.lang.String mailText)
Sets the mail text.

Parameters:
mailText - the mail text

setMailTextPlain

protected void setMailTextPlain(java.lang.String mailTextPlain)
Sets the mail text as plain text.

Parameters:
mailTextPlain - the mail text as plain text

setMailTo

protected void setMailTo(java.lang.String mailTo)
Sets the mail recipient(s).

Parameters:
mailTo - the mail recipient(s)

setMailType

protected void setMailType(java.lang.String mailType)
Sets the mail type ("text" or "html").

Parameters:
mailType - the mail type

setShowCheck

protected void setShowCheck(boolean showCheck)
Sets if the check page should be shown.

Parameters:
showCheck - true if the check page should be shown, otherwise false

setTargetUri

protected void setTargetUri(java.lang.String targetUri)
Sets the target URI of this form.

This optional target URI can be used to redirect the user to an OpenCms page instead of displaying a confirmation text from the form's XML content.

Parameters:
targetUri - the target URI