atg.projects.store.profile.email
Class StoreEmailFormHandler

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.GenericService
          extended by atg.droplet.EmptyFormHandler
              extended by atg.droplet.GenericFormHandler
                  extended by atg.service.email.EmailFormHandler
                      extended by atg.projects.store.profile.email.StoreEmailFormHandler
All Implemented Interfaces:
atg.droplet.DropletFormHandler, atg.naming.NameContextBindingListener, atg.naming.NameContextElement, atg.naming.NameResolver, atg.nucleus.AdminableService, atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging, atg.nucleus.naming.ComponentNameResolver, atg.nucleus.Service, atg.nucleus.ServiceListener, java.util.EventListener

public class StoreEmailFormHandler
extends atg.service.email.EmailFormHandler

This formhandler extends the OOTB EmailFormHandler so as to capture the users name when the email is sent.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
 
Fields inherited from class atg.service.email.EmailFormHandler
MSG_EMPTY_MESSAGE, MSG_INVALID_RECIPIENT_EMAIL, MSG_INVALID_SENDER_EMAIL, MSG_NO_EMAIL_HOST_NAME, MSG_NO_RECIPIENT_EMAIL, MSG_NO_SENDER_EMAIL
 
Fields inherited from class atg.droplet.GenericFormHandler
PARAM_DEFER_FORWARD_OR_REDIRECT, PARAM_USE_FORWARDS
 
Fields inherited from class atg.nucleus.GenericService
SERVICE_INFO_KEY
 
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging
DEFAULT_LOG_TRACE_STATUS
 
Fields inherited from interface atg.nucleus.logging.ApplicationLogging
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS
 
Constructor Summary
StoreEmailFormHandler()
           
 
Method Summary
 java.lang.String getCustomerServiceEmailAddress()
           
 java.lang.String getEmail()
           
 java.lang.String getFirstName()
           
 java.lang.String getLastName()
           
protected  boolean sendMail(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Customizes the send operation.
 void setCustomerServiceEmailAddress(java.lang.String pCustomerServiceEmailAddress)
           
 void setEmail(java.lang.String pEmail)
           
 void setFirstName(java.lang.String pFirstName)
           
 void setLastName(java.lang.String pLastName)
           
protected  boolean validate(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Validate the email's fields for correctness.
 
Methods inherited from class atg.service.email.EmailFormHandler
getBody, getDefaultLocale, getEmailSenderService, getRecipient, getSender, getSendErrorURL, getSendSuccessURL, getSubject, getUserLocale, handleSendEmail, isUseRequestLocale, setBody, setDefaultLocale, setEmailSenderService, setRecipient, setSender, setSendErrorURL, setSendSuccessURL, setSubject, setUseRequestLocale, toString
 
Methods inherited from class atg.droplet.GenericFormHandler
addFormException, addUncheckedFormException, afterSet, beforeSet, checkFormRedirect, createFormSubmissionMessage, getCancelURL, getCheckForValidSession, getFormError, getFormExceptions, getFormName, getMessagePort, getMessageSource, getMessageType, getPropertyExceptions, getSendMessages, getUncheckedFormExceptions, handleCancel, handleFormException, handleUncheckedFormException, hasUncheckedFormExceptions, isDeferForwardsAndRedirects, isRestorableForm, isUseForwards, isValidSession, redirectOrForward, resetFormExceptions, setCancelURL, setCheckForValidSession, setDeferForwardsAndRedirects, setFormName, setMessagePort, setMessageSource, setMessageType, setRestorableForm, setSendMessages, setUseForwards
 
Methods inherited from class atg.droplet.EmptyFormHandler
afterGet, beforeGet
 
Methods inherited from class atg.nucleus.GenericService
addLogListener, createAdminServlet, doStartService, doStopService, getAbsoluteName, getAdminServlet, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, isRunning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, nameContextElementBound, nameContextElementUnbound, removeLogListener, resolveName, resolveName, resolveName, resolveName, sendLogEvent, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string.

Constructor Detail

StoreEmailFormHandler

public StoreEmailFormHandler()
Method Detail

getFirstName

public java.lang.String getFirstName()
Returns:
first name.

setFirstName

public void setFirstName(java.lang.String pFirstName)
Parameters:
pFirstName - - first name.

getLastName

public java.lang.String getLastName()
Returns:
last name.

setLastName

public void setLastName(java.lang.String pLastName)
Parameters:
pLastName - - last name.

getCustomerServiceEmailAddress

public java.lang.String getCustomerServiceEmailAddress()
Returns:
customer service e-mail address.

setCustomerServiceEmailAddress

public void setCustomerServiceEmailAddress(java.lang.String pCustomerServiceEmailAddress)
Parameters:
pCustomerServiceEmailAddress - - customer service e-mail address.

getEmail

public java.lang.String getEmail()
Returns:
e-mail.

setEmail

public void setEmail(java.lang.String pEmail)
Parameters:
pEmail - - email.

sendMail

protected boolean sendMail(atg.servlet.DynamoHttpServletRequest pRequest,
                           atg.servlet.DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Customizes the send operation. Overrides the sender and recipient properties to the following:

sender: full name (id) <email>s
recipient: customer_svc@atg.com

The full name and email address come from the user input. The recipient is the value specified in the properties file for the customerServiceEmailAddress.

The EmailFormHandler'ssendMail() is then called normally.

Overrides:
sendMail in class atg.service.email.EmailFormHandler
Parameters:
pRequest - DynamoHttpServletRequest
pResponse - DynamoHttpServletResponse
Returns:
a boolean value indicating whether the email was sent
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

validate

protected boolean validate(atg.servlet.DynamoHttpServletRequest pRequest,
                           atg.servlet.DynamoHttpServletResponse pResponse)
                    throws javax.servlet.ServletException,
                           java.io.IOException
Validate the email's fields for correctness.

Currently only checks that the sender and recipient addresses contain a '@' and that both the subject andd body aren't empty.
This protected method is intended to be overriden by a subclass to provide customized error checking.

Overrides:
validate in class atg.service.email.EmailFormHandler
Parameters:
pRequest - DynamoHttpServletRequest
pResponse - DynamoHttpServletResponse
Returns:
a boolean value indicating whether the email message is ok.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io