atg.projects.store.email
Class TemplateTesterFormHandler

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
                      extended by atg.projects.store.email.TemplateTesterFormHandler
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 TemplateTesterFormHandler
extends GenericEmailSenderFormHandler

Email templates form handler.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String EMAIL_ID_PARAM
           
static java.lang.String INVALID_ORDER_ID_MSG
           
static java.lang.String INVALID_PRODUCT_ID_MSG
           
static java.lang.String INVALID_SHIPPING_GROUP_ID_MSG
           
static java.lang.String INVALID_SKU_ID_MSG
           
static java.lang.String MISSING_REQUIRED_FIELD
           
static java.lang.String MSG_ACTION_SENT_EMAIL
           
static java.lang.String ORDER_ID_PROPERTY_NAME
           
static java.lang.String USER_PROFILE_TYPE
           
 
Fields inherited from class atg.projects.store.email.GenericEmailSenderFormHandler
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
TemplateTesterFormHandler()
           
 
Method Summary
protected  java.util.Map collectParams()
          Collect parameters for e-mail templates
 java.lang.String getApplyOrderErrorURL()
           
 java.lang.String getApplyOrderSuccessURL()
           
 java.lang.String getEmailAFriendMessage()
           
 java.lang.String getEmailAFriendMessageParameterName()
           
 java.lang.String getEmailLocale()
           
 java.lang.String getEmailLocaleName()
           
 java.lang.String getLogin()
           
 java.lang.String getNewPassword()
           
 java.lang.String getNewPasswordParameterName()
           
 java.lang.String getOrderId()
           
 atg.commerce.order.OrderManager getOrderManager()
           
 java.lang.String getOrderMessage()
           
 java.lang.String getOrderParameterName()
           
 java.lang.String getOrderRecipientEmail()
           
 java.lang.String getOrderRecipientName()
           
 java.lang.String getOrderSenderEmail()
           
 java.lang.String getOrderSenderName()
           
 java.lang.String getOrderSubject()
           
 StoreOrderTools getOrderTools()
           
 java.lang.String getPassword()
           
 java.lang.String getProductId()
           
 java.lang.String getProductIdParameterName()
           
 atg.userprofiling.Profile getProfile()
          Gets the user profile associated with the email.
 StoreRepositoryProfileItemFinder getProfileItemFinder()
           
protected  java.util.ResourceBundle getResourceBundle()
          Returns the error message ResourceBundle
 java.lang.String getResourceBundleName()
          Returns the name of the error message ResourceBundle
 TemplateTesterSessionBean getSessionBean()
           
 java.lang.String getShippingGroupId()
           
 java.lang.String getShippingGroupParameterName()
           
 java.lang.String getSkuId()
           
 java.lang.String getSkuIdParameterName()
           
 boolean handleApplyOrder(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Stores order ID into session bean along with other user's input.
 boolean handleInitFromSentList(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Initialize form handler based on information stored in recently sent list
 boolean handleInitializeForm(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Initializes form with values stored in session.
 boolean handleSend(atg.servlet.DynamoHttpServletRequest pRequest, atg.servlet.DynamoHttpServletResponse pResponse)
          Send email
 void initFromSentList(int pIndex)
          Initializes form with values stored in the recently sent list.
 void initializeForm()
          Initializes form with values stored in the session bean.
 void resetRequiredFieldsFormExceptions()
          Removes all 'missing required field' exceptions except of the one for order ID property.
 void setApplyOrderErrorURL(java.lang.String pApplyOrderErrorURL)
           
 void setApplyOrderSuccessURL(java.lang.String pApplyOrderSuccessURL)
           
 void setEmailAFriendMessage(java.lang.String pEmailAFriendMessage)
           
 void setEmailAFriendMessageParameterName(java.lang.String pEmailAFriendMessageParameterName)
           
 void setEmailLocale(java.lang.String pEmailLocale)
           
 void setEmailLocaleName(java.lang.String pEmailLocaleName)
           
 void setLogin(java.lang.String pLogin)
           
 void setNewPassword(java.lang.String pNewPassword)
           
 void setNewPasswordParameterName(java.lang.String pNewPasswordParameterName)
           
 void setOrderId(java.lang.String pOrderId)
           
 void setOrderManager(atg.commerce.order.OrderManager pOrderManager)
           
 void setOrderMessage(java.lang.String pOrderMessage)
           
 void setOrderParameterName(java.lang.String pOrderParameterName)
           
 void setOrderRecipientEmail(java.lang.String pOrderRecipientEmail)
           
 void setOrderRecipientName(java.lang.String pOrderRecipientName)
           
 void setOrderSenderEmail(java.lang.String pOrderSenderEmail)
           
 void setOrderSenderName(java.lang.String pOrderSenderName)
           
 void setOrderSubject(java.lang.String pOrderSubject)
           
 void setOrderTools(StoreOrderTools pOrderTools)
           
 void setPassword(java.lang.String pPassword)
           
 void setProductId(java.lang.String pProductId)
           
 void setProductIdParameterName(java.lang.String pProductIdParameterName)
           
 void setProfileItemFinder(StoreRepositoryProfileItemFinder pProfileItemFinder)
           
 void setSessionBean(TemplateTesterSessionBean pSessionBean)
           
 void setShippingGroupId(java.lang.String pShippingGroupId)
           
 void setShippingGroupParameterName(java.lang.String pShippingGroupParameterName)
           
 void setSkuId(java.lang.String pSkuId)
           
 void setSkuIdParameterName(java.lang.String pSkuIdParameterName)
           
 void storeUserInputsIntoSession()
          Stores user's input into session bean.
protected  void validateInputs()
          Check that items are acceptable on the selected site
 
Methods inherited from class atg.projects.store.email.GenericEmailSenderFormHandler
getActionResult, getEmailTools, getErrorURL, getMessage, getMessageParamName, getProfileTools, getRecipientEmail, getRecipientEmailParamName, getRecipientName, getRecipientNameParamName, getResourceBundle, getSenderEmail, getSenderEmailParamName, getSenderName, getSenderNameParamName, getSiteId, getSiteIdParamName, getSubject, getSubjectParamName, getSuccessURL, getTemplateUrl, getTemplateUrlName, processException, setActionResult, setEmailTools, setErrorURL, setMessage, setMessageParamName, setProfile, setRecipientEmail, setRecipientEmailParamName, setRecipientName, setRecipientNameParamName, setResourceBundleName, setSenderEmail, setSenderEmailParamName, setSenderName, setSenderNameParamName, setSiteId, setSiteIdParamName, setSubject, setSubjectParamName, setSuccessURL, setTemplateUrl, setTemplateUrlName
 
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, getAdminServletOutputStreamEncoding, getLoggingForVlogging, getLogListenerCount, getLogListeners, getName, getNameContext, getNucleus, getRoot, getServiceConfiguration, getServiceInfo, isAdminServletUseServletOutputStream, 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, setAdminServletOutputStreamEncoding, setAdminServletUseServletOutputStream, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingTrace, setLoggingWarning, setNucleus, setServiceInfo, startService, stopService
 
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogDebugTrace, 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 final java.lang.String CLASS_VERSION
Class version string

See Also:
Constant Field Values

INVALID_SKU_ID_MSG

public static final java.lang.String INVALID_SKU_ID_MSG
See Also:
Constant Field Values

INVALID_SHIPPING_GROUP_ID_MSG

public static final java.lang.String INVALID_SHIPPING_GROUP_ID_MSG
See Also:
Constant Field Values

INVALID_ORDER_ID_MSG

public static final java.lang.String INVALID_ORDER_ID_MSG
See Also:
Constant Field Values

INVALID_PRODUCT_ID_MSG

public static final java.lang.String INVALID_PRODUCT_ID_MSG
See Also:
Constant Field Values

EMAIL_ID_PARAM

public static final java.lang.String EMAIL_ID_PARAM
See Also:
Constant Field Values

USER_PROFILE_TYPE

public static final java.lang.String USER_PROFILE_TYPE
See Also:
Constant Field Values

ORDER_ID_PROPERTY_NAME

public static final java.lang.String ORDER_ID_PROPERTY_NAME
See Also:
Constant Field Values

MISSING_REQUIRED_FIELD

public static final java.lang.String MISSING_REQUIRED_FIELD
See Also:
Constant Field Values

MSG_ACTION_SENT_EMAIL

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

TemplateTesterFormHandler

public TemplateTesterFormHandler()
Method Detail

getNewPassword

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

setNewPassword

public void setNewPassword(java.lang.String pNewPassword)
Parameters:
pNewPassword - the String to set

getProfileItemFinder

public StoreRepositoryProfileItemFinder getProfileItemFinder()
Returns:
the ProfileItemFinder

setProfileItemFinder

public void setProfileItemFinder(StoreRepositoryProfileItemFinder pProfileItemFinder)
Parameters:
pProfileItemFinder - the ProfileItemFinder to set

getOrderManager

public atg.commerce.order.OrderManager getOrderManager()
Returns:
the OrderManager

setOrderManager

public void setOrderManager(atg.commerce.order.OrderManager pOrderManager)
Parameters:
pOrderManager - the OrderManager to set

getLogin

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

setLogin

public void setLogin(java.lang.String pLogin)
Parameters:
pLogin - the String to set

getPassword

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

setPassword

public void setPassword(java.lang.String pPassword)
Parameters:
pPassword - the String to set

getOrderId

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

setOrderId

public void setOrderId(java.lang.String pOrderId)
Parameters:
pOrderId - the String to set

getProductId

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

setProductId

public void setProductId(java.lang.String pProductId)
Parameters:
pProductId - the String to set

getSkuId

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

setSkuId

public void setSkuId(java.lang.String pSkuId)
Parameters:
pSkuId - the String to set

getShippingGroupId

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

setShippingGroupId

public void setShippingGroupId(java.lang.String pShippingGroupId)
Parameters:
pShippingGroupId - the String to set

getOrderTools

public StoreOrderTools getOrderTools()
Returns:
the OrderTools

setOrderTools

public void setOrderTools(StoreOrderTools pOrderTools)
Parameters:
pOrderTools - the OrderTools to set

getNewPasswordParameterName

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

setNewPasswordParameterName

public void setNewPasswordParameterName(java.lang.String pNewPasswordParameterName)
Parameters:
pNewPasswordParameterName - the String to set

getProductIdParameterName

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

setProductIdParameterName

public void setProductIdParameterName(java.lang.String pProductIdParameterName)
Parameters:
pProductIdParameterName - the String to set

getSkuIdParameterName

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

setSkuIdParameterName

public void setSkuIdParameterName(java.lang.String pSkuIdParameterName)
Parameters:
pSkuIdParameterName - the String to set

getEmailAFriendMessageParameterName

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

setEmailAFriendMessageParameterName

public void setEmailAFriendMessageParameterName(java.lang.String pEmailAFriendMessageParameterName)
Parameters:
pEmailAFriendMessageParameterName - the String to set

getOrderParameterName

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

setOrderParameterName

public void setOrderParameterName(java.lang.String pOrderParameterName)
Parameters:
pOrderParameterName - the String to set

getShippingGroupParameterName

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

setShippingGroupParameterName

public void setShippingGroupParameterName(java.lang.String pShippingGroupParameterName)
Parameters:
pShippingGroupParameterName - the String to set

getOrderRecipientEmail

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

setOrderRecipientEmail

public void setOrderRecipientEmail(java.lang.String pOrderRecipientEmail)
Parameters:
pOrderRecipientEmail - the String to set

getOrderRecipientName

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

setOrderRecipientName

public void setOrderRecipientName(java.lang.String pOrderRecipientName)
Parameters:
pOrderRecipientName - the String to set

getOrderSenderName

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

setOrderSenderName

public void setOrderSenderName(java.lang.String pOrderSenderName)
Parameters:
pOrderSenderName - the String to set

getOrderSenderEmail

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

setOrderSenderEmail

public void setOrderSenderEmail(java.lang.String pOrderSenderEmail)
Parameters:
pOrderSenderEmail - the String to set

getOrderSubject

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

setOrderSubject

public void setOrderSubject(java.lang.String pOrderSubject)
Parameters:
pOrderSubject - the String to set

getOrderMessage

public java.lang.String getOrderMessage()
Returns:
the Type

setOrderMessage

public void setOrderMessage(java.lang.String pOrderMessage)
Parameters:
pOrderMessage - the Type to set

getEmailAFriendMessage

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

setEmailAFriendMessage

public void setEmailAFriendMessage(java.lang.String pEmailAFriendMessage)
Parameters:
pEmailAFriendMessage - the String to set

getEmailLocale

public java.lang.String getEmailLocale()
Returns:
the mEmailLocale

setEmailLocale

public void setEmailLocale(java.lang.String pEmailLocale)
Parameters:
pEmailLocale - the emailLocale to set

getEmailLocaleName

public java.lang.String getEmailLocaleName()
Returns:
the mEmailLocaleName

setEmailLocaleName

public void setEmailLocaleName(java.lang.String pEmailLocaleName)
Parameters:
pEmailLocaleName - the emailLocaleName to set

getApplyOrderSuccessURL

public java.lang.String getApplyOrderSuccessURL()
Returns:
the mApplyOrderSuccessURL

setApplyOrderSuccessURL

public void setApplyOrderSuccessURL(java.lang.String pApplyOrderSuccessURL)
Parameters:
pApplyOrderSuccessURL - the applyOrderSuccessURL

getApplyOrderErrorURL

public java.lang.String getApplyOrderErrorURL()
Returns:
the mApplyOrderErrorURL

setApplyOrderErrorURL

public void setApplyOrderErrorURL(java.lang.String pApplyOrderErrorURL)
Parameters:
pApplyOrderErrorURL - the applyOrderErrorURL to set

getSessionBean

public TemplateTesterSessionBean getSessionBean()
Returns:
mSessionBean

setSessionBean

public void setSessionBean(TemplateTesterSessionBean pSessionBean)
Parameters:
pSessionBean - the sessionBean to set

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.

Overrides:
getProfile in class GenericEmailSenderFormHandler
Returns:
the user profile of the logged in user.

getResourceBundle

protected java.util.ResourceBundle getResourceBundle()
Returns the error message ResourceBundle

Returns:
the sResourceBundle

getResourceBundleName

public java.lang.String getResourceBundleName()
Returns the name of the error message ResourceBundle

Overrides:
getResourceBundleName in class GenericEmailSenderFormHandler
Returns:
the MY_RESOURCE_NAME

collectParams

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

Overrides:
collectParams in class GenericEmailSenderFormHandler
Returns:
map of parameters

handleApplyOrder

public boolean handleApplyOrder(atg.servlet.DynamoHttpServletRequest pRequest,
                                atg.servlet.DynamoHttpServletResponse pResponse)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Stores order ID into session bean along with other user's input.

Parameters:
pRequest - HTTP request
pResponse - HTTP response
Returns:
If redirect (for whatever reason) to a new page occurred, return false. If NO redirect occurred, return true.
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

resetRequiredFieldsFormExceptions

public void resetRequiredFieldsFormExceptions()
Removes all 'missing required field' exceptions except of the one for order ID property. It is necessary when applyOrder handler is used in forms with several submit buttons. For apply order action only order ID property is required, other required fields will be ignored.


handleInitializeForm

public boolean handleInitializeForm(atg.servlet.DynamoHttpServletRequest pRequest,
                                    atg.servlet.DynamoHttpServletResponse pResponse)
Initializes form with values stored in session.

Parameters:
pRequest - HTTP request
pResponse - HTTP response
Returns:
true
Throws:
java.lang.Exception

handleInitFromSentList

public boolean handleInitFromSentList(atg.servlet.DynamoHttpServletRequest pRequest,
                                      atg.servlet.DynamoHttpServletResponse pResponse)
                               throws java.lang.NumberFormatException
Initialize form handler based on information stored in recently sent list

Parameters:
pRequest - dynamo http request
pResponse - dynamo http response
Returns:
true
Throws:
java.lang.NumberFormatException - application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.

handleSend

public boolean handleSend(atg.servlet.DynamoHttpServletRequest pRequest,
                          atg.servlet.DynamoHttpServletResponse pResponse)
                   throws java.io.IOException,
                          javax.servlet.ServletException
Send email

Overrides:
handleSend in class GenericEmailSenderFormHandler
Parameters:
pRequest - dynamo http request
pResponse - dynamo http response
Returns:
true on success, false - otherwise
Throws:
javax.servlet.ServletException - if there was an error while executing the code
java.io.IOException - if there was an error with servlet io

validateInputs

protected void validateInputs()
                       throws atg.repository.RepositoryException
Check that items are acceptable on the selected site

Throws:
atg.repository.RepositoryException - indicates that a severe error occured while performing a Repository task

storeUserInputsIntoSession

public void storeUserInputsIntoSession()
Stores user's input into session bean.


initializeForm

public void initializeForm()
Initializes form with values stored in the session bean.


initFromSentList

public void initFromSentList(int pIndex)
Initializes form with values stored in the recently sent list.

Parameters:
pIndex - - index of SentItem object in the list. We use SentItem to initialize form handler fields