atg.userprofiling.email
Class TemplateEmailInfoImpl

java.lang.Object
  extended by atg.nucleus.logging.VariableArgumentApplicationLoggingImpl
      extended by atg.nucleus.logging.LoggingFormatter
          extended by atg.userprofiling.email.TemplateEmailInfo
              extended by atg.userprofiling.email.TemplateEmailInfoImpl
All Implemented Interfaces:
ApplicationLogging, VariableArgumentApplicationLogging, java.io.Serializable

public class TemplateEmailInfoImpl
extends TemplateEmailInfo
implements java.io.Serializable

A concrete extension of the TemplateEmailInfo class that contains the standard email message attributes as properties (messageFrom, messageSubject, etc.) and uses them to construct Message objects.

See Also:
TemplateEmailInfo, MessageContentProcessor, Message, Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
static java.lang.String PROFILE_ID_TRACKING_DATA_KEY
          The key used to store the profileId in the outgoing email tracking data
 
Fields inherited from class atg.nucleus.logging.LoggingFormatter
mApplicationLogger, mErrorCount, mLoggingDebug, mLoggingError, mLoggingInfo, mLoggingTrace, mLoggingWarning, mWarningCount
 
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
TemplateEmailInfoImpl()
           
 
Method Summary
protected  void appendProperties(java.lang.StringBuffer pBuffer)
          Append any properties for debugging.
 TemplateEmailInfo copy()
          Returns a copy of this TemplateEmailInfo.
 void copyPropertiesTo(TemplateEmailInfo pCopy)
          Copy known properties to pCopy.
 javax.mail.Message createMessage(java.lang.String pRecipient, java.lang.String[] pContents, java.lang.String[] pContentTypes)
          Creates and returns a Message object with the given email recipient and content.
 javax.mail.Message createMessage(java.lang.String pRecipient, java.lang.String pContent, java.lang.String pContentType)
          Creates and returns a Message object with the given email recipient and content.
 MessageContentProcessor getContentProcessor()
          Returns the MessageContentProcessor object used to process the message text and set the content of the email message.
protected  java.util.Locale getLocaleForMessageResources()
          Returns the locale used for message resource lookup in following order: (1) 'local' param in request (2) messageResourceLocale if set (3) current user locale
 java.lang.String getMailingName()
          Returns the MailingName field for the email.
 java.lang.String getMailingNameResourceKey()
          Returns the message bundle resource key for the MailingName field for the email.
 java.lang.String getMessageBcc()
          Returns the Bcc field for the email.
 java.lang.String getMessageBccResourceKey()
          Returns the message bundle resource key for the Bcc field for the email.
 java.lang.String getMessageCc()
          Returns the CC field for the email.
 java.lang.String getMessageCcResourceKey()
          Returns the message bundle resource key for the CC field for the email.
 java.lang.String getMessageFrom()
          Returns the From field for the email.
 java.lang.String getMessageFromResourceKey()
          Returns the message bundle resource key for the From field for the email.
 java.lang.String getMessageReplyTo()
          Returns the ReplyTo field for the email.
 java.lang.String getMessageReplyToResourceKey()
          Returns the message bundle resource key for the ReplyTo field for the email.
 java.lang.String getMessageResourceBundleName()
          Gets the name for MessageResourceBundle
 java.util.Locale getMessageResourceLocale()
          Gets the Locale used to lookup resources for the email
 java.lang.String getMessageSubject()
          Returns the Subject field for the email.
 java.lang.String getMessageSubjectResourceKey()
          Returns the message bundle resource key for the Subject field for the email.
 java.lang.String getMessageTo()
          Returns the To field for the email.
 java.lang.String getMessageToResourceKey()
          NOTE: Generally we should leave the messageToResourceKey null since defining a message in the resource bundle will always override the pRecipients passed into createMessage.
 java.lang.String getProfileId()
          Gets the profile id associated with the email.
 java.util.Map getTrackingData()
          Returns the tracking data to associate with the email.
 atg.userprofiling.email.TemplateEmailTransitoryInfo getTransitoryInfo()
          Get the transitory info.
protected  java.util.ResourceBundle getUserMessageResourceBundle()
          Resource bundle for uses request Locale
 void setContentProcessor(MessageContentProcessor pContentProcessor)
          Sets the MessageContentProcessor object used to process the message text and set the content of the email message.
 void setMailingName(java.lang.String pMailingName)
          Sets the MailingName field for the email.
 void setMailingNameResourceKey(java.lang.String pMailingNameResourceKey)
          Sets the message bundle resource key for the MailingName field for the email.
 void setMessageBcc(java.lang.String pMessageBcc)
          Sets the Bcc field for the email.
 void setMessageBccResourceKey(java.lang.String pMessageBccResourceKey)
          Sets the message bundle resource key for the Bcc field for the email.
 void setMessageCc(java.lang.String pMessageCc)
          Sets the CC field for the email.
 void setMessageCcResourceKey(java.lang.String pMessageCcResourceKey)
          Sets the message bundle resource key for the CC field for the email.
 void setMessageFrom(java.lang.String pMessageFrom)
          Sets the From field for the email.
 void setMessageFromResourceKey(java.lang.String pMessageFromResourceKey)
          Sets the message bundle resource key for the From field for the email.
 void setMessageReplyTo(java.lang.String pMessageReplyTo)
          Sets the ReplyTo field for the email.
 void setMessageReplyToResourceKey(java.lang.String pMessageReplyToResourceKey)
          Sets the message bundle resource key for the ReplyTo field for the email.
 void setMessageResourceBundleName(java.lang.String pMessageResourceBundleName)
          Sets the the name for MessageResourceBundle.
 void setMessageResourceLocale(java.util.Locale pMessageResourceLocale)
          Sets the Locale used to lookup resources for the email
 void setMessageSubject(java.lang.String pMessageSubject)
          Sets the Subject field for the email.
 void setMessageSubjectResourceKey(java.lang.String pMessageSubjectResourceKey)
          Sets the message bundle resource key for the Subject field for the email.
 void setMessageTo(java.lang.String pMessageTo)
          Sets the To field for the email.
 void setMessageToResourceKey(java.lang.String pMessageToResourceKey)
          NOTE: Generally we should leave the messageToResourceKey null since defining a message in the resource bundle will always override the pRecipients passed into createMessage.
 void setProfileId(java.lang.String pProfileId)
          Sets the profile id associated with the email.
 void setTrackingData(java.util.Map pTrackingData)
          Sets the tracking data to associate with the email.
 void setTransitoryInfo(atg.userprofiling.email.TemplateEmailTransitoryInfo pTransitoryInfo)
          Set the transitory info.
 boolean supportsMultipleContents()
          Whether or not we support creating a message with multiple contents passed in.
 
Methods inherited from class atg.userprofiling.email.TemplateEmailInfo
addParameterProcessor, getAltTemplateURL, getBatchExecutionId, getBatchSize, getFillFromTemplate, getIgnoreContactFatigue, getLocaleMappedAltTemplateURLs, getLocaleMappedTemplateURLs, getMailingId, getMessageAttachments, getParameterProcessors, getSiteId, getTemplateParameters, getTemplateURL, isBatched, isIncludeEmailInErrors, setAltTemplateURL, setBatched, setBatchExecutionId, setBatchSize, setFillFromTemplate, setIgnoreContactFatigue, setIncludeEmailInErrors, setLocaleMappedAltTemplateURLs, setLocaleMappedTemplateURLs, setMailingId, setMessageAttachments, setParameterProcessors, setSiteId, setTemplateParameters, setTemplateURL, toString
 
Methods inherited from class atg.nucleus.logging.LoggingFormatter
format, getErrorCount, getLoggingForVlogging, getLoggingIdentifier, getWarningCount, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingTrace, isLoggingWarning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logTrace, logTrace, logTrace, logWarning, logWarning, logWarning, setApplicationLogger, setLoggingDebug, setLoggingError, 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, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


PROFILE_ID_TRACKING_DATA_KEY

public static final java.lang.String PROFILE_ID_TRACKING_DATA_KEY
The key used to store the profileId in the outgoing email tracking data

See Also:
Constant Field Values
Constructor Detail

TemplateEmailInfoImpl

public TemplateEmailInfoImpl()
Method Detail

getMailingName

public java.lang.String getMailingName()
Returns the MailingName field for the email.


setMailingName

public void setMailingName(java.lang.String pMailingName)
Sets the MailingName field for the email.


getMessageReplyTo

public java.lang.String getMessageReplyTo()
Returns the ReplyTo field for the email.


setMessageReplyTo

public void setMessageReplyTo(java.lang.String pMessageReplyTo)
Sets the ReplyTo field for the email.


setMessageTo

public void setMessageTo(java.lang.String pMessageTo)
Sets the To field for the email.


getMessageTo

public java.lang.String getMessageTo()
Returns the To field for the email.


getMessageFrom

public java.lang.String getMessageFrom()
Returns the From field for the email.


setMessageFrom

public void setMessageFrom(java.lang.String pMessageFrom)
Sets the From field for the email.


getMessageCc

public java.lang.String getMessageCc()
Returns the CC field for the email.


setMessageCc

public void setMessageCc(java.lang.String pMessageCc)
Sets the CC field for the email.


getMessageBcc

public java.lang.String getMessageBcc()
Returns the Bcc field for the email.


setMessageBcc

public void setMessageBcc(java.lang.String pMessageBcc)
Sets the Bcc field for the email.


getMessageSubject

public java.lang.String getMessageSubject()
Returns the Subject field for the email.


setMessageSubject

public void setMessageSubject(java.lang.String pMessageSubject)
Sets the Subject field for the email.


getMailingNameResourceKey

public java.lang.String getMailingNameResourceKey()
Returns the message bundle resource key for the MailingName field for the email.


setMailingNameResourceKey

public void setMailingNameResourceKey(java.lang.String pMailingNameResourceKey)
Sets the message bundle resource key for the MailingName field for the email.


getMessageReplyToResourceKey

public java.lang.String getMessageReplyToResourceKey()
Returns the message bundle resource key for the ReplyTo field for the email.


setMessageReplyToResourceKey

public void setMessageReplyToResourceKey(java.lang.String pMessageReplyToResourceKey)
Sets the message bundle resource key for the ReplyTo field for the email.


getMessageFromResourceKey

public java.lang.String getMessageFromResourceKey()
Returns the message bundle resource key for the From field for the email.


setMessageFromResourceKey

public void setMessageFromResourceKey(java.lang.String pMessageFromResourceKey)
Sets the message bundle resource key for the From field for the email.


getMessageCcResourceKey

public java.lang.String getMessageCcResourceKey()
Returns the message bundle resource key for the CC field for the email.


setMessageCcResourceKey

public void setMessageCcResourceKey(java.lang.String pMessageCcResourceKey)
Sets the message bundle resource key for the CC field for the email.


getMessageBccResourceKey

public java.lang.String getMessageBccResourceKey()
Returns the message bundle resource key for the Bcc field for the email.


setMessageBccResourceKey

public void setMessageBccResourceKey(java.lang.String pMessageBccResourceKey)
Sets the message bundle resource key for the Bcc field for the email.


getMessageSubjectResourceKey

public java.lang.String getMessageSubjectResourceKey()
Returns the message bundle resource key for the Subject field for the email.


setMessageSubjectResourceKey

public void setMessageSubjectResourceKey(java.lang.String pMessageSubjectResourceKey)
Sets the message bundle resource key for the Subject field for the email.


getMessageToResourceKey

public java.lang.String getMessageToResourceKey()
NOTE: Generally we should leave the messageToResourceKey null since defining a message in the resource bundle will always override the pRecipients passed into createMessage. Initially null but can be overridden if you want to hard-code the To address and want to be able to localize it.


setMessageToResourceKey

public void setMessageToResourceKey(java.lang.String pMessageToResourceKey)
NOTE: Generally we should leave the messageToResourceKey null since defining a message in the resource bundle will always override the pRecipients passed into createMessage. Initially null but can be overridden if you want to hard-code the To address and want to be able to localize it.


getTrackingData

public java.util.Map getTrackingData()
Returns the tracking data to associate with the email.


setTrackingData

public void setTrackingData(java.util.Map pTrackingData)
Sets the tracking data to associate with the email.


getProfileId

public java.lang.String getProfileId()
Gets the profile id associated with the email.


setProfileId

public void setProfileId(java.lang.String pProfileId)
Sets the profile id associated with the email.


getMessageResourceLocale

public java.util.Locale getMessageResourceLocale()
Gets the Locale used to lookup resources for the email


setMessageResourceLocale

public void setMessageResourceLocale(java.util.Locale pMessageResourceLocale)
Sets the Locale used to lookup resources for the email


getMessageResourceBundleName

public java.lang.String getMessageResourceBundleName()
Gets the name for MessageResourceBundle


setMessageResourceBundleName

public void setMessageResourceBundleName(java.lang.String pMessageResourceBundleName)
Sets the the name for MessageResourceBundle.


getUserMessageResourceBundle

protected java.util.ResourceBundle getUserMessageResourceBundle()
                                                         throws TemplateEmailException
Resource bundle for uses request Locale

Throws:
TemplateEmailException

getLocaleForMessageResources

protected java.util.Locale getLocaleForMessageResources()
Returns the locale used for message resource lookup in following order: (1) 'local' param in request (2) messageResourceLocale if set (3) current user locale

Returns:
Locale for User

getContentProcessor

public MessageContentProcessor getContentProcessor()
Returns the MessageContentProcessor object used to process the message text and set the content of the email message.


setContentProcessor

public void setContentProcessor(MessageContentProcessor pContentProcessor)
Sets the MessageContentProcessor object used to process the message text and set the content of the email message.


setTransitoryInfo

public void setTransitoryInfo(atg.userprofiling.email.TemplateEmailTransitoryInfo pTransitoryInfo)
Set the transitory info.


getTransitoryInfo

public atg.userprofiling.email.TemplateEmailTransitoryInfo getTransitoryInfo()
Get the transitory info.


supportsMultipleContents

public boolean supportsMultipleContents()
Description copied from class: TemplateEmailInfo
Whether or not we support creating a message with multiple contents passed in.

Overrides:
supportsMultipleContents in class TemplateEmailInfo

createMessage

public javax.mail.Message createMessage(java.lang.String pRecipient,
                                        java.lang.String pContent,
                                        java.lang.String pContentType)
                                 throws atg.userprofiling.email.InvalidSenderAddressException,
                                        InvalidRecipientAddressException,
                                        TemplateEmailException
Creates and returns a Message object with the given email recipient and content.

Specified by:
createMessage in class TemplateEmailInfo
Parameters:
pRecipient - the email address of the main recipient, corresponding to a particular profile
pContent - the message text obtained by instantiating the template for a particular profile
pContentType - the content type obtaine by instantiating the template for a particular profile (example : text/plain).
Throws:
InvalidRecipientAddressException - if the recipient email address is null, malformed, or invalid
TemplateEmailException - if any other problem is encountered while composing the Message
atg.userprofiling.email.InvalidSenderAddressException

createMessage

public javax.mail.Message createMessage(java.lang.String pRecipient,
                                        java.lang.String[] pContents,
                                        java.lang.String[] pContentTypes)
                                 throws atg.userprofiling.email.InvalidSenderAddressException,
                                        InvalidRecipientAddressException,
                                        TemplateEmailException
Creates and returns a Message object with the given email recipient and content.

Overrides:
createMessage in class TemplateEmailInfo
Parameters:
pRecipient - the email address of the main recipient, corresponding to a particular profile
pContent - the message text obtained by instantiating the template for a particular profile
pContentType - the content type obtaine by instantiating the template for a particular profile (example : text/plain).
Throws:
InvalidRecipientAddressException - if the recipient email address is null, malformed, or invalid
TemplateEmailException - if any other problem is encountered while composing the Message
atg.userprofiling.email.InvalidSenderAddressException

copyPropertiesTo

public void copyPropertiesTo(TemplateEmailInfo pCopy)
Copy known properties to pCopy.

Overrides:
copyPropertiesTo in class TemplateEmailInfo
Parameters:
pCopy - the info to which to copy properties.

copy

public TemplateEmailInfo copy()
Returns a copy of this TemplateEmailInfo.

Specified by:
copy in class TemplateEmailInfo

appendProperties

protected void appendProperties(java.lang.StringBuffer pBuffer)
Append any properties for debugging.

Overrides:
appendProperties in class TemplateEmailInfo