com.day.cq.commons.servlets
Class AbstractPredicateServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by org.apache.sling.api.servlets.SlingSafeMethodsServlet
          extended by org.apache.sling.api.servlets.SlingAllMethodsServlet
              extended by com.day.cq.commons.servlets.AbstractPredicateServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
AbstractCommandServlet, AuditLogTableExportServlet, ComponentListServlet, ContentLanguageServlet, DefaultSuggestionHandler, DefaultViewHandler, ExtMediaListServlet, ExtTreeExportServlet, ExtTreeServlet, FormsListServlet, FullViewHandler, GQLSearchServlet, HeavyMoveDialogServlet, PageListServlet, PageSearchServlet, ReferenceListServlet, ReferenceSearchServlet, TagListServlet, TemplateListServlet, TidyJsonServlet, VersionListServlet, VersionTreeServlet

public abstract class AbstractPredicateServlet
extends org.apache.sling.api.servlets.SlingAllMethodsServlet

Abstract servlet that retrieves the predicates from the request.

See Also:
Serialized Form

Field Summary
static String FILTER_PARAM
          default name for the filter parameter
static String PATH_PARAM
          default path parameter name
static String PREDICATE_PARAM
          default name for the predicate parameter
 
Constructor Summary
AbstractPredicateServlet()
           
 
Method Summary
protected  void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
           Calls doGet(SlingHttpServletRequest, SlingHttpServletResponse, Predicate).
protected  void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.commons.collections.Predicate predicate)
          Handles the HTTP GET method
 org.apache.commons.collections.Predicate getPredicate(org.apache.sling.api.SlingHttpServletRequest request)
          Returns the predicate retrieved from the given request.
protected  int selectorPredicateStart()
          Returns the index of the first selector that should be considered when retrieving the predicates for this servlet.
 
Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet
doDelete, doPost, doPut, getAllowedRequestMethods, isMethodValid, mayService
 
Methods inherited from class org.apache.sling.api.servlets.SlingSafeMethodsServlet
doGeneric, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH_PARAM

public static final String PATH_PARAM
default path parameter name

See Also:
Constant Field Values

PREDICATE_PARAM

public static final String PREDICATE_PARAM
default name for the predicate parameter

See Also:
Constant Field Values

FILTER_PARAM

public static final String FILTER_PARAM
default name for the filter parameter

See Also:
Constant Field Values
Constructor Detail

AbstractPredicateServlet

public AbstractPredicateServlet()
Method Detail

doGet

protected void doGet(org.apache.sling.api.SlingHttpServletRequest request,
                     org.apache.sling.api.SlingHttpServletResponse response)
              throws javax.servlet.ServletException,
                     IOException
Calls doGet(SlingHttpServletRequest, SlingHttpServletResponse, Predicate).

Overrides:
doGet in class org.apache.sling.api.servlets.SlingSafeMethodsServlet
Throws:
javax.servlet.ServletException
IOException

doGet

protected void doGet(org.apache.sling.api.SlingHttpServletRequest request,
                     org.apache.sling.api.SlingHttpServletResponse response,
                     org.apache.commons.collections.Predicate predicate)
              throws javax.servlet.ServletException,
                     IOException
Handles the HTTP GET method

Parameters:
request - The HTTP request
response - The HTTP response
predicate - the predicate retrieved from the request
Throws:
javax.servlet.ServletException - if a servlet error occurs
IOException - if an I/O error occurs

selectorPredicateStart

protected int selectorPredicateStart()
Returns the index of the first selector that should be considered when retrieving the predicates for this servlet.

Returns:
Always Integer.MAX_VALUE

getPredicate

public org.apache.commons.collections.Predicate getPredicate(org.apache.sling.api.SlingHttpServletRequest request)
Returns the predicate retrieved from the given request. the predicates are retrieved from the request selectors and the request parameter values of the "predicate". those predicates form an AnyPredicate. If no predicates are specified in the request a TruePredicate is returned. Note: the "filter" parameters are used to add ResourceFilter predicates. although this is discouraged because java class names should never be passed over the wire.

Parameters:
request - servlet request
Returns:
predicate


Copyright © 2008 Day Management AG. All Rights Reserved.