atg.projects.store.email
Class TesterEmailTools

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.logging.ApplicationLoggingImpl
          extended by atg.projects.store.email.StoreEmailTools
              extended by atg.projects.store.email.TesterEmailTools
All Implemented Interfaces:
atg.nucleus.logging.ApplicationLogging, atg.nucleus.logging.ApplicationLoggingSender, atg.nucleus.logging.TraceApplicationLogging, atg.nucleus.logging.VariableArgumentApplicationLogging

public class TesterEmailTools
extends StoreEmailTools

Utility methods for e-mail templates testing.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String EMAIL_A_FRIEND_MESSAGE
           
static java.lang.String EMAIL_PARAMETER
           
static java.lang.String FIRST_NAME_PROP
           
static java.lang.String LOCALE_PARAMETER
           
protected  StoreCatalogTools mCatalogTools
           
static java.lang.String NEWPASSWORD_PARAMETER
           
static java.lang.String ORDER_PARAMETER
           
static java.lang.String PRODUCT_ID_PARAMETER
           
static java.lang.String PROFILE_PARAMETER
           
static java.lang.String RECIPIENT_EMAIL_PARAMETER
           
static java.lang.String RECIPIENT_NAME_PARAMETER
           
static java.lang.String SHIPPING_GROUP_PARAMETER
           
static java.lang.String SITE_ID_PARAMETER
           
static java.lang.String SITE_IDS_PARAMETER
           
static java.lang.String SITE_PARAMETER
           
static java.lang.String SKU_ID_PARAMETER
           
static java.lang.String SKU_PARAMETER
           
static java.lang.String USER_TYPE
           
 
Fields inherited from class atg.projects.store.email.StoreEmailTools
EMAIL_SUBJECT, MSG_EMPTY_MESSAGE, MSG_EMPTY_SUBJECT, MSG_ERR_BAD_EMAIL, MSG_ERR_CREATING_EMAIL_RECIPIENT, MSG_INVALID_RECIPIENT_EMAIL, MSG_INVALID_RECIPIENT_EMAIL_FORMAT, MSG_INVALID_SENDER_EMAIL, MSG_INVALID_SENDER_EMAIL_FORMAT, MSG_NO_EMAIL_HOST_NAME, MSG_NO_RECIPIENT_EMAIL, MSG_NO_SENDER_EMAIL, MSG_NO_SENDER_FIRST_NAME, MSG_NO_SENDER_LAST_NAME, mStoreSitePropertiesManager, STATUS_ERROR_REDIRECT, STATUS_ERROR_STAY, STATUS_SUCCESS
 
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
TesterEmailTools()
           
 
Method Summary
protected  java.util.List addRecipients(atg.userprofiling.Profile pProfile, atg.userprofiling.email.TemplateEmailInfoImpl pEmailInfo)
          Returns list of recipients
 StoreCatalogTools getCatalogTools()
          Get the CatalogTools object to use when looking up products, categories and SKUs.
 atg.service.util.CurrentDate getCurrentDate()
          Gets the CurrentDate component.
 java.lang.String getProductIdForSKU(java.lang.String pSkuId)
          Gets parent product ID for a specified SKU.
 RecentlySentList getSentList()
           
 boolean isValidOrderId(java.lang.String pOrderId, java.lang.String pSiteId)
          Finds order in repository.
 boolean isValidProductId(java.lang.String pProductId, java.lang.String pSiteId)
          Finds product in repository.
 boolean isValidShippingGroupId(java.lang.String pShippingGroupId, java.lang.String pSiteId)
          Finds shipping group in repository.
 boolean isValidSkuId(java.lang.String pSkuId, java.lang.String pSiteId)
          Finds SKU in repository.
 java.util.Map prepareEmailInfoParams(atg.userprofiling.Profile pProfile, atg.userprofiling.email.TemplateEmailInfoImpl pEmailInfo, java.util.Map pEmailParams)
          Prepare email parameters before sending
protected  void saveEmailInfo(java.util.Map pPreparedParams, java.lang.String pTemplateUrl)
          Save email information into the list of recently sent
 void setCatalogTools(StoreCatalogTools pCatalogTools)
          Set the CatalogTools object to use when looking up products, categories and SKUs.
 void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
          Sets the CurrentDate component.
 void setSentList(RecentlySentList pSentList)
           
 
Methods inherited from class atg.projects.store.email.StoreEmailTools
createQualifiedString, createSender, getCatalogRepository, getDefaultEmailInfo, getDefaultLocaleString, getDisplayNamePropertyName, getEmailAFriendResourceBundle, getEmailAFriendResourceBundleName, getEmailSender, getLocaleParamName, getMessageParamName, getOrderRepository, getProductIdParamName, getProductItemName, getProfileParamName, getProfileTools, getPromoTemplateUrls, getPropertyManager, getRecipientEmailParamName, getRecipientNameParamName, getSenderEmailParamName, getSenderNameParamName, getSiteIdParamName, getStoreNameResource, getStoreSitePropertiesManager, getSubject, getSubjectParamName, getTemplateUrl, getTemplateUrlName, getTransactionManager, isPersistEmails, isSendEmailInSeparateThread, prepareEmailInfo, sendEmail, setCatalogRepository, setDefaultEmailInfo, setDefaultLocale, setDisplayNamePropertyName, setEmailAFriendResourceBundleName, setEmailSender, setLocaleParamName, setMessageParamName, setOrderRepository, setPersistEmails, setProductIdParamName, setProductItemName, setProfileParamName, setProfileTools, setPromoTemplateUrls, setPropertyManager, setRecipientEmailParamName, setRecipientNameParamName, setSendEmailInSeparateThread, setSenderEmailParamName, setSenderNameParamName, setSiteIdParamName, setStoreNameResource, setStoreSitePropertiesManager, setSubjectParamName, setTemplateUrl, setTemplateUrlName, setTransactionManager, validateEmailAddress
 
Methods inherited from class atg.nucleus.logging.ApplicationLoggingImpl
addGlobalLogListeners, addLogListener, getLoggingForVlogging, getLoggingIdentifer, getLoggingIdentifier, getLogListenerCount, getLogListeners, initializeFromServiceEvent, isAutoInitListeners, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, removeLogListener, sendLogEvent, setAutoInitListeners, setLoggingDebug, setLoggingError, setLoggingIdentifier, setLoggingInfo, setLoggingTrace, setLoggingWarning
 
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

EMAIL_PARAMETER

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

ORDER_PARAMETER

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

SHIPPING_GROUP_PARAMETER

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

NEWPASSWORD_PARAMETER

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

SKU_ID_PARAMETER

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

EMAIL_A_FRIEND_MESSAGE

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

PRODUCT_ID_PARAMETER

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

LOCALE_PARAMETER

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

PROFILE_PARAMETER

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

SITE_PARAMETER

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

USER_TYPE

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

RECIPIENT_NAME_PARAMETER

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

RECIPIENT_EMAIL_PARAMETER

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

FIRST_NAME_PROP

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

SITE_ID_PARAMETER

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

SITE_IDS_PARAMETER

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

SKU_PARAMETER

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

mCatalogTools

protected StoreCatalogTools mCatalogTools
Constructor Detail

TesterEmailTools

public TesterEmailTools()
Method Detail

getSentList

public RecentlySentList getSentList()
Returns:
the mSentList

setSentList

public void setSentList(RecentlySentList pSentList)
Parameters:
pSentList - the sentList to set

setCatalogTools

public void setCatalogTools(StoreCatalogTools pCatalogTools)
Set the CatalogTools object to use when looking up products, categories and SKUs.

Parameters:
pCatalogTools - the catalogTools to set

getCatalogTools

public StoreCatalogTools getCatalogTools()
Get the CatalogTools object to use when looking up products, categories and SKUs.

Returns:
the mCatalogTools

setCurrentDate

public void setCurrentDate(atg.service.util.CurrentDate pCurrentDate)
Sets the CurrentDate component.


getCurrentDate

public atg.service.util.CurrentDate getCurrentDate()
Gets the CurrentDate component.


prepareEmailInfoParams

public java.util.Map prepareEmailInfoParams(atg.userprofiling.Profile pProfile,
                                            atg.userprofiling.email.TemplateEmailInfoImpl pEmailInfo,
                                            java.util.Map pEmailParams)
Prepare email parameters before sending

Overrides:
prepareEmailInfoParams in class StoreEmailTools
Parameters:
pProfile - the profile
pEmailInfo - email template
pEmailParams - map of parameters
Returns:
the prepared email parameters

saveEmailInfo

protected void saveEmailInfo(java.util.Map pPreparedParams,
                             java.lang.String pTemplateUrl)
Save email information into the list of recently sent

Parameters:
pPreparedParams - email parameters
pTemplateUrl - email template URL

addRecipients

protected java.util.List addRecipients(atg.userprofiling.Profile pProfile,
                                       atg.userprofiling.email.TemplateEmailInfoImpl pEmailInfo)
Returns list of recipients

Overrides:
addRecipients in class StoreEmailTools
Parameters:
pProfile - the profile
pEmailInfo - the email info
Returns:
list of recipients

isValidProductId

public boolean isValidProductId(java.lang.String pProductId,
                                java.lang.String pSiteId)
                         throws atg.repository.RepositoryException
Finds product in repository. Return true if product has been found for specified store. Return false if product hasn't been found.

Parameters:
pProductId - product ID parameter
pSiteId - site ID parameter
Returns:
true - if product has been found for specified store, false - if product hasn't been found
Throws:
atg.repository.RepositoryException - indicates that a severe error occured while performing a Repository task

isValidOrderId

public boolean isValidOrderId(java.lang.String pOrderId,
                              java.lang.String pSiteId)
                       throws atg.repository.RepositoryException
Finds order in repository. Return true if order has been found for specified store. Return false if order hasn't been found.

Parameters:
pOrderId - order ID parameter
pSiteId - site ID parameter
Returns:
true - if order has been found for specified store, false - if order hasn't been found
Throws:
atg.repository.RepositoryException - indicates that a severe error occured while performing a Repository task

isValidShippingGroupId

public boolean isValidShippingGroupId(java.lang.String pShippingGroupId,
                                      java.lang.String pSiteId)
                               throws atg.repository.RepositoryException
Finds shipping group in repository. Return true if shipping group has been found for specified store. Return false if shipping group hasn't been found.

Parameters:
pShippingGroupId - shipping group ID parameter
pSiteId - site ID parameter
Returns:
true - if shipping group has been found for specified store, false - if shipping group hasn't been found
Throws:
atg.repository.RepositoryException - indicates that a severe error occured while performing a Repository task

isValidSkuId

public boolean isValidSkuId(java.lang.String pSkuId,
                            java.lang.String pSiteId)
                     throws atg.repository.RepositoryException
Finds SKU in repository. Return true if SKU has been found for specified store. Return false if SKU hasn't been found.

Parameters:
pSkuId - SKU ID parameter
pSiteId - site ID parameter
Returns:
true - if SKU has been found for specified store, false - if SKU hasn't been found
Throws:
atg.repository.RepositoryException - indicates that a severe error occured while performing a Repository task

getProductIdForSKU

public java.lang.String getProductIdForSKU(java.lang.String pSkuId)
Gets parent product ID for a specified SKU. If SKU has more than one parent products, the first one is returned.

Parameters:
pSkuId - SKU ID to find product for
Returns:
product ID for the SKU