com.endeca.infront.assembler.servlet
Class AbstractAssemblerServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.endeca.infront.assembler.servlet.AbstractAssemblerServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
SpringAssemblerServlet

public abstract class AbstractAssemblerServlet
extends javax.servlet.http.HttpServlet

Servlet used to invoke the Assembler and process its results.

See Also:
Serialized Form

Constructor Summary
AbstractAssemblerServlet()
           
 
Method Summary
protected  ContentItem createAssemblerInput(javax.servlet.http.HttpServletRequest req)
          Creates and returns the appropriate input for the the Assembler using the given request object.
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Creates an Assembler, passes it input based on the request, and processes the results.
protected abstract  boolean enableKeywordRedirects()
          A method to obtain whether or not keyword redirects should be supported.
protected abstract  AssemblerFactory getAssemblerFactory()
          A method to retrieve an AssemblerFactory.
protected abstract  ResponseWriter getResponseWriter()
          A method to retrieve a ResponseWriter.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAssemblerServlet

public AbstractAssemblerServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws IOException,
                     javax.servlet.ServletException
Creates an Assembler, passes it input based on the request, and processes the results.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Parameters:
req - The request the client has made of the servlet
resp - The response the servlet sends to the client
Throws:
IOException - If an input or output error is detected when the servlet handles the GET request
javax.servlet.ServletException - If the GET request could not be handled

createAssemblerInput

protected ContentItem createAssemblerInput(javax.servlet.http.HttpServletRequest req)
Creates and returns the appropriate input for the the Assembler using the given request object. This implementation does so by using the request path to construct a ContentInclude object, if keyword redirects are not enabled, or a RedirectAwareContentInclude, if keyword redirects are enabled.

Parameters:
req - The servlet request
Returns:
The input to use when invoking the Assembler
See Also:
enableKeywordRedirects()

getAssemblerFactory

protected abstract AssemblerFactory getAssemblerFactory()
                                                 throws javax.servlet.ServletException
A method to retrieve an AssemblerFactory. Subclasses must override this method to provide a specific means of acquiring the factory.

Returns:
The factory
Throws:
javax.servlet.ServletException - If something went wrong retrieving the factory

getResponseWriter

protected abstract ResponseWriter getResponseWriter()
                                             throws javax.servlet.ServletException
A method to retrieve a ResponseWriter. Subclasses must override this method to provide a specific means of acquiring the writer.

Returns:
The response writer
Throws:
javax.servlet.ServletException - If something went wrong retrieving the writer

enableKeywordRedirects

protected abstract boolean enableKeywordRedirects()
A method to obtain whether or not keyword redirects should be supported.

Note that if this method returns true, keyword redirect information will be returned whenever a search term matches a defined redirect. Therefore, services that use search terms but do not want keyword redirects (like the dimension search service) must disable redirects via their content.xml file (by supplying an empty redirectCollection).

Returns:
true if keyword redirects should be enabled.


Copyright © 2012, Oracle and/or its affiliates. All rights reserved.