com.toalango.qzarch.servlet
Class AbstractQZarchServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--com.toalango.qzarch.servlet.AbstractQZarchServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
QZarchJSPServlet, QZarchPlainHTMLServlet

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

This is an abstract servlet that can be subclassed by presentation specific servlet implementations.

Author:
Rune Toalango Johannesen
See Also:
Serialized Form

Field Summary
protected  boolean mDebug
          Print debug statements to the console during execution?
static java.lang.String PARAMETER_CASE_SENSITIVE
           
static java.lang.String PARAMETER_FILE_TYPE
           
static java.lang.String PARAMETER_FILE_TYPES
           
static java.lang.String PARAMETER_KEYWORDS
           
static java.lang.String PARAMETER_SUPPORT_EXPRESSIONS
           
static java.lang.String PARAMETER_TARGET
           
 
Constructor Summary
AbstractQZarchServlet()
           
 
Method Summary
protected  void debug(java.lang.String pMessage)
          Help method to print debug statements during development mode.
 void doGet(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
          Process the request
 void doPost(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse)
          Process the request
abstract  void handleResults(javax.servlet.http.HttpServletRequest pRequest, javax.servlet.http.HttpServletResponse pResponse, com.toalango.qzarch.Resource[] pResources, java.lang.String pTarget)
          Hand over the processing or the request to the implementing servlet in order to present the search result suing the desirable presentation technology.
 void init(javax.servlet.ServletConfig pServletConfig)
          Initialise the servlet using the ServletConfig object.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAMETER_KEYWORDS

public static final java.lang.String PARAMETER_KEYWORDS
See Also:
Constant Field Values

PARAMETER_TARGET

public static final java.lang.String PARAMETER_TARGET
See Also:
Constant Field Values

PARAMETER_CASE_SENSITIVE

public static final java.lang.String PARAMETER_CASE_SENSITIVE
See Also:
Constant Field Values

PARAMETER_SUPPORT_EXPRESSIONS

public static final java.lang.String PARAMETER_SUPPORT_EXPRESSIONS
See Also:
Constant Field Values

PARAMETER_FILE_TYPE

public static final java.lang.String PARAMETER_FILE_TYPE
See Also:
Constant Field Values

PARAMETER_FILE_TYPES

public static final java.lang.String PARAMETER_FILE_TYPES
See Also:
Constant Field Values

mDebug

protected boolean mDebug
Print debug statements to the console during execution?

Constructor Detail

AbstractQZarchServlet

public AbstractQZarchServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig pServletConfig)
          throws javax.servlet.ServletException
Initialise the servlet using the ServletConfig object.

Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Parameters:
pServletConfig - The ServletConfig object provided by the container
Throws:
javax.servlet.ServletException - if the initialisation failed

doPost

public void doPost(javax.servlet.http.HttpServletRequest pRequest,
                   javax.servlet.http.HttpServletResponse pResponse)
            throws javax.servlet.ServletException,
                   java.io.IOException
Process the request

Overrides:
doPost in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

doGet

public void doGet(javax.servlet.http.HttpServletRequest pRequest,
                  javax.servlet.http.HttpServletResponse pResponse)
           throws javax.servlet.ServletException,
                  java.io.IOException
Process the request

Overrides:
doGet in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

handleResults

public abstract void handleResults(javax.servlet.http.HttpServletRequest pRequest,
                                   javax.servlet.http.HttpServletResponse pResponse,
                                   com.toalango.qzarch.Resource[] pResources,
                                   java.lang.String pTarget)
                            throws java.io.IOException,
                                   javax.servlet.ServletException
Hand over the processing or the request to the implementing servlet in order to present the search result suing the desirable presentation technology.

Parameters:
pRequest - The request being processed
pResponse - The response object
pResources - The results from the search
pTarget - The target (page, template, resource etc.)
Throws:
java.io.IOException - if an i/o problem occoured
javax.servlet.ServletException - if the servlet failed in producing a response

debug

protected void debug(java.lang.String pMessage)
Help method to print debug statements during development mode.

Parameters:
pMessage - The message to print to the console