atg.projects.store.email
Class GenericEmailSenderFormHandler

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.projects.store.email.GenericEmailSenderFormHandler
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
Direct Known Subclasses:
EmailAFriendFormHandler, TemplateTesterFormHandler

public class GenericEmailSenderFormHandler
extends atg.droplet.GenericFormHandler

Generic form handler for email sending.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string.
static java.lang.String MSG_ACTION_SUCCESS
           
 
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
GenericEmailSenderFormHandler()
           
 
Method Summary
protected  java.util.Map collectParams()
          Collect parameters for e-mail templates
 java.lang.String getActionResult()
           
 StoreEmailTools getEmailTools()
           
 java.lang.String getErrorURL()
           
 java.lang.String getMessage()
          Gets the value of the Message: field.
 java.lang.String getMessageParamName()
          Gets the name of the parameter used for the Message: field.
 atg.userprofiling.Profile getProfile()
          Gets the user profile associated with the email.
 atg.userprofiling.ProfileTools getProfileTools()
           
 java.lang.String getRecipientEmail()
          Gets the value of the RecipientEmail: field.
 java.lang.String getRecipientEmailParamName()
          Gets the name of the Email value used for the To: field.
 java.lang.String getRecipientName()
          Gets the value of the RecipientName: field.
 java.lang.String getRecipientNameParamName()
          Gets the name of the Name value used for the To: field.
 java.util.ResourceBundle getResourceBundle(atg.servlet.DynamoHttpServletRequest pRequest)
           
 java.lang.String getResourceBundleName()
           
 java.lang.String getSenderEmail()
          Gets the value of the SenderEmail: field.
 java.lang.String getSenderEmailParamName()
          Gets the name of the Email value used for the From: field.
 java.lang.String getSenderName()
          Gets the value of the SenderName: field.
 java.lang.String getSenderNameParamName()
          Gets the name of the Name value used for the From: field.
 java.lang.String getSiteId()
          Gets the value of the SiteId: field.
 java.lang.String getSiteIdParamName()
          Gets the name of the parameter used for the SiteId: field.
 java.lang.String getSubject()
           
 java.lang.String getSubjectParamName()
           
 java.lang.String getSuccessURL()
           
 java.lang.String getTemplateUrl()
          Gets the URL for the email template used to send the email.
 java.lang.String getTemplateUrlName()
           
 boolean handleSend(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Handles the form submit and sends the email.
 void processException(java.lang.Throwable pException, java.lang.String pMsgId, atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Add a user error message to the form exceptions.
 void setActionResult(java.lang.String pActionResult)
           
 void setEmailTools(StoreEmailTools pEmailTools)
           
 void setErrorURL(java.lang.String pErrorURL)
          Sets the URL of the error page.
 void setMessage(java.lang.String pMessage)
          Sets the value of the Message: field.
 void setMessageParamName(java.lang.String pMessageParamName)
          Sets the name of the parameter used for the Message: field.
 void setProfile(atg.userprofiling.Profile pProfile)
          Sets The user profile associated with the email.
 void setRecipientEmail(java.lang.String pRecipientEmail)
          Sets the value of the RecipientEmail: field.
 void setRecipientEmailParamName(java.lang.String pRecipientEmailParamName)
          Sets the name of the Email value used for the To: field.
 void setRecipientName(java.lang.String pRecipientName)
          Sets the value of the RecipientName: field.
 void setRecipientNameParamName(java.lang.String pRecipientNameParamName)
          Sets the name of the Name value used for the To: field.
 void setResourceBundleName(java.lang.String pResourceBundleName)
           
 void setSenderEmail(java.lang.String pSenderEmail)
          Sets the value of the SenderEmail: field.
 void setSenderEmailParamName(java.lang.String pSenderEmailParamName)
          Sets the name of the Email value used for the From: field.
 void setSenderName(java.lang.String pSenderName)
          Sets the value of the SenderName: field.
 void setSenderNameParamName(java.lang.String pSenderNameParamName)
          Sets the name of the Name value used for the From: field.
 void setSiteId(java.lang.String pSiteId)
          Sets the value of the SiteId: field.
 void setSiteIdParamName(java.lang.String pSiteIdParamName)
          Sets the name of the parameter used for the SiteId: field.
 void setSubject(java.lang.String pSubject)
           
 void setSubjectParamName(java.lang.String pSubjectParamName)
           
 void setSuccessURL(java.lang.String pSuccessURL)
          Sets the URL of the success page.
 void setTemplateUrl(java.lang.String pTemplateUrl)
          Sets the URL for the email template used to send the email.
 void setTemplateUrlName(java.lang.String pTemplateUrlName)
           
 
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, reResolveThis, 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, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

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


MSG_ACTION_SUCCESS

public static final java.lang.String MSG_ACTION_SUCCESS
See Also:
Constant Field Values
Constructor Detail

GenericEmailSenderFormHandler

public GenericEmailSenderFormHandler()
Method Detail

getSubject

public java.lang.String getSubject()
Returns:
the String

setSubject

public void setSubject(java.lang.String pSubject)
Parameters:
Subject - the String to set

getSuccessURL

public java.lang.String getSuccessURL()
Returns:
the URL of the success page.

setSuccessURL

public void setSuccessURL(java.lang.String pSuccessURL)
Sets the URL of the success page.

Parameters:
pSuccessURL - - the URL of the success page

getErrorURL

public java.lang.String getErrorURL()
Returns:
the URL of the error page.

setErrorURL

public void setErrorURL(java.lang.String pErrorURL)
Sets the URL of the error page.

Parameters:
pErrorURL - - the URL of the error page

getRecipientName

public java.lang.String getRecipientName()
Gets the value of the RecipientName: field.

Returns:
the value of the RecipientName: field.

setRecipientName

public void setRecipientName(java.lang.String pRecipientName)
Sets the value of the RecipientName: field.

Parameters:
pRecipientName - - the value of the RecipientName: field.

getRecipientEmail

public java.lang.String getRecipientEmail()
Gets the value of the RecipientEmail: field.

Returns:
the value of the RecipientEmail: field.

setRecipientEmail

public void setRecipientEmail(java.lang.String pRecipientEmail)
Sets the value of the RecipientEmail: field.

Parameters:
pRecipientEmail - - the value of the RecipientEmail: field.

getSenderName

public java.lang.String getSenderName()
Gets the value of the SenderName: field.

Returns:
the value of the SenderName: field.

setSenderName

public void setSenderName(java.lang.String pSenderName)
Sets the value of the SenderName: field.

Parameters:
pSenderName - - the value of the SenderName: field.

getSenderEmail

public java.lang.String getSenderEmail()
Gets the value of the SenderEmail: field.

Returns:
the value of the SenderEmail: field.

setSenderEmail

public void setSenderEmail(java.lang.String pSenderEmail)
Sets the value of the SenderEmail: field.

Parameters:
pSenderEmail - - the value of the SenderEmail: field.

getSiteId

public java.lang.String getSiteId()
Gets the value of the SiteId: field.

Returns:
the value of the SiteId: field.

setSiteId

public void setSiteId(java.lang.String pSiteId)
Sets the value of the SiteId: field.

Parameters:
pSiteId - - the value of the SiteId: field.

getMessage

public java.lang.String getMessage()
Gets the value of the Message: field.

Returns:
the value of the Message: field.

setMessage

public void setMessage(java.lang.String pMessage)
Sets the value of the Message: field.

Parameters:
pMessage - - the value of the Message: field.

setTemplateUrl

public void setTemplateUrl(java.lang.String pTemplateUrl)
Sets the URL for the email template used to send the email. This is configured in the component property file.

Parameters:
pTemplateUrl - - the URL

getTemplateUrl

public java.lang.String getTemplateUrl()
Gets the URL for the email template used to send the email. This is configured in the component property file.

Returns:
the URL

getTemplateUrlName

public java.lang.String getTemplateUrlName()
Returns:
the String

setTemplateUrlName

public void setTemplateUrlName(java.lang.String pTemplateUrlName)
Parameters:
mTemplateUrlName - the String to set

getRecipientNameParamName

public java.lang.String getRecipientNameParamName()
Gets the name of the Name value used for the To: field. This is configured in the component property file.

Returns:
the name of the Name value used for the To: field.

setRecipientNameParamName

public void setRecipientNameParamName(java.lang.String pRecipientNameParamName)
Sets the name of the Name value used for the To: field. This is configured in the component property file.

Parameters:
pRecipientNameParamName - - the name of the Name value used for the To: field.

getRecipientEmailParamName

public java.lang.String getRecipientEmailParamName()
Gets the name of the Email value used for the To: field. This is configured in the component property file.

Returns:
the name of the Email value used for the To: field.

setRecipientEmailParamName

public void setRecipientEmailParamName(java.lang.String pRecipientEmailParamName)
Sets the name of the Email value used for the To: field. This is configured in the component property file.

Parameters:
pRecipientEmailParamName - - the name of the Email value used for the To: field.

getSenderNameParamName

public java.lang.String getSenderNameParamName()
Gets the name of the Name value used for the From: field. This is configured in the component property file.

Returns:
the name of the Name value used for the from field.

setSenderNameParamName

public void setSenderNameParamName(java.lang.String pSenderNameParamName)
Sets the name of the Name value used for the From: field. This is configured in the component property file.

Parameters:
pSenderNameParamName - - the name of the Name value used for the From: field.

getSenderEmailParamName

public java.lang.String getSenderEmailParamName()
Gets the name of the Email value used for the From: field. This is configured in the component property file.

Returns:
the name of the Email value used for the From: field.

setSenderEmailParamName

public void setSenderEmailParamName(java.lang.String pSenderEmailParamName)
Sets the name of the Email value used for the From: field. This is configured in the component property file.

Parameters:
pSenderEmailParamName - - the name of the Email value used for the From: field.

getMessageParamName

public java.lang.String getMessageParamName()
Gets the name of the parameter used for the Message: field. This is configured in the component property file.

Returns:
the name of the parameter used for the Message: field.

setMessageParamName

public void setMessageParamName(java.lang.String pMessageParamName)
Sets the name of the parameter used for the Message: field. This is configured in the component property file.

Parameters:
pMessageParamName - - the name of the parameter used for the Comment: field.

getSiteIdParamName

public java.lang.String getSiteIdParamName()
Gets the name of the parameter used for the SiteId: field. This is configured in the component property file.

Returns:
the name of the parameter used for the SiteId: field.

setSiteIdParamName

public void setSiteIdParamName(java.lang.String pSiteIdParamName)
Sets the name of the parameter used for the SiteId: field. This is configured in the component property file.

Parameters:
pSiteIdParamName - - the name of the parameter used for the Comment: field.

getProfileTools

public atg.userprofiling.ProfileTools getProfileTools()
Returns:
the ProfileTools.

getEmailTools

public StoreEmailTools getEmailTools()
Returns:
the StoreEmailTools

setEmailTools

public void setEmailTools(StoreEmailTools pEmailTools)
Parameters:
EmailTools - the StoreEmailTools to set

setProfile

public void setProfile(atg.userprofiling.Profile pProfile)
Sets The user profile associated with the email. The default profile is used here. This is configured in the component property file.

Parameters:
pProfile - - the user profile of the logged in user.

getProfile

public atg.userprofiling.Profile getProfile()
Gets the user profile associated with the email. The default profile is used here. This is configured in the component property file.

Returns:
the user profile of the logged in user.

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns:
the location of the resources bundle.

setResourceBundleName

public void setResourceBundleName(java.lang.String pResourceBundleName)
Parameters:
pResourceBundleName - - the location of the resource bundle.

getResourceBundle

public java.util.ResourceBundle getResourceBundle(atg.servlet.DynamoHttpServletRequest pRequest)
Returns:
the request specific resources bundle.

getSubjectParamName

public java.lang.String getSubjectParamName()
Returns:
the String

setSubjectParamName

public void setSubjectParamName(java.lang.String pSubjectParamName)
Parameters:
SubjectParamName - the String to set

getActionResult

public java.lang.String getActionResult()
Returns:
the String

setActionResult

public void setActionResult(java.lang.String pActionResult)
Parameters:
ActionResult - the String to set

handleSend

public boolean handleSend(atg.servlet.DynamoHttpServletRequest pRequest,
                          atg.servlet.DynamoHttpServletResponse pResponse)
                   throws java.lang.Exception
Handles the form submit and sends the email.

Parameters:
pRequest - - http request
pResponse - - http response
Returns:
true on success, false - otherwise
Throws:
java.lang.Exception - if error occurs

collectParams

protected java.util.Map collectParams()
Collect parameters for e-mail templates

Returns:
map of parameters

processException

public void processException(java.lang.Throwable pException,
                             java.lang.String pMsgId,
                             atg.servlet.DynamoHttpServletRequest pRequest,
                             atg.servlet.DynamoHttpServletResponse pResponse)
Add a user error message to the form exceptions.

Parameters:
pException - - exception to process
pMsgId - - message id
pRequest - - http request
pResponse - - http response