public class TemplateInvoker.TemplateSession
extends java.lang.Object
Constructor and Description |
---|
TemplateSession(java.util.Map pParameterMap,
atg.userprofiling.email.RequestResponseInitializer pReqResInitializer)
Create a TemplateSession...
|
Modifier and Type | Method and Description |
---|---|
protected void |
beforeRender(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
This method provides a final opportunity to modify the request and response before
rendering.
|
protected void |
createCurrentRequestAndResponse(java.lang.String pTemplateURL)
Create and initialize the current request and response.
|
protected DynamoHttpServletRequest |
createRequestAndSetCurrent(DynamoHttpServletResponse pResponse,
java.lang.String pTemplateURL)
Create a request DynamoHttpServletRequest and set as the value of our currentRequest
property.
|
void |
endSession()
End the session...
|
DynamoHttpServletRequest |
getCurrentRequest()
Get the request associated with the session.
|
DynamoHttpServletResponse |
getCurrentResponse()
Get the response associated with the session.
|
java.lang.String |
getSessionId()
Get the session id for the current session.
|
java.lang.String |
getSiteId() |
java.lang.String |
renderTemplate(java.lang.String pTemplateURL,
java.lang.Object pReqResInitArgument)
Render the specified template.
|
void |
setParameter(java.lang.String pName,
java.lang.Object pValue)
Set/update a parameter.
|
void |
setSiteId(java.lang.String pSiteId) |
public TemplateSession(java.util.Map pParameterMap, atg.userprofiling.email.RequestResponseInitializer pReqResInitializer) throws TemplateEmailException
pParameterMap
- the map of Parameters to go into the session.pReqResInitializer
- The request/response initializer.TemplateEmailException
public java.lang.String getSessionId()
public DynamoHttpServletRequest getCurrentRequest()
public DynamoHttpServletResponse getCurrentResponse()
public java.lang.String getSiteId()
public void setSiteId(java.lang.String pSiteId)
protected DynamoHttpServletRequest createRequestAndSetCurrent(DynamoHttpServletResponse pResponse, java.lang.String pTemplateURL) throws TemplateEmailException
pResponse
- the response to use. Created by createResponse()pTemplateURL
- the URL of the template to render.TemplateEmailException
public void endSession()
protected void createCurrentRequestAndResponse(java.lang.String pTemplateURL) throws TemplateEmailException
pTemplateURL
- the URL of the template to render.TemplateEmailException
public java.lang.String renderTemplate(java.lang.String pTemplateURL, java.lang.Object pReqResInitArgument) throws TemplateEmailException
This default implementation simply calls the
templateRendererServlet
's service
method, and captures and returns the response's output. The
renderer servlet can access the template URL by calling
getPathInfo
on the request.
Subclasses may override this method to implement other schemes for rendering the template.
pTemplateURL
- the template URLpReqResInitializer
- The argument passed to the request/response initializer.TemplateEmailException
- if an error occurred while
rendering the templateprotected void beforeRender(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse)
pRequest
- public void setParameter(java.lang.String pName, java.lang.Object pValue)
pName
- the name of the parameterpValue
- the new value for the parameter.