|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.nucleus.logging.LogRedirectingGenericService atg.userprofiling.email.TemplateInvoker
public class TemplateInvoker
A class for invoking rendering a specified JSP/JHTML template. Works via loop-backs on application servers other than DAS.
Users can call createSession(), and then on the sesion invoke renderTemplate() for each template to be rendered, followed by endSession();
Created: May 04 2004
RequestResponseInitializer
Nested Class Summary | |
---|---|
class |
TemplateInvoker.TemplateSession
Represents a template rendering session. |
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from class atg.nucleus.logging.LogRedirectingGenericService |
---|
mApplicationLogger |
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 | |
---|---|
TemplateInvoker()
No-arg constructor for Nucleus. |
|
TemplateInvoker(TemplateEmailSender pSender)
Constructor for initializing from TemplateEmailSender, which is used for backwards compatability. |
Method Summary | |
---|---|
protected atg.servlet.GenericHttpServletRequest |
createGenericHttpServletRequest(javax.servlet.http.HttpSession pSession,
java.lang.String pSessionId,
java.lang.String pTemplateURL)
Create a GenericHttpServletRequest. |
protected DynamoHttpServletRequest |
createRequest(DynamoHttpServletResponse pResponse,
java.lang.String pTemplateUrl,
java.util.Dictionary pParameters,
javax.servlet.http.HttpSession pSession,
java.lang.String pSessionId)
Creates and returns a "fake" request with the path info specified by the given TemplateEmailInfo's templateURL . |
protected DynamoHttpServletResponse |
createResponse()
Creates and returns a "fake" response. |
TemplateInvoker.TemplateSession |
createSession(java.util.Map pParameterMap,
atg.userprofiling.email.RequestResponseInitializer pReqResInitializer)
Create a session for TemplateEmailRendering. |
protected javax.servlet.http.HttpSession |
createTemplateEmailSession()
Creates an HTTP session by making a loopback request. |
java.lang.String |
getApplicationPrefix()
Returns the Dynamo application prefix. |
java.lang.String |
getDefaultContentType()
Get the default content type (probably "text/html"). |
java.lang.String |
getDynamoInitSessionURL()
URL for a page from which to obtain the initial session on DAS. |
java.lang.String |
getInitSessionURL()
Returns the URL to use when creating a session via a loopback request, when running in another app server. |
boolean |
getLoopbackRequestsEnabled()
Returns the flag indicating whether loopback requests should be performed when running in another app server. |
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. |
atg.servlet.sessiontracking.DynamoSessionManager |
getSessionManager()
Returns the session manager. |
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. |
javax.servlet.Servlet |
getTemplateRendererServlet()
Returns the Servlet responsible for rendering the template. |
void |
setApplicationPrefix(java.lang.String pApplicationPrefix)
Sets the Dynamo application prefix. |
void |
setDefaultContentType(java.lang.String pDefaultContentType)
Set the default content type (probably "text/html"). |
void |
setDynamoInitSessionURL(java.lang.String pDynamoInitSessionURL)
URL for a page from which to obtain the initial session on DAS. |
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 |
setLoopbackRequestsEnabled(boolean pLoopbackRequestsEnabled)
Sets the flag indicating whether loopback requests should be performed when running in another app server. |
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 |
setSessionManager(atg.servlet.sessiontracking.DynamoSessionManager pSessionManager)
Sets the session manager. |
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 |
setTemplateRendererServlet(javax.servlet.Servlet pServlet)
Sets the Servlet responsible for rendering the template. |
protected boolean |
useLocalRequests()
Whether to use local requests. |
protected void |
verifyResponseStatus(java.lang.String pPathInfo,
int pStatus,
java.lang.String pErrorMessage)
Verifies that the response came back with no errors. |
Methods inherited from class atg.nucleus.logging.LogRedirectingGenericService |
---|
format, format, format, format, isLoggingDebug, isLoggingError, isLoggingInfo, isLoggingWarning, logDebug, logDebug, logDebug, logError, logError, logError, logInfo, logInfo, logInfo, logWarning, logWarning, logWarning, setApplicationLogger, setLoggingDebug, setLoggingError, setLoggingInfo, setLoggingWarning |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public TemplateInvoker()
public TemplateInvoker(TemplateEmailSender pSender)
pSender
- The TemplateEmailSender whose properties we
will use for configuration.Method Detail |
---|
public 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 getSiteHttpServerName()
public void setSiteHttpServerName(java.lang.String pSiteHttpServerName)
public int getSiteHttpServerPort()
public void setSiteHttpServerPort(int port)
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 HeadPipelineServlet getRequestSetupServlet()
public void setRequestSetupServlet(HeadPipelineServlet pServlet)
public void setDefaultContentType(java.lang.String pDefaultContentType)
public java.lang.String getDefaultContentType()
protected DynamoHttpServletRequest createRequest(DynamoHttpServletResponse pResponse, java.lang.String pTemplateUrl, java.util.Dictionary pParameters, javax.servlet.http.HttpSession pSession, java.lang.String pSessionId) throws TemplateEmailException
templateURL
. The request is sent down the
servlet pipeline once, so that it has a session associated
with it, it can be used to resolve names, etc.
pTemplateUrl
- the URL for the template (typically
the dynamoInitSessionURL).pParameters
- the dictionary of parameterspSession
- the sessionpSessionId
- the session id
TemplateEmailException
- if a problem was
encountered while obtaining or servicing the requestprotected DynamoHttpServletResponse createResponse()
protected javax.servlet.http.HttpSession createTemplateEmailSession() throws TemplateEmailException
TemplateEmailException
protected atg.servlet.GenericHttpServletRequest createGenericHttpServletRequest(javax.servlet.http.HttpSession pSession, java.lang.String pSessionId, java.lang.String pTemplateURL)
pSession
- the session to usepSessionId
- the parent session IdpTemplateUrl
- the URL of the template to be rendered.public TemplateInvoker.TemplateSession createSession(java.util.Map pParameterMap, atg.userprofiling.email.RequestResponseInitializer pReqResInitializer) throws TemplateEmailException
pParameterMap
- Parameters that should be set on each request.pReqResInitializer
- An object that implements
pReqResInitializer to do additional request/response
initialization.
TemplateEmailException
protected void verifyResponseStatus(java.lang.String pPathInfo, int pStatus, java.lang.String pErrorMessage) throws TemplateEmailException
pPathInfo
- The path info for the request, just used for
error reportingpStatus
- the HTTP status code integer from the HTTP responsepErrorMessage
- The error message from the HTTP response
TemplateEmailException
protected boolean useLocalRequests()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |