ccc.web
Class AbstractCCCServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by ccc.web.AbstractCCCServlet
All Implemented Interfaces:
ServiceLocator, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
ContentServlet, LoginServlet, LogoutServlet

public abstract class AbstractCCCServlet
extends javax.servlet.http.HttpServlet
implements ServiceLocator

Abstract servlet action providing helper methods.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Constructor Summary
AbstractCCCServlet()
          Constructor.
 
Method Summary
protected  void dispatchError(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception e)
          Dispatch to the error handler.
protected  void dispatchNotFound(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Dispatch to the 'not found' URI.
protected  void dispatchRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String relUri)
          Send a redirect to the client.
 Actions getActions()
          Accessor.
 Aliases getAliases()
          Accessor.
 Comments getComments()
          Accessor.
protected  java.lang.Exception getException(javax.servlet.http.HttpServletRequest request)
          Retrieves the exception that this servlet should report.
 Files getFiles()
          Accessor.
 Folders getFolders()
          Accessor.
 Groups getGroups()
          Accessor.
protected  Mailer getMailer()
          Accessor.
 Pages getPages()
          Accessor.
 Resources getResources()
          Accessor.
 SearchEngine getSearch()
          Accessor.
 Security getSecurity()
          Accessor.
 Templates getTemplates()
          Accessor.
 Users getUsers()
          Accessor.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, 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

AbstractCCCServlet

public AbstractCCCServlet()
Constructor.

Method Detail

dispatchNotFound

protected void dispatchNotFound(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Dispatch to the 'not found' URI.

Parameters:
request - The request.
response - The response.
Throws:
javax.servlet.ServletException - From servlet API.
java.io.IOException - From servlet API.

dispatchError

protected void dispatchError(javax.servlet.http.HttpServletRequest request,
                             javax.servlet.http.HttpServletResponse response,
                             java.lang.Exception e)
                      throws javax.servlet.ServletException,
                             java.io.IOException
Dispatch to the error handler.

Parameters:
request - The request.
response - The response.
e - The exception we encountered
Throws:
javax.servlet.ServletException - From servlet API.
java.io.IOException - From servlet API.

dispatchRedirect

protected void dispatchRedirect(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.String relUri)
                         throws java.io.IOException
Send a redirect to the client.

Parameters:
request - The incoming request.
response - The outgoing response.
relUri - The relative URI to redirect to.
Throws:
java.io.IOException - Servlet API can throw an IOException.

getException

protected java.lang.Exception getException(javax.servlet.http.HttpServletRequest request)
Retrieves the exception that this servlet should report. Guarantees to return an exception and never NULL.

Parameters:
request - The request that the exception will be retrieved from.
Returns:
The exception that should be reported.

getMailer

protected Mailer getMailer()
Accessor.

Returns:
The mail implementation for this servlet.

getActions

public Actions getActions()
Accessor.

Specified by:
getActions in interface ServiceLocator
Returns:
Returns the actions service.

getAliases

public Aliases getAliases()
Accessor.

Specified by:
getAliases in interface ServiceLocator
Returns:
Returns the alias service.

getComments

public Comments getComments()
Accessor.

Specified by:
getComments in interface ServiceLocator
Returns:
Returns the comments service.

getFiles

public Files getFiles()
Accessor.

Specified by:
getFiles in interface ServiceLocator
Returns:
Returns the files service.

getFolders

public Folders getFolders()
Accessor.

Specified by:
getFolders in interface ServiceLocator
Returns:
Returns the folders service.

getGroups

public Groups getGroups()
Accessor.

Specified by:
getGroups in interface ServiceLocator
Returns:
Returns the groups service.

getPages

public Pages getPages()
Accessor.

Specified by:
getPages in interface ServiceLocator
Returns:
Returns the pages service.

getResources

public Resources getResources()
Accessor.

Specified by:
getResources in interface ServiceLocator
Returns:
Returns the resources service.

getSearch

public SearchEngine getSearch()
Accessor.

Specified by:
getSearch in interface ServiceLocator
Returns:
Returns the search index service.

getSecurity

public Security getSecurity()
Accessor.

Specified by:
getSecurity in interface ServiceLocator
Returns:
Returns the security service.

getTemplates

public Templates getTemplates()
Accessor.

Specified by:
getTemplates in interface ServiceLocator
Returns:
Returns the templates service.

getUsers

public Users getUsers()
Accessor.

Specified by:
getUsers in interface ServiceLocator
Returns:
Returns the users service.


Copyright © 2010. All Rights Reserved.