com.day.cq.wcm.notification.inbox.impl
Class InboxServlet

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
                  extended by com.day.cq.commons.servlets.AbstractCommandServlet
                      extended by com.day.cq.wcm.notification.impl.AbstractServlet
                          extended by com.day.cq.wcm.notification.inbox.impl.InboxServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class InboxServlet
extends AbstractServlet

TableCommand This command returns the table for the inbox. TODO - Evaluate filter request properties!

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.day.cq.wcm.notification.impl.AbstractServlet
AbstractServlet.RequestInfo
 
Field Summary
protected  InboxManager inboxManager
          The inbox manager
protected  UserManagerFactory userManagerFactory
          The security service.
 
Fields inherited from class com.day.cq.wcm.notification.impl.AbstractServlet
JSON_CONTENT_TYPE, JSON_EXTENSION, log
 
Fields inherited from class com.day.cq.commons.servlets.AbstractCommandServlet
ACTION_PARAM, PATH_PARAM
 
Fields inherited from class com.day.cq.commons.servlets.AbstractPredicateServlet
FILTER_PARAM, PREDICATE_PARAM
 
Constructor Summary
InboxServlet()
           
 
Method Summary
protected  void approveInboxEntry(AbstractServlet.RequestInfo info, String key)
          Approve a message
protected  void deleteInboxEntry(AbstractServlet.RequestInfo info, String key)
          Delete a message
protected  void doGet(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.apache.commons.collections.Predicate predicate)
          Return a list of all messages.
protected  MessageIterator getInboxEntries(AbstractServlet.RequestInfo info, String key)
          Return all inbox entries for the user.
protected  boolean hasCommand(org.apache.sling.api.SlingHttpServletRequest request)
          Checks if the command in the request is supported.
protected  void performCommand(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response)
          Perform the command of the current request.
 
Methods inherited from class com.day.cq.commons.servlets.AbstractCommandServlet
doPost, requireParameter
 
Methods inherited from class com.day.cq.commons.servlets.AbstractPredicateServlet
doGet, getPredicate, selectorPredicateStart
 
Methods inherited from class org.apache.sling.api.servlets.SlingAllMethodsServlet
doDelete, 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

userManagerFactory

protected UserManagerFactory userManagerFactory
The security service.


inboxManager

protected InboxManager inboxManager
The inbox manager

Constructor Detail

InboxServlet

public InboxServlet()
Method Detail

getInboxEntries

protected MessageIterator getInboxEntries(AbstractServlet.RequestInfo info,
                                          String key)
Return all inbox entries for the user.

Parameters:
key -
Returns:

approveInboxEntry

protected void approveInboxEntry(AbstractServlet.RequestInfo info,
                                 String key)
                          throws IOException
Approve a message

Throws:
IOException

deleteInboxEntry

protected void deleteInboxEntry(AbstractServlet.RequestInfo info,
                                String key)
Delete a message


hasCommand

protected boolean hasCommand(org.apache.sling.api.SlingHttpServletRequest request)
                      throws javax.servlet.ServletException
Description copied from class: AbstractCommandServlet
Checks if the command in the request is supported. Returns false by default.

Overrides:
hasCommand in class AbstractCommandServlet
Parameters:
request - servlet request
Returns:
true if the command is supported.
Throws:
javax.servlet.ServletException - if a servlet error occurs
See Also:
AbstractCommandServlet.hasCommand(org.apache.sling.api.SlingHttpServletRequest)

performCommand

protected void performCommand(org.apache.sling.api.SlingHttpServletRequest request,
                              org.apache.sling.api.SlingHttpServletResponse response)
                       throws javax.servlet.ServletException,
                              IOException
Description copied from class: AbstractCommandServlet
Perform the command of the current request. This method is invoked if AbstractCommandServlet.hasCommand(SlingHttpServletRequest) returns true for a POST request.

Specified by:
performCommand in class AbstractCommandServlet
Parameters:
request - servlet request
response - servlet response
Throws:
javax.servlet.ServletException - if an error occurs.
IOException - if an I/O error occurs.
See Also:
AbstractCommandServlet.performCommand(org.apache.sling.api.SlingHttpServletRequest, org.apache.sling.api.SlingHttpServletResponse)

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
Return a list of all messages.

Overrides:
doGet in class AbstractPredicateServlet
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
See Also:
AbstractPredicateServlet.doGet(org.apache.sling.api.SlingHttpServletRequest, org.apache.sling.api.SlingHttpServletResponse, org.apache.commons.collections.Predicate)


Copyright © 2008 Day Management AG. All Rights Reserved.