org.opencms.frontend.templateone
Class CmsTemplateFormLetter

java.lang.Object
  extended by org.opencms.jsp.CmsJspBean
      extended by org.opencms.jsp.CmsJspActionElement
          extended by org.opencms.frontend.templateone.CmsTemplateBase
              extended by org.opencms.frontend.templateone.CmsTemplateBean
                  extended by org.opencms.frontend.templateone.CmsTemplateForm
                      extended by org.opencms.frontend.templateone.CmsTemplateFormLetter

public class CmsTemplateFormLetter
extends CmsTemplateForm

Provides methods to build the page "letter to the editor" form.

Since:
6.0.0

Field Summary
 
Fields inherited from class org.opencms.frontend.templateone.CmsTemplateForm
MESSAGE_BUNDLE_FORM, PARAM_ACTION
 
Fields inherited from class org.opencms.frontend.templateone.CmsTemplateBean
FILE_CONFIG_COMMON, FILE_CSS, FILE_CSS_ACCESSIBLE, FILE_LINKS_HEAD, FOLDER_ELEMENTS, MESSAGE_BUNDLE, MODULE_NAME, PARAM_ACCESSIBLE, PARAM_COMMON, PARAM_HELPURI, PARAM_LAYOUT, PARAM_LOGINURI, PARAM_PART, PARAM_PRINT, PARAM_SITE, PARAM_URI, PROPERTY_CONFIGPATH, PROPERTY_EXTENSIONMODULE, PROPERTY_HEAD_DEFAULTLINK, PROPERTY_HEAD_ELEMENTURI, PROPERTY_HEAD_IMGHEIGHT, PROPERTY_HEAD_IMGLINK, PROPERTY_HEAD_IMGURI, PROPERTY_LAYOUT_CENTER, PROPERTY_LAYOUT_RIGHT, PROPERTY_NAVLEFT_ELEMENTURI, PROPERTY_RESOURCEPATH, PROPERTY_SHOW_HEADNAV, PROPERTY_SHOW_NAVLEFT, PROPERTY_SHOWHEADIMAGE, PROPERTY_SHOWHEADLINKS, PROPERTY_SIDE_URI, PROPERTY_STARTFOLDER, PROPERTY_VALUE_NONE, RESOURCE_TYPE_MICROSITE_NAME
 
Fields inherited from class org.opencms.frontend.templateone.CmsTemplateBase
ATTRIBUTE_ORIGINAL_URI
 
Fields inherited from class org.opencms.jsp.CmsJspActionElement
NOT_INITIALIZED
 
Constructor Summary
CmsTemplateFormLetter()
          Empty constructor, required for every JavaBean.
CmsTemplateFormLetter(javax.servlet.jsp.PageContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          Constructor, with parameters.
 
Method Summary
protected  java.lang.String checkTextsUri()
          Returns the text URI from the configuration file and checks the presence.
 java.lang.String getConcern()
          Returns the concern of contact.
 java.lang.String getConcernDetail()
          Returns the concern details if specified.
 java.lang.String getContactCity()
          Returns the contact city.
 java.lang.String getContactCountry()
          Returns the contact country.
 java.lang.String getContactEmail()
          Returns the contact email address.
 java.lang.String getContactFirstName()
          Returns the contact first name.
 java.lang.String getContactLastName()
          Returns the contact last name.
 java.lang.String getContactNumber()
          Returns the contact street number.
 java.lang.String getContactPhone()
          Returns the contact phone number.
 java.lang.String getContactSalutation()
          Returns the contact salutation.
 java.lang.String getContactStreet()
          Returns the contact street.
 java.lang.String getContactTitle()
          Returns the contact title.
 java.lang.String getContactZip()
          Returns the contact zip code.
 java.lang.String getCopy()
          Returns the send copy to sender flag.
 java.lang.String getMessage()
          Returns the message for the recipient.
 java.lang.String isConcernChecked(java.lang.String currentValue)
          Returns the "checked" attribute if the current "concern" radio button is checked.
 java.lang.String isCopyChecked()
          Examines the value of the send copy checkbox and returns the "checked" attribute.
 java.lang.String isSalutationSelected(java.lang.String currentValue)
          Returns the "selected" attribute if the current "contact option" is selected.
 boolean sendMail()
          Sends the recommendation email(s) to the recipient and/or the sender.
 void setConcern(java.lang.String concern)
          Sets the concern of contact.
 void setConcernDetail(java.lang.String concernDetail)
          Sets the concern details if specified.
 void setContactCity(java.lang.String contactCity)
          Sets the contact city.
 void setContactCountry(java.lang.String contactCountry)
          Sets the contact country.
 void setContactEmail(java.lang.String email)
          Sets the contact email address.
 void setContactFirstName(java.lang.String contactFirstName)
          Sets the contact first name.
 void setContactLastName(java.lang.String contactLastName)
          Sets the contact last name.
 void setContactNumber(java.lang.String contactNumber)
          Sets the contact street number.
 void setContactPhone(java.lang.String contactPhone)
          Sets the contact phone number.
 void setContactSalutation(java.lang.String contactSalutation)
          Sets the contact salutation.
 void setContactStreet(java.lang.String contactStreet)
          Sets the contact street.
 void setContactTitle(java.lang.String contactTitle)
          Sets the contact title.
 void setContactZip(java.lang.String contactZip)
          Sets the contact zip code.
 void setCopy(java.lang.String copy)
          Sets the send copy to sender flag.
 void setMessage(java.lang.String message)
          Sets the message for the recipient.
 boolean validate()
          Validates the values of the input fields and creates error messages, if necessary.
 
Methods inherited from class org.opencms.frontend.templateone.CmsTemplateForm
getConfigPath, getError, getErrors, getFormattedString, getFormText, getFormUri, getPageTitle, getPageUri, getPageUri, getPageUrl, getTextsUri, hasValidationErrors, init, isChecked, isSelected, isSubmitted, isValidEmailAddress, removeHtmlTags, setErrors
 
Methods inherited from class org.opencms.frontend.templateone.CmsTemplateBean
buildHtmlBodyEnd, getAreaName, getConfiguration, getConfigurationFile, getConfigurationValue, getConfigurationValue, getDescription, getEncoding, getExtensionModuleFileUri, getHeadElementUri, getHeadLinks, getKeywords, getLayout, getLeftNavigationElementUri, getNavigationStartFolder, getProperties, getResourcePath, getSearchIndexName, getStartFolder, getStyleSheetConfigUri, getStyleSheetUri, getStyleSheetUri, getTemplateParts, getTitle, includeElements, includePopup, includeRightLists, key, keyDefault, messages, messages, putNavigationProperties, setLayout, showAccessibleVersion, showHeadImage, showHeadLinks, showHeadNavigation, showLeftNavigation, showPrintVersion
 
Methods inherited from class org.opencms.frontend.templateone.CmsTemplateBase
getOriginalUri, initUri, isUriChanged
 
Methods inherited from class org.opencms.jsp.CmsJspActionElement
editable, editable, editable, editableManualClose, editableManualOpen, getContent, getContent, getMessages, getMessages, getMessages, getMessages, getNavigation, getNavigationUri, img, img, include, include, include, include, include, include, includeSilent, includeSilent, includeSilent, includeSilent, info, label, link, link, properties, properties, property, property, property, property, template, template, template, toAbsolute, user
 
Methods inherited from class org.opencms.jsp.CmsJspBean
getCmsObject, getController, getJspContext, getMessage, getRequest, getRequestContext, getResponse, handleException, isNotInitialized, isSupressingExceptions, setContentType, setStatus, setSupressingExceptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsTemplateFormLetter

public CmsTemplateFormLetter()
Empty constructor, required for every JavaBean.


CmsTemplateFormLetter

public CmsTemplateFormLetter(javax.servlet.jsp.PageContext context,
                             javax.servlet.http.HttpServletRequest req,
                             javax.servlet.http.HttpServletResponse res)
Constructor, with parameters.

Use this constructor for the template.

Parameters:
context - the JSP page context object
req - the JSP request
res - the JSP response
Method Detail

getConcern

public java.lang.String getConcern()
Returns the concern of contact.

Returns:
the concern of contact

getConcernDetail

public java.lang.String getConcernDetail()
Returns the concern details if specified.

Returns:
the concern details if specified

getContactCity

public java.lang.String getContactCity()
Returns the contact city.

Returns:
the contact city

getContactCountry

public java.lang.String getContactCountry()
Returns the contact country.

Returns:
the contact country

getContactEmail

public java.lang.String getContactEmail()
Returns the contact email address.

Returns:
the contact email address

getContactFirstName

public java.lang.String getContactFirstName()
Returns the contact first name.

Returns:
the contact first name

getContactLastName

public java.lang.String getContactLastName()
Returns the contact last name.

Returns:
the contact last name

getContactNumber

public java.lang.String getContactNumber()
Returns the contact street number.

Returns:
the contact street number

getContactPhone

public java.lang.String getContactPhone()
Returns the contact phone number.

Returns:
the contact phone number

getContactSalutation

public java.lang.String getContactSalutation()
Returns the contact salutation.

Returns:
the contact salutation

getContactStreet

public java.lang.String getContactStreet()
Returns the contact street.

Returns:
the contact street

getContactTitle

public java.lang.String getContactTitle()
Returns the contact title.

Returns:
the contact title

getContactZip

public java.lang.String getContactZip()
Returns the contact zip code.

Returns:
the contact zip code

getCopy

public java.lang.String getCopy()
Returns the send copy to sender flag.

Returns:
the send copy to sender flag

getMessage

public java.lang.String getMessage()
Returns the message for the recipient.

Returns:
the message for the recipient

isConcernChecked

public java.lang.String isConcernChecked(java.lang.String currentValue)
Returns the "checked" attribute if the current "concern" radio button is checked.

Parameters:
currentValue - the value of the current radio button to check
Returns:
the "checked" attribute if the current "concern" radio button is checked

isCopyChecked

public java.lang.String isCopyChecked()
Examines the value of the send copy checkbox and returns the "checked" attribute.

Returns:
the "checked" attribute or an empty String

isSalutationSelected

public java.lang.String isSalutationSelected(java.lang.String currentValue)
Returns the "selected" attribute if the current "contact option" is selected.

Parameters:
currentValue - the value of the current radio button to check
Returns:
the "selected" attribute if the current "contact option" is selected

sendMail

public boolean sendMail()
Sends the recommendation email(s) to the recipient and/or the sender.

Returns:
true if the emails were successfully sent, otherwise false;

setConcern

public void setConcern(java.lang.String concern)
Sets the concern of contact.

Parameters:
concern - the concern of contact

setConcernDetail

public void setConcernDetail(java.lang.String concernDetail)
Sets the concern details if specified.

Parameters:
concernDetail - the concern details if specified

setContactCity

public void setContactCity(java.lang.String contactCity)
Sets the contact city.

Parameters:
contactCity - the contact city

setContactCountry

public void setContactCountry(java.lang.String contactCountry)
Sets the contact country.

Parameters:
contactCountry - the contact country

setContactEmail

public void setContactEmail(java.lang.String email)
Sets the contact email address.

Parameters:
email - the contact email address

setContactFirstName

public void setContactFirstName(java.lang.String contactFirstName)
Sets the contact first name.

Parameters:
contactFirstName - the contact first name

setContactLastName

public void setContactLastName(java.lang.String contactLastName)
Sets the contact last name.

Parameters:
contactLastName - the contact last name

setContactNumber

public void setContactNumber(java.lang.String contactNumber)
Sets the contact street number.

Parameters:
contactNumber - the contact street number

setContactPhone

public void setContactPhone(java.lang.String contactPhone)
Sets the contact phone number.

Parameters:
contactPhone - the contact phone number

setContactSalutation

public void setContactSalutation(java.lang.String contactSalutation)
Sets the contact salutation.

Parameters:
contactSalutation - the contact salutation

setContactStreet

public void setContactStreet(java.lang.String contactStreet)
Sets the contact street.

Parameters:
contactStreet - the contact street

setContactTitle

public void setContactTitle(java.lang.String contactTitle)
Sets the contact title.

Parameters:
contactTitle - the contact title

setContactZip

public void setContactZip(java.lang.String contactZip)
Sets the contact zip code.

Parameters:
contactZip - the contact zip code

setCopy

public void setCopy(java.lang.String copy)
Sets the send copy to sender flag.

Parameters:
copy - the send copy to sender flag

setMessage

public void setMessage(java.lang.String message)
Sets the message for the recipient.

Parameters:
message - the message for the recipient

validate

public boolean validate()
Validates the values of the input fields and creates error messages, if necessary.

Specified by:
validate in class CmsTemplateForm
Returns:
true if all checked input values are valid, otherwise false

checkTextsUri

protected java.lang.String checkTextsUri()
Description copied from class: CmsTemplateForm
Returns the text URI from the configuration file and checks the presence.

Returns the default texts URI if the file specified in the configuration can not be found.

Specified by:
checkTextsUri in class CmsTemplateForm
Returns:
the text URI from the configuration file
See Also:
CmsTemplateForm.checkTextsUri()