Class AbstractPostServlet
java.lang.Object
jakarta.servlet.GenericServlet
org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet
org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet
org.apache.sling.jackrabbit.usermanager.impl.post.AbstractPostServlet
- All Implemented Interfaces:
jakarta.servlet.Servlet,jakarta.servlet.ServletConfig,Serializable
- Direct Known Subclasses:
AbstractAuthorizablePostServlet,DeleteAuthorizableServlet
public abstract class AbstractPostServlet
extends org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet
Base class for all the POST servlets for the UserManager operations
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String, Object> properties) Bind a new post response creatorprotected voiddoPost(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.api.SlingJakartaHttpServletResponse httpResponse) protected final StringexternalizePath(org.apache.sling.api.SlingJakartaHttpServletRequest request, String path) Returns an external form of the given path prepending the context path and appending a display extension.protected StringgetItemPath(org.apache.sling.api.SlingJakartaHttpServletRequest request) Returns the path of the resource of the request as the item path.protected intgetRanking(Map<String, Object> properties) protected StringgetRedirectUrl(jakarta.servlet.http.HttpServletRequest request, org.apache.sling.servlets.post.JakartaPostResponse ctx) compute redirect URL (SLING-126)protected abstract voidhandleOperation(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.servlets.post.JakartaPostResponse response, List<org.apache.sling.servlets.post.Modification> changes) Extending Servlet should implement this operation to do the workprotected booleanisSetStatus(org.apache.sling.api.SlingJakartaHttpServletRequest request) protected voidunbindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String, Object> properties) Unbind a post response creatorMethods inherited from class org.apache.sling.api.servlets.SlingJakartaAllMethodsServlet
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayServiceMethods inherited from class org.apache.sling.api.servlets.SlingJakartaSafeMethodsServlet
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, init, log, log
-
Constructor Details
-
AbstractPostServlet
public AbstractPostServlet()
-
-
Method Details
-
doPost
protected void doPost(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.api.SlingJakartaHttpServletResponse httpResponse) throws jakarta.servlet.ServletException, IOException - Overrides:
doPostin classorg.apache.sling.api.servlets.SlingJakartaAllMethodsServlet- Throws:
jakarta.servlet.ServletExceptionIOException
-
handleOperation
protected abstract void handleOperation(org.apache.sling.api.SlingJakartaHttpServletRequest request, org.apache.sling.servlets.post.JakartaPostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException Extending Servlet should implement this operation to do the work- Parameters:
request- the sling http request to processresponse- the responsechanges- the changes to report- Throws:
javax.jcr.RepositoryException- in case of exceptions during the operation
-
getRedirectUrl
protected String getRedirectUrl(jakarta.servlet.http.HttpServletRequest request, org.apache.sling.servlets.post.JakartaPostResponse ctx) throws IOException compute redirect URL (SLING-126)- Parameters:
request- the requestctx- the post processor- Returns:
- the redirect location or
null - Throws:
IOException- if there is something invalid with the :redirect value
-
isSetStatus
protected boolean isSetStatus(org.apache.sling.api.SlingJakartaHttpServletRequest request) -
getItemPath
Returns the path of the resource of the request as the item path.This method may be overwritten by extension if the operation has different requirements on path processing.
- Parameters:
request- the current request- Returns:
- the path of the resource
-
externalizePath
protected final String externalizePath(org.apache.sling.api.SlingJakartaHttpServletRequest request, String path) Returns an external form of the given path prepending the context path and appending a display extension.- Parameters:
request- the requestpath- the path to externalize- Returns:
- the url
-
bindPostResponseCreator
protected void bindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String, Object> properties) Bind a new post response creator -
unbindPostResponseCreator
protected void unbindPostResponseCreator(org.apache.sling.servlets.post.JakartaPostResponseCreator creator, Map<String, Object> properties) Unbind a post response creator -
getRanking
-