|
|||||||||
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.TimedOperationService atg.servlet.pipeline.PipelineableServletImpl atg.servlet.pipeline.InsertableServletImpl atg.endeca.assembler.AssemblerPipelineServlet
public class AssemblerPipelineServlet
A pipline servlet that invokes the Assembler to return content from Experience Manager or Guided Search. This servlet is added to the pipline by default after the CookieBufferServlet.
For the servlet to invoke the Assembler its enabled property must be set to true, the web application must specify an atg.assembler context-param that is set to true, the request mime type must not be included in a list of ignored mime types and the URL must not match an ignore regular expression.
The AssemblerPipelineServlet can return two types of content from the Assembler, a ContentInclude and a ContentSlotConfig. A ContentInclude represents a 'page' in the Endeca world. A ContentSlotConfig returns an Endeca content collection. A ContentSlotConfig is returned by making a request to /assembler and having an assemblerContentCollection parameter which specifies the name of the content collection to return. The assemblerRuleLimit parameter may also be used in conjunction with the assemblerContentCollection parameter to indicate how many rules can fire within the particular content collection. A ContentInclude is returned by making a request to the path of a 'page' in Experience Manager or a service in Guided Search. For example, if a "browse" page exists in Experience Manager we may make a request to (webapproot)/browse.
The returned content may be in the form of a ContentItem, JSON or XML. A format parameter can be specified in the request. Valid values for this parameter are json or xml. If specified, the ContentItem will be serialized accordingly. If no format is specified an attempt is made to determine a suitable page (for example JSP) that can render the ContentItem. The ContentItem is set as a contentItem parameter on the request and the request is forwarded to the page.
Field Summary | |
---|---|
static java.lang.String |
ASSEMBLER
|
static java.lang.String |
ASSEMBLER_INTERCEPTED_LINK
This will be used as a request attribute that when set to true will tell us to pass the request to the next pipeline servlet rather than forward it. |
static java.lang.String |
ATG_ASSEMBLER
|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
CONTENT_COLLECTION
|
static java.lang.String |
CONTENT_ITEM
|
static java.lang.String |
ENDECA_REDIRECT
Endeca redirect key in response content item |
static java.lang.String |
ROOT_CONTENT_ITEM
|
static java.lang.String |
RULE_LIMIT
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
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 | |
---|---|
AssemblerPipelineServlet()
|
Method Summary | |
---|---|
protected ContentItem |
createContentInclude(DynamoHttpServletRequest pRequest,
java.lang.String pResourcePath)
Create a new ContentInclude content item. |
protected ContentSlotConfig |
createContentSlotConfig(DynamoHttpServletRequest pRequest,
java.lang.String pContent,
int pRuleLimit)
Create a new ContentSlotConfig content item |
protected void |
forwardRequest(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
ContentItem pContentItem)
Forwards the request to the jsp specified by the contentRenderer servlet context parameter set in the Web.xml. |
java.lang.String[] |
getAllowedMimeTypes()
Sets property allowedMimeTypes. |
AssemblerTools |
getAssemblerTools()
|
java.lang.String |
getDefaultContentRenderer()
|
java.lang.String |
getFormatParamName()
Name of the request parameter that controls the format of the returned content. |
java.util.regex.Pattern |
getIgnoreRequestURIPattern()
Returns property ignoreRequestURIPattern. |
protected java.lang.String |
getMimeTypeForRequest(DynamoHttpServletRequest pRequest)
Extract the mime type for the request. |
MimeTyper |
getMimeTyper()
Returns property mimeTyper. |
atg.service.configuration.ResponseWrappingConfiguration |
getResponseWrappingConfiguration()
Returns property responseWrappingConfiguration. |
boolean |
isAssembleUnknownMimeTypes()
Returns property assembleUnknownMimeTypes. |
protected boolean |
isContentCollectionRequest(DynamoHttpServletRequest pRequest)
Build what the request would look like to the special "/assembler" path which indicates we want a ContentSlotConfig. |
boolean |
isEnable()
Returns property enable. |
protected boolean |
isMimeTypeAllowed(java.lang.String pMimeType)
Return whether the specified mime type is allowed. |
protected void |
redirectRequest(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse,
ContentItem pContentItem,
java.lang.String pRedirectURL)
Redirect to the URL specified |
protected java.lang.String |
requestURIWithoutParams(DynamoHttpServletRequest pRequest)
Get the request uri without params |
void |
service(DynamoHttpServletRequest pRequest,
DynamoHttpServletResponse pResponse)
Services a DynamoHttpServletRequest/Response pair |
void |
setAllowedMimeTypes(java.lang.String[] pAllowedMimeTypes)
Sets property allowedMimeTypes. |
void |
setAssemblerTools(AssemblerTools pAssemblerTools)
|
void |
setAssembleUnknownMimeTypes(boolean pAssembleUnknownMimeTypes)
Sets property assembleUnknownMimeTypes. |
void |
setDefaultContentRenderer(java.lang.String pDefaultContentRenderer)
Set the location of a JSP that knows how to handle the rendering of returned content items. |
void |
setEnable(boolean pEnable)
Sets property enable. |
void |
setFormatParamName(java.lang.String pFormatParamName)
|
void |
setIgnoreRequestURIPattern(java.util.regex.Pattern pIgnoreRequestURIPattern)
Sets property ignoreRequestURIPattern. |
void |
setMimeTyper(MimeTyper pMimeTyper)
Sets property mimeTyper. |
void |
setResponseWrappingConfiguration(atg.service.configuration.ResponseWrappingConfiguration pResponseWrappingConfiguration)
Sets property responseWrappingConfiguration. |
protected boolean |
shouldIgnoreRequest(DynamoHttpServletRequest pRequest)
Whether we should ignore this request (as far as invoking the Assembler). |
Methods inherited from class atg.servlet.pipeline.InsertableServletImpl |
---|
doStartService, getInsertAfterServlet, setInsertAfterServlet |
Methods inherited from class atg.servlet.pipeline.PipelineableServletImpl |
---|
createAdminServlet, destroy, getAdminServlet, getNextServlet, getServletConfig, getServletInfo, init, isUsePathInfo, passRequest, passRequest, service, service, setNextServlet, setServletInfo, setUsePathInfo |
Methods inherited from class atg.nucleus.TimedOperationService |
---|
getAverageRequestHandlingTime, getHandledRequestCount, getRequestStartTime, getTotalRequestHandlingTime, isKeepingStatistics, notifyHandledRequest, resetStatistics, setKeepingStatistics |
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 |
Methods inherited from interface atg.servlet.pipeline.PipelineableServlet |
---|
getNextServlet, passRequest, setNextServlet |
Methods inherited from interface javax.servlet.Servlet |
---|
destroy, getServletConfig, getServletInfo, init, service |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public static final java.lang.String ASSEMBLER
public static final java.lang.String CONTENT_COLLECTION
public static final java.lang.String RULE_LIMIT
public static final java.lang.String ATG_ASSEMBLER
public static final java.lang.String CONTENT_ITEM
public static final java.lang.String ROOT_CONTENT_ITEM
public static final java.lang.String ASSEMBLER_INTERCEPTED_LINK
public static final java.lang.String ENDECA_REDIRECT
Constructor Detail |
---|
public AssemblerPipelineServlet()
Method Detail |
---|
public void setEnable(boolean pEnable)
public boolean isEnable()
public void setAssembleUnknownMimeTypes(boolean pAssembleUnknownMimeTypes)
public boolean isAssembleUnknownMimeTypes()
public java.lang.String getDefaultContentRenderer()
public void setDefaultContentRenderer(java.lang.String pDefaultContentRenderer)
pDefaultContentRenderer
- public AssemblerTools getAssemblerTools()
public void setAssemblerTools(AssemblerTools pAssemblerTools)
pAssemblerTools
- Set a new AssemblerToolspublic java.lang.String getFormatParamName()
public void setFormatParamName(java.lang.String pFormatParamName)
pFormatParamName
- Set a new formatParamNamepublic void setIgnoreRequestURIPattern(java.util.regex.Pattern pIgnoreRequestURIPattern)
public java.util.regex.Pattern getIgnoreRequestURIPattern()
public void setAllowedMimeTypes(java.lang.String[] pAllowedMimeTypes)
public java.lang.String[] getAllowedMimeTypes()
public void setMimeTyper(MimeTyper pMimeTyper)
public MimeTyper getMimeTyper()
public void setResponseWrappingConfiguration(atg.service.configuration.ResponseWrappingConfiguration pResponseWrappingConfiguration)
public atg.service.configuration.ResponseWrappingConfiguration getResponseWrappingConfiguration()
protected boolean isMimeTypeAllowed(java.lang.String pMimeType)
pMimeType
- the mime type off the request.
protected java.lang.String getMimeTypeForRequest(DynamoHttpServletRequest pRequest)
pRequest
- the current requestpResourcePath
- the resource path as returned by AssemblerToolsprotected boolean shouldIgnoreRequest(DynamoHttpServletRequest pRequest)
pRequest
- the current request.
public void service(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse) throws java.io.IOException, javax.servlet.ServletException
PipelineableServletImpl
service
in class PipelineableServletImpl
java.io.IOException
- if an error occurred while reading or writing
the servlet request
javax.servlet.ServletException
- if an error occurred while processing
the servlet requestprotected ContentItem createContentInclude(DynamoHttpServletRequest pRequest, java.lang.String pResourcePath)
ContentInclude
content item. Returns an
instance of RedirectAwareContentInclude
if keyword
redirects are enabled.
pRequest
- pResourcePath
-
protected ContentSlotConfig createContentSlotConfig(DynamoHttpServletRequest pRequest, java.lang.String pContent, int pRuleLimit)
ContentSlotConfig
content item
pRequest
- HttpRequestpResourcePath
- resource pathpRuleLimit
- rule limit
protected void redirectRequest(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, ContentItem pContentItem, java.lang.String pRedirectURL) throws java.io.IOException
pRequest
- HttpRequestpResponse
- HttpResponsepContentItem
- the content itempRedirectURL
- the redirect URL
java.io.IOException
protected void forwardRequest(DynamoHttpServletRequest pRequest, DynamoHttpServletResponse pResponse, ContentItem pContentItem) throws javax.servlet.ServletException, java.io.IOException
pRequest
- HttpRequestpResponse
- HttpResponsepContentItem
- The content item to make available on the pageASSEMBLER_INTERCEPTED_LINK
-
javax.servlet.ServletException
java.io.IOException
protected boolean isContentCollectionRequest(DynamoHttpServletRequest pRequest)
pRequest
-
protected java.lang.String requestURIWithoutParams(DynamoHttpServletRequest pRequest)
pRequest
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |