public abstract class AbstractAccessPostServlet extends SlingAllMethodsServlet
Constructor and Description |
---|
AbstractAccessPostServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindPostResponseCreator(PostResponseCreator creator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Bind a new post response creator
|
protected AbstractPostResponse |
createHtmlResponse(SlingHttpServletRequest req)
Deprecated.
use
createPostResponse(SlingHttpServletRequest) instead |
protected void |
doPost(SlingHttpServletRequest request,
SlingHttpServletResponse httpResponse)
Called by the
SlingAllMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse) method to
handle an HTTP POST request. |
protected java.lang.String |
externalizePath(SlingHttpServletRequest request,
java.lang.String path)
Returns an external form of the given path prepending the context path
and appending a display extension.
|
protected javax.jcr.security.AccessControlList |
getAccessControlList(javax.jcr.security.AccessControlManager accessControlManager,
java.lang.String resourcePath,
boolean mayCreate)
Returns an
AccessControlList to edit for the node at the
given resourcePath . |
protected java.lang.String |
getItemPath(SlingHttpServletRequest request)
Returns the path of the resource of the request as the item path.
|
protected java.lang.String |
getRedirectUrl(javax.servlet.http.HttpServletRequest request,
AbstractPostResponse ctx)
Deprecated.
use
getRedirectUrl(HttpServletRequest, PostResponse) instead |
protected java.lang.String |
getRedirectUrl(javax.servlet.http.HttpServletRequest request,
PostResponse ctx)
compute redirect URL (SLING-126)
|
protected void |
handleOperation(SlingHttpServletRequest request,
AbstractPostResponse response,
java.util.List<Modification> changes)
Deprecated.
|
protected abstract void |
handleOperation(SlingHttpServletRequest request,
PostResponse response,
java.util.List<Modification> changes)
Extending Servlet should implement this operation to do the work
|
protected boolean |
isSetStatus(SlingHttpServletRequest request) |
protected void |
unbindPostResponseCreator(PostResponseCreator creator,
java.util.Map<java.lang.String,java.lang.Object> properties)
Unbind a post response creator
|
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse httpResponse) throws javax.servlet.ServletException, java.io.IOException
SlingAllMethodsServlet
SlingAllMethodsServlet.mayService(SlingHttpServletRequest, SlingHttpServletResponse)
method to
handle an HTTP POST request.
This default implementation reports back to the client that the method is not supported.
Implementations of this class should overwrite this method with their implementation for the HTTP POST method support.
doPost
in class SlingAllMethodsServlet
request
- The HTTP requesthttpResponse
- The HTTP responsejavax.servlet.ServletException
- Not thrown by this implementation.java.io.IOException
- If the error status cannot be reported back to the
client.@Deprecated protected AbstractPostResponse createHtmlResponse(SlingHttpServletRequest req)
createPostResponse(SlingHttpServletRequest)
insteadreq
- The request being servicedorg.apache.sling.servlets.post.impl.helper.JSONResponse
if any of these conditions are true:
HtmlResponse
otherwise@Deprecated protected void handleOperation(SlingHttpServletRequest request, AbstractPostResponse response, java.util.List<Modification> changes) throws javax.jcr.RepositoryException
handleOperation(SlingHttpServletRequest, PostResponse, List)
insteadrequest
- the sling http request to processresponse
- the responsechanges
- javax.jcr.RepositoryException
protected abstract void handleOperation(SlingHttpServletRequest request, PostResponse response, java.util.List<Modification> changes) throws javax.jcr.RepositoryException
request
- the sling http request to processresponse
- the responsechanges
- javax.jcr.RepositoryException
@Deprecated protected java.lang.String getRedirectUrl(javax.servlet.http.HttpServletRequest request, AbstractPostResponse ctx)
getRedirectUrl(HttpServletRequest, PostResponse)
insteadctx
- the post processornull
protected java.lang.String getRedirectUrl(javax.servlet.http.HttpServletRequest request, PostResponse ctx)
ctx
- the post processornull
protected boolean isSetStatus(SlingHttpServletRequest request)
protected java.lang.String getItemPath(SlingHttpServletRequest request)
This method may be overwritten by extension if the operation has different requirements on path processing.
protected final java.lang.String externalizePath(SlingHttpServletRequest request, java.lang.String path)
path
- the path to externalizeprotected javax.jcr.security.AccessControlList getAccessControlList(javax.jcr.security.AccessControlManager accessControlManager, java.lang.String resourcePath, boolean mayCreate) throws javax.jcr.RepositoryException
AccessControlList
to edit for the node at the
given resourcePath
.accessControlManager
- The manager providing access control listsresourcePath
- The node path for which to return an access control
listmayCreate
- true
if an access control list should be
created if the node does not have one yet.AccessControlList
to modify to control access to
the node.javax.jcr.RepositoryException
- If the access control manager does not
provide a AccessControlPolicy
which is an
AccessControlList
.protected void bindPostResponseCreator(PostResponseCreator creator, java.util.Map<java.lang.String,java.lang.Object> properties)
protected void unbindPostResponseCreator(PostResponseCreator creator, java.util.Map<java.lang.String,java.lang.Object> properties)
Copyright © 2018 The Apache Software Foundation. All rights reserved.