| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.userprofiling.email.TemplateEmailSender
public class TemplateEmailSender
The TemplateEmailSender service is responsible for sending 
 template-based email.  Given a TemplateEmailInfo and a list of
 recipient profiles, it renders the jhtml page specified via the 
 TemplateEmailInfo's templateURL property for each 
 of the profiles, uses that to create a Message, and sends each 
 message to the corresponding user.
 
 
The template rendering functionality in TemplateEmailSender 
 is implemented with the help of its 
 templateRendererServlet.  In the service's 
 standard configuration, this property points to the head of 
 Dynamo's servlet pipeline.  Thus, the template page is rendered 
 simply as if it were a jhtml page requested through a browser.
 However, one can configure the 
 templateRendererServlet property to point to any 
 custom Servlet, which might implement a different scheme for 
 rendering the page.  
 
It's also possible to change the rendering behavior more 
 dramatically by subclassing this service and overriding some of
 its methods.  Here is a detailed description of the rendering
 process corresponding to a single call to TemplateEmailSender's
 sendEmailMessage, together with pointers for how
 the default behavior might be overriden:
 
templateURL, we create a request/response pair 
 (specifically, instances of DynamoHttpServletRequest and 
 DynamoHttpServletResponse) which will be reused to render the
 template for each of the recipient profiles.  The path info in
 the request is set to point to the templateURL.
 In addition, the request is serviced once using the 
 requestSetupServlet (which, in the standard 
 configuration, again points to the head of the servlet 
 pipeline) - this associates the request with a session, sets 
 it up for name resolution, and so on.
 initializeRequest and 
 initializeResponse to initialize request/response
 with any recipient-specific information.  The default 
 implementation associates the session-scoped Profile object in
 the request with the given profile object; this allows us to 
 resolve any references to the profile attributes in the 
 template page when the template is being rendered.  Subclasses
 may override these methods to implement other schemes for 
 associating the recipient's profile with the request, etc.
 renderTemplate, which takes the already 
 initialized request/response pair and actually performs the 
 rendering.  The default implementation simply calls the 
 templateRendererServlet's service 
 method, and captures and returns the output in the response.
 If you are implementing your own Servlet to do the rendering,
 note that your servlet can access the template URL by calling 
 getPathInfo on the request.  Again, you can also 
 override this method and implement a different scheme for 
 rendering the template.
 The actual sending of the email is performed by an
 EmailMessageSender, pointed at by the service's 
 emailMessageSender property.
TemplateEmailInfo, 
EmailMessageSender| Nested Class Summary | |
|---|---|
|  class | TemplateEmailSender.TemplateEmailSenderResReqInitterAn implementation of a RequestResponseInitializer that calls through to initializeRequest and initializeResponse. | 
| Field Summary | |
|---|---|
| static java.lang.String | ATG_MAILING_ID_HEADER_NAMEThe name of the mailingId header. | 
| static java.lang.String | ATG_MAILING_ID_HEADER_NAME_TO_LOWERThe name of the mailingId header. | 
| static java.lang.String | CLASS_VERSIONClass version string | 
| static java.lang.String[] | INCOMPLETE_STATUSES | 
| static ParameterName | PARAM_MESSAGE_FILL_FROM_TEMPLATE | 
| Fields inherited from class atg.nucleus.GenericService | 
|---|
| SERVICE_INFO_KEY | 
| Fields inherited from interface atg.servlet.TemplateEmailConstants | 
|---|
| ATTR_EMAIL_SESSION, ATTR_INPUT_PARAMS, ATTR_PREFIX, ATTR_SESSION_COOKIES, PARAM_FILL_FROM_TEMPLATE, PARAM_MAILING_NAME, PARAM_MESSAGE_ATTACHMENTS, PARAM_MESSAGE_BCC, PARAM_MESSAGE_CC, PARAM_MESSAGE_FROM, PARAM_MESSAGE_REPLY_TO, PARAM_MESSAGE_SUBJECT, PARAM_MESSAGE_TO, TEMPLATE_PARAMS | 
| 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 | |
|---|---|
| TemplateEmailSender() | |
| Method Summary | |
|---|---|
|  void | addTemplateEmailListener(TemplateEmailListener pListener)Adds a listener to the list of TemplateEmailListeners. | 
| protected  javax.servlet.Servlet | createAdminServlet()Creates and returns a new Servlet that will administer this service. | 
|  javax.mail.Message | createMessage(TemplateEmailInfo pEmailInfo,
              java.lang.Object pRecipient)Given a TemplateEmailInfo and a specific recipient profile, renders the page specified by the TemplateEmailInfo's templateURLfor that profile, and creates a 
 Message with the resulting content. | 
|  void | doStartService()Called after the service has been created, placed into the naming hierarchy, and initialized with its configured property values. | 
|  void | doStopService()This is called when a Service is required to shut down. | 
|  boolean | getAlwaysPruneAfterRendering()Get prune after rendering, which does any alternative pruning after render, rather than using mime-type from the previous rendering. | 
|  java.lang.String | getApplicationPrefix()Returns the Dynamo application prefix. | 
|  long | getAppServerConnectRetryTime()Gets the AppServerConnectRetryTime property | 
|  atg.userprofiling.email.BatchEmailPeriodicService | getBatchEmailPeriodicService()Get the batch email periodic service. | 
|  java.lang.String | getContextPathPrefix()Returns the string that this TemplateEmailSender should prepend to all template URLs. | 
|  int | getCreateMessagesBatchSize() | 
|  java.lang.Float | getDaysContactFatigue()Gets the time for which a mailing has to be contact fatigued. | 
|  java.lang.String | getDynamoInitSessionURL()Get the URL for a page from which to obtain the initial session on DAS. | 
|  java.lang.String | getEmailAddressPropertyName()Returns the property name of the email address in the profile. | 
|  java.util.Properties | getEmailEncodingMap()Gets the mEmailEncodingMap property | 
|  EmailMessageSender | getEmailMessageSender()Returns the EmailMessageSender that will send out email messages. | 
|  java.lang.String | getEmailStatusInvalidOptionValue()Returns the option value for invalid email status in the profile. | 
|  java.lang.String | getEmailStatusPropertyName()Returns the property name of the email status in the profile. | 
|  java.lang.String | getEmailStatusValidOptionValue()Returns the option value for valid email status in the profile. | 
|  atg.servlet.pagecompile.PageEncodingTyper | getEncodingTyper()The EncodingTyper used by the pagecompiler rendering the email msg. | 
|  java.lang.Float | getHoursContactFatigue()Gets the time for which a mailing has to be contact fatigued. | 
|  java.lang.String | getInitSessionURL()Returns the URL to use when creating a session via a loopback request, when running in another app server. | 
|  java.lang.String | getLastEmailedPropertyName()Returns the property name of the email last sent timestamp in the profile. | 
|  java.lang.String | getLocalePropertyName()Returns the property name of the locale in the profile. | 
|  boolean | getLoopbackRequestsEnabled()Returns the flag indicating whether loopback requests should be performed when running in another app server. | 
|  atg.userprofiling.email.TemplateEmailBatchInfo | getNextBatchMailing(boolean pClaim)Return the next batch mailing to process. | 
|  int | getNumAppServerConnectAttempts()Gets the NumAppServerConnectAttempts property | 
|  java.lang.String | getProfilePath()Returns the Nucleus path of the session-scoped Profile object. | 
|  java.lang.String | getReceiveEmailPropertyName()Returns the property name of the receiveEmail property in the profile. | 
|  java.lang.String | getRequestLocalePath()Returns the Nucleus path of the session-scoped RequestLocale object. | 
|  HeadPipelineServlet | getRequestSetupServlet()Returns the HeadPipelineServlet that will be used to service each newly created request and thus setup the request for name resolution, associate it with a session, etc. | 
|  boolean | getRestartRequestThread()Gets the mRestartRequestThread property | 
|  atg.servlet.sessiontracking.DynamoSessionManager | getSessionManager()Returns the session manager. | 
|  SiteContextManager | getSiteContextManager() | 
|  java.lang.String | getSiteHttpServerName()Returns the name of the server configured to serve HTTP requests. | 
|  int | getSiteHttpServerPort()Returns the port of the server configured to serve HTTP requests. | 
|  atg.userprofiling.email.TemplateEmailBatchPersister | getTemplateEmailBatchPersister()Get the TemplateEmailBatchPersister that will persist batch related data. | 
|  atg.userprofiling.email.TemplateEmailBatchServerPersister | getTemplateEmailBatchServerPersister()Set the template email batch server perisister... | 
|  int | getTemplateEmailListenerCount()Returns the number of TemplateEmailListeners. | 
|  TemplateEmailListener[] | getTemplateEmailListeners()Returns the array of TemplateEmailListener objects. | 
|  atg.userprofiling.email.TemplateEmailPersister | getTemplateEmailPersister()Returns the TemplateEmailPersister that will send out email messages. | 
|  TemplateInvoker | getTemplateInvoker() | 
|  javax.servlet.Servlet | getTemplateRendererServlet()Returns the Servlet responsible for rendering the template. | 
|  java.lang.String | getTemplateURL(java.lang.String pTemplateURL)Returns the given template URL prepended if contextPathPrefix, if any. | 
|  java.lang.String | getTemplateURL(TemplateEmailInfo pTemplateEmailInfo)Returns the template URL of the given TemplateEmailInfo, prepended if contextPathPrefix, if any. | 
|  javax.transaction.TransactionManager | getTransactionManager()Returns the TransactionManager. | 
|  int | getUpdateBatchCountsEveryNMessages()When doing batch processing, how often to update the counts in the database. | 
|  int | getUpdateProfileStatusesEveryNMessages()How often to update the profile email statuses... | 
| protected  void | initializeRequest(DynamoHttpServletRequest pRequest,
                  java.lang.Object pRecipient)Initializes the request to contain any recipient-specific information. | 
| protected  void | initializeResponse(DynamoHttpServletResponse pResponse,
                   java.lang.Object pRecipient)Initializes the response to contain any recipient-specific information. | 
|  boolean | isAddingDebuggingHeaders()Whether we are adding debugging headers identifying host and thread. | 
|  boolean | isAddingMailingIdHeader()Whether to add the mailing id header. | 
|  boolean | isBatchIfPossible()Get whether to batch email messages if possible (that is if there are no transient profiles). | 
|  boolean | isBypassRecipientVerification()Whether to bypass recipient verification before attempting to send an email. | 
|  boolean | isEnabledAsTemplateMailServer() | 
|  boolean | isSetValidEmailStatus()Whether to set valid email status when an email is sent successfully. | 
| protected  boolean | recipientIsContactFatigued(TemplateEmailInfo pEmailInfo,
                           java.lang.Object pRecipient)Return whether the recipient is considered contact fatigued. | 
|  void | removeTemplateEmailListener(TemplateEmailListener pListener)Removes a listener from the list of TemplateEmailListeners. | 
|  void | sendBatch(atg.userprofiling.email.TemplateEmailBatchInfo pBatchInfo)restartMailing | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.util.Collection pRecipients)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the Collection. | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.util.Collection pRecipients,
                 boolean pRunInSeparateThread,
                 boolean pPersist)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the Collection. | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.util.Enumeration pRecipients)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the array. | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.util.Enumeration pRecipients,
                 boolean pRunInSeparateThread,
                 boolean pPersist)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the array. | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.lang.Object[] pRecipients)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the array. | 
|  void | sendEmailMessage(TemplateEmailInfo pEmailInfo,
                 java.lang.Object[] pRecipients,
                 boolean pRunInSeparateThread,
                 boolean pPersist)Sends an email message described by the TemplateEmailInfo to each of the recipient profile objects in the array. | 
| protected  void | sendEmailNotSentEvent(TemplateEmailInfo pEmailInfo,
                      java.lang.Object pRecipient,
                      javax.mail.Message pMessage,
                      java.lang.String pErrorMessage)Sends a TemplateEmailEvent signifying that a message could not be sent to all the TemplateEmailListener objects. | 
| protected  void | sendEmailSentEvent(TemplateEmailInfo pEmailInfo,
                   java.lang.Object pRecipient,
                   javax.mail.Message pMessage)Sends a TemplateEmailEvent signifying that a message was sent successfully to all the TemplateEmailListener objects. | 
|  void | serviceNextBatchMailing()Service the next bath mailing, if any. | 
|  void | setAddingDebuggingHeaders(boolean pAddingDebuggingHeaders)Whether to add debugging headers identifying host and thread. | 
|  void | setAddingMailingIdHeader(boolean pAddingMailingIdHeader)Whether to add the mailing id header. | 
|  void | setAlwaysPruneAfterRendering(boolean pAlwaysPruneAfterRendering)Set prune after rendering, which does any alternative pruning after render, rather than using mime-type from the previous rendering. | 
|  void | setApplicationPrefix(java.lang.String pApplicationPrefix)Sets the Dynamo application prefix. | 
|  void | setAppServerConnectRetryTime(long pAppServerConnectRetryTime)Sets the AppServerConnectRetryTime property | 
|  void | setBatchEmailPeriodicService(atg.userprofiling.email.BatchEmailPeriodicService pBatchEmailPeriodicService)Set the batch email periodic service. | 
|  void | setBatchIfPossible(boolean pBatchIfPossible)Set whether to batch email messages if possible (that is if there are no transient profiles). | 
|  void | setBypassRecipientVerification(boolean pBypassRecipientVerification)Whether to bypass recipient verification before attempting to send an email | 
|  void | setContextPathPrefix(java.lang.String pContextPathPrefix)Sets the string that this TemplateEmailSender should prepend to all template URLs. | 
|  void | setCreateMessagesBatchSize(int pCreateMessagesBatchSize)Sets the maximum number of messages created in one batch | 
|  void | setDaysContactFatigue(java.lang.Float pDaysContactFatigue)Sets the time in days , for which a mailing has to be contact fatigued. | 
|  void | setDynamoInitSessionURL(java.lang.String pDynamoInitSessionURL)Set the URL for a page from which to obtain the initial session on DAS. | 
|  void | setEmailAddressPropertyName(java.lang.String pPropertyName)Sets the property name of the email address in the profile. | 
|  void | setEmailEncodingMap(java.util.Properties pProperties)Sets the mEmailEncodingMap property | 
|  void | setEmailMessageSender(EmailMessageSender pSender)Sets the EmailMessageSender that will send out email messages. | 
|  void | setEmailStatusInvalidOptionValue(java.lang.String pEmailStatusInvalidOptionValue)Sets the options value for invalid email status for a profile. | 
|  void | setEmailStatusPropertyName(java.lang.String pPropertyName)Sets the property name of the email status in the profile. | 
|  void | setEmailStatusValidOptionValue(java.lang.String pEmailStatusValidOptionValue)Sets the options value for valid email status for a profile. | 
|  void | setEnabledAsTemplateMailServer(boolean pEnabledAsTemplateMailServer) | 
|  void | setEncodingTyper(atg.servlet.pagecompile.PageEncodingTyper pValue)The EncodingTyper used by the pagecompiler rendering the email msg. | 
|  void | setHoursContactFatigue(java.lang.Float pHoursContactFatigue)Sets the time for which a mailing has to be contact fatigued. | 
|  void | setInitSessionURL(java.lang.String pInitSessionURL)Sets the URL to use when creating a session via a loopback request, when running in another app server. | 
|  void | setLastEmailedPropertyName(java.lang.String pLastEmailedPropertyName)Sets the property name of the email last sent timestamp in the profile. | 
|  void | setLocalePropertyName(java.lang.String pPropertyName)Sets the property name of the locale in the profile. | 
|  void | setLoopbackRequestsEnabled(boolean pLoopbackRequestsEnabled)Sets the flag indicating whether loopback requests should be performed when running in another app server. | 
|  void | setNumAppServerConnectAttempts(int pNumAppServerConnectAttempts)Sets the NumAppServerConnectAttempts property | 
|  void | setProfilePath(java.lang.String pProfilePath)Sets the Nucleus path of the session-scoped Profile object. | 
|  void | setReceiveEmailPropertyName(java.lang.String pPropertyName)Sets the property name of the receiveEmail property in the profile. | 
|  void | setRequestLocalePath(java.lang.String pRequestLocalePath)Sets the Nucleus path of the session-scoped RequestLocale object. | 
|  void | setRequestSetupServlet(HeadPipelineServlet pServlet)Sets the HeadPipelineServlet that will be used to service each newly created request and thus setup the request for name resolution, associate it with a session, etc. | 
|  void | setRestartRequestThread(boolean pRestartRequestThread)Sets the mRestartRequestThread property | 
|  void | setSessionManager(atg.servlet.sessiontracking.DynamoSessionManager pSessionManager)Sets the session manager. | 
|  void | setSetValidEmailStatus(boolean pSetValidEmailStatus)Whether to set valid email status when an email is sent successfully. | 
|  void | setSiteContextManager(SiteContextManager pSiteContextManager) | 
|  void | setSiteHttpServerName(java.lang.String pSiteHttpServerName)Sets the name of the server configured to serve HTTP requests. | 
|  void | setSiteHttpServerPort(int port)Sets the port of the server configured to serve HTTP requests. | 
|  void | setTemplateEmailBatchPersister(atg.userprofiling.email.TemplateEmailBatchPersister pTemplateEmailBatchPersister)Set the TemplateEmailBatchPersister that will persist batch related data. | 
|  void | setTemplateEmailBatchServerPersister(atg.userprofiling.email.TemplateEmailBatchServerPersister pTemplateEmailBatchServerPersister)Set the template email batch server perisister... | 
|  void | setTemplateEmailPersister(atg.userprofiling.email.TemplateEmailPersister pTemplateEmailPersister)Sets the TemplateEmailPersister that will send out email messages. | 
|  void | setTemplateInvoker(TemplateInvoker pTemplateInvoker) | 
|  void | setTemplateRendererServlet(javax.servlet.Servlet pServlet)Sets the Servlet responsible for rendering the template. | 
|  void | setTransactionManager(javax.transaction.TransactionManager pTransactionManager)Sets the TransactionManager. | 
|  void | setUpdateBatchCountsEveryNMessages(int pUpdateBatchCountsEveryNMessages)When doing batch processing, how often to update the counts in the database. | 
|  void | setUpdateProfileStatusesEveryNMessages(int pUpdateProfileStatusesEveryNMessages)How often to update the profile email statuses... | 
| 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 | 
|---|
public static java.lang.String CLASS_VERSION
public static final ParameterName PARAM_MESSAGE_FILL_FROM_TEMPLATE
public static final java.lang.String[] INCOMPLETE_STATUSES
public static java.lang.String ATG_MAILING_ID_HEADER_NAME
public static java.lang.String ATG_MAILING_ID_HEADER_NAME_TO_LOWER
| Constructor Detail | 
|---|
public TemplateEmailSender()
| Method Detail | 
|---|
public void setAppServerConnectRetryTime(long pAppServerConnectRetryTime)
pAppServerConnectRetryTime - the length of time to 
 wait in between connections to the underlying app server if
 we are unable to connect. In non-DAS environments, we need
 to call the init-session servlet to get a session to use
 when sending email. If we try to send email before the
 app server has started up, this service will keep trying to
 connect to the app server to see if it has started yet.public long getAppServerConnectRetryTime()
public void setNumAppServerConnectAttempts(int pNumAppServerConnectAttempts)
pNumAppServerConnectAttempts - the number of attempts
 made to connect to the underlying app server if we are unable
 to hit the init-session servlet on the first try.
 In non-DAS environments, we need
 to call the init-session servlet to get a session to use
 when sending email. If we try to send email before the
 app server has started up, this service will keep trying to
 connect to the app server to see if it has started yet.public int getNumAppServerConnectAttempts()
public java.lang.String getSiteHttpServerName()
public void setSiteHttpServerName(java.lang.String pSiteHttpServerName)
public int getSiteHttpServerPort()
public void setSiteHttpServerPort(int port)
public SiteContextManager getSiteContextManager()
public void setSiteContextManager(SiteContextManager pSiteContextManager)
mSiteContextManager - the mSiteContextManager to setpublic java.lang.String getApplicationPrefix()
public void setApplicationPrefix(java.lang.String pApplicationPrefix)
public java.lang.String getInitSessionURL()
public void setInitSessionURL(java.lang.String pInitSessionURL)
public void setDynamoInitSessionURL(java.lang.String pDynamoInitSessionURL)
public java.lang.String getDynamoInitSessionURL()
public atg.servlet.sessiontracking.DynamoSessionManager getSessionManager()
public void setSessionManager(atg.servlet.sessiontracking.DynamoSessionManager pSessionManager)
public boolean getLoopbackRequestsEnabled()
public void setLoopbackRequestsEnabled(boolean pLoopbackRequestsEnabled)
This value is true by default. It can be set to false if you are only using this TemplateEmailSender with DSP templates, rather than JSP templates, since DSP templates can always be rendered without making loopback requests.
Note: if you set this property to false, you should also set the contextPathPrefix property to null, so that the template URLs are not prefixed with "/dyn/dyn," but left to be relative to the Dynamo docroot.
public java.lang.String getContextPathPrefix()
public void setContextPathPrefix(java.lang.String pContextPathPrefix)
public java.lang.String getTemplateURL(TemplateEmailInfo pTemplateEmailInfo)
public java.lang.String getTemplateURL(java.lang.String pTemplateURL)
public void setRestartRequestThread(boolean pRestartRequestThread)
public boolean getRestartRequestThread()
public void setEmailEncodingMap(java.util.Properties pProperties)
public java.util.Properties getEmailEncodingMap()
public void setBatchIfPossible(boolean pBatchIfPossible)
public boolean isBatchIfPossible()
public void setEnabledAsTemplateMailServer(boolean pEnabledAsTemplateMailServer)
public boolean isEnabledAsTemplateMailServer()
public void setBatchEmailPeriodicService(atg.userprofiling.email.BatchEmailPeriodicService pBatchEmailPeriodicService)
public atg.userprofiling.email.BatchEmailPeriodicService getBatchEmailPeriodicService()
public void setTemplateInvoker(TemplateInvoker pTemplateInvoker)
public TemplateInvoker getTemplateInvoker()
public void setAlwaysPruneAfterRendering(boolean pAlwaysPruneAfterRendering)
public boolean getAlwaysPruneAfterRendering()
public void setAddingDebuggingHeaders(boolean pAddingDebuggingHeaders)
public boolean isAddingDebuggingHeaders()
public void setAddingMailingIdHeader(boolean pAddingMailingIdHeader)
public boolean isAddingMailingIdHeader()
public void setUpdateBatchCountsEveryNMessages(int pUpdateBatchCountsEveryNMessages)
public int getUpdateBatchCountsEveryNMessages()
public void setUpdateProfileStatusesEveryNMessages(int pUpdateProfileStatusesEveryNMessages)
public int getUpdateProfileStatusesEveryNMessages()
public atg.userprofiling.email.TemplateEmailPersister getTemplateEmailPersister()
public void setTemplateEmailPersister(atg.userprofiling.email.TemplateEmailPersister pTemplateEmailPersister)
public void setTemplateEmailBatchPersister(atg.userprofiling.email.TemplateEmailBatchPersister pTemplateEmailBatchPersister)
public atg.userprofiling.email.TemplateEmailBatchPersister getTemplateEmailBatchPersister()
public void setTemplateEmailBatchServerPersister(atg.userprofiling.email.TemplateEmailBatchServerPersister pTemplateEmailBatchServerPersister)
public atg.userprofiling.email.TemplateEmailBatchServerPersister getTemplateEmailBatchServerPersister()
public void setSetValidEmailStatus(boolean pSetValidEmailStatus)
public boolean isSetValidEmailStatus()
public void setBypassRecipientVerification(boolean pBypassRecipientVerification)
public boolean isBypassRecipientVerification()
public void setHoursContactFatigue(java.lang.Float pHoursContactFatigue)
pHoursContactFatigue - The time in hours for which a mailing has to 
 be contact fatigued.public java.lang.Float getHoursContactFatigue()
public void setDaysContactFatigue(java.lang.Float pDaysContactFatigue)
pDaysContactFatigue - The time in days for which a mailing has to be contact 
 fatiguedpublic java.lang.Float getDaysContactFatigue()
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public EmailMessageSender getEmailMessageSender()
public void setEmailMessageSender(EmailMessageSender pSender)
public HeadPipelineServlet getRequestSetupServlet()
public void setRequestSetupServlet(HeadPipelineServlet pServlet)
public java.lang.String getProfilePath()
public void setProfilePath(java.lang.String pProfilePath)
public java.lang.String getRequestLocalePath()
public void setRequestLocalePath(java.lang.String pRequestLocalePath)
public java.lang.String getLastEmailedPropertyName()
public void setLastEmailedPropertyName(java.lang.String pLastEmailedPropertyName)
public java.lang.String getEmailStatusPropertyName()
public void setEmailStatusPropertyName(java.lang.String pPropertyName)
public java.lang.String getEmailStatusValidOptionValue()
public void setEmailStatusValidOptionValue(java.lang.String pEmailStatusValidOptionValue)
public java.lang.String getEmailStatusInvalidOptionValue()
public void setEmailStatusInvalidOptionValue(java.lang.String pEmailStatusInvalidOptionValue)
public java.lang.String getReceiveEmailPropertyName()
public void setReceiveEmailPropertyName(java.lang.String pPropertyName)
public java.lang.String getEmailAddressPropertyName()
public void setEmailAddressPropertyName(java.lang.String pPropertyName)
public java.lang.String getLocalePropertyName()
public void setLocalePropertyName(java.lang.String pPropertyName)
public int getCreateMessagesBatchSize()
public void setCreateMessagesBatchSize(int pCreateMessagesBatchSize)
public javax.servlet.Servlet getTemplateRendererServlet()
This servlet's service method will be invoked
 by the renderTemplate method.  If you are 
 implementing your own servlet to do the rendering, note that 
 your servlet can access the template URL by calling 
 getPathInfo on the request.
public void setTemplateRendererServlet(javax.servlet.Servlet pServlet)
This servlet's service method will be invoked
 by the renderTemplate method.  If you are 
 implementing your own servlet to do the rendering, note that 
 your servlet can access the template URL by calling 
 getPathInfo on the request.
public void setEncodingTyper(atg.servlet.pagecompile.PageEncodingTyper pValue)
public atg.servlet.pagecompile.PageEncodingTyper getEncodingTyper()
public void addTemplateEmailListener(TemplateEmailListener pListener)
public void removeTemplateEmailListener(TemplateEmailListener pListener)
public TemplateEmailListener[] getTemplateEmailListeners()
public int getTemplateEmailListenerCount()
protected void sendEmailSentEvent(TemplateEmailInfo pEmailInfo,
                                  java.lang.Object pRecipient,
                                  javax.mail.Message pMessage)
protected void sendEmailNotSentEvent(TemplateEmailInfo pEmailInfo,
                                     java.lang.Object pRecipient,
                                     javax.mail.Message pMessage,
                                     java.lang.String pErrorMessage)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.util.Collection pRecipients)
                      throws TemplateEmailException
 sendEmailMessage(TemplateEmailInfo, Collection,
 false, false).
TemplateEmailExceptionsendEmailMessage(TemplateEmailInfo, Collection, boolean, boolean)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.util.Collection pRecipients,
                             boolean pRunInSeparateThread,
                             boolean pPersist)
                      throws TemplateEmailException
For each profile, this method renders the page specified by
 the TemplateEmailInfo's templateURL, and obtains a
 Message with the resulting content.  For each recipient, if a
 message is sent successfully, a TargetedEmailEvent of type
 TYPE_EMAIL_SENT is fired; otherwise, a TargetedEmailEvent of type
 TYPE_EMAIL_NOT_SENT is fired.
 
 
The recipient profiles in the Collection can be beans of 
 any type, so long as they have an email address property 
 (whose name is given by the service's
 emailAddressPropertyName property).  However, if 
 a profile is of type RepositoryItem, we also associate the 
 RepositoryItem with the session-scoped Profile object in the
 request before rendering the template page, thus allowing the
 page to contain references to the recipient's profile.
 
 
The rule of thumb for how error handling is performed in 
 this method is as follows.  TemplateEmailException is thrown 
 in those cases when a problem is encountered which is likely 
 to apply when sending email to each of the intended 
 message recipients.  However, if the problem is likely to be 
 specific to a particular message recipient, no exception is 
 thrown; instead, a TemplateEmailEvent of type 
 TYPE_EMAIL_NOT_SENT is fired to notify the listeners that 
 the email was not sent to that particular recipient.  For 
 example, if templateURL could not be rendered 
 for one of the profiles, we assume that the problem is with 
 the page rather than the profile, and throw an exception.  
 If, on the other hand, a particular email address turns out 
 to be invalid, a TYPE_EMAIL_NOT_SENT event is fired instead.
 
 
If pPersist if true, the mailing will be persisted in the database before the email is actually sent. Thus, if the server goes down unexpectedly, the mailing will resume when the server is restarted.
TemplateEmailException - if any problem was 
 encountered while assembling or sending the message (but see 
 above for an explanation of when an exception is not thrown)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.lang.Object[] pRecipients)
                      throws TemplateEmailException
 sendEmailMessage(TemplateEmailInfo, Object[],
 false, false).
TemplateEmailExceptionsendEmailMessage(TemplateEmailInfo, Object[], boolean, boolean)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.lang.Object[] pRecipients,
                             boolean pRunInSeparateThread,
                             boolean pPersist)
                      throws TemplateEmailException
Identical to sendEmailMessage(TemplateEmailInfo,
 Collection, boolean, boolean), except that the recipients
 are specified via an array rather than a Collection.
TemplateEmailExceptionsendEmailMessage(TemplateEmailInfo, Collection, boolean, boolean)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.util.Enumeration pRecipients)
                      throws TemplateEmailException
 sendEmailMessage(TemplateEmailInfo, Enumeration,
 false, false).
TemplateEmailExceptionsendEmailMessage(TemplateEmailInfo, Enumeration, boolean, boolean)
public void sendEmailMessage(TemplateEmailInfo pEmailInfo,
                             java.util.Enumeration pRecipients,
                             boolean pRunInSeparateThread,
                             boolean pPersist)
                      throws TemplateEmailException
Identical to sendEmailMessage(TemplateEmailInfo,
 Collection, boolean, boolean), except that the recipients
 are specified via an Enumeration rather than a Collection.
TemplateEmailExceptionsendEmailMessage(TemplateEmailInfo, Collection, boolean, boolean)
public javax.mail.Message createMessage(TemplateEmailInfo pEmailInfo,
                                        java.lang.Object pRecipient)
                                 throws TemplateEmailException
templateURL for that profile, and creates a 
 Message with the resulting content.
 
 The recipient can be a bean of any type, so long as it has
 an email address property (whose name is given by the 
 service's emailAddressPropertyName property).  
 However, if it is of type RepositoryItem, we also associate 
 the RepositoryItem with the session-scoped Profile object in 
 the request before rendering the template page, thus allowing 
 the page to contain references to the recipient's profile.
TemplateEmailException - if a problem is encountered
 while creating the Message
protected boolean recipientIsContactFatigued(TemplateEmailInfo pEmailInfo,
                                             java.lang.Object pRecipient)
                                      throws TemplateEmailException
TemplateEmailException
protected void initializeRequest(DynamoHttpServletRequest pRequest,
                                 java.lang.Object pRecipient)
                          throws TemplateEmailException
This default implementation checks to see if the recipient object is a RepositoryItem; if so, it associates the Profile object in the request with the given RepositoryItem. This allows us to resolve any references to the profile attributes in the template page when we're rendering the template.
Subclasses may override this method to implement other schemes for associating the recipient's profile with the request, etc.
Note that the same request will in general be initialized multiple times for different recipient objects.
TemplateEmailException - if an error occurred while
 initializing the request
protected void initializeResponse(DynamoHttpServletResponse pResponse,
                                  java.lang.Object pRecipient)
                           throws TemplateEmailException
This default implementation does nothing. Subclasses may override this method to perform any desired initialization.
Note that the same response will in general be initialized multiple times for different recipient objects.
TemplateEmailException - if an error occurred while
 initializing the response
public void doStartService()
                    throws ServiceException
doStartService in class GenericServiceServiceException - if the service had a problem 
 starting up
public void doStopService()
                   throws ServiceException
GenericService
doStopService in class GenericServiceServiceException - if the Service had a problem shutting downprotected javax.servlet.Servlet createAdminServlet()
createAdminServlet in class GenericService
public atg.userprofiling.email.TemplateEmailBatchInfo getNextBatchMailing(boolean pClaim)
                                                                   throws TemplateEmailException
pClaim - whether to claim the mailing for this server.
TemplateEmailException
public void sendBatch(atg.userprofiling.email.TemplateEmailBatchInfo pBatchInfo)
               throws TemplateEmailException
restartMailing
pEmailInfo - a TemplateEmailInfo value
TemplateEmailException - if an error occurs
public void serviceNextBatchMailing()
                             throws TemplateEmailException
TemplateEmailException| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||