public class UpdateUserServlet extends AbstractAuthorizablePostServlet implements UpdateUser
Sling Post Operation implementation for updating a user in the jackrabbit UserManager.
Updates a users properties. Maps on to nodes of resourceType sling/users
like
/rep:system/rep:userManager/rep:users
mapped to a resource url
/system/userManager/user/ieb
. This servlet responds at
/system/userManager/user/ieb.update.html
curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/user/ieb.update.html
PROP_DATE_FORMAT
Constructor and Description |
---|
UpdateUserServlet() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(Map<String,Object> props) |
protected void |
bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Overridden since the @Reference annotation is not inherited from the super method
|
protected void |
deactivate() |
protected void |
handleOperation(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.servlets.post.PostResponse response,
List<org.apache.sling.servlets.post.Modification> changes)
Extending Servlet should implement this operation to do the work
|
protected void |
unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator,
Map<String,Object> properties)
Unbind a post response creator
|
org.apache.jackrabbit.api.security.user.User |
updateUser(javax.jcr.Session jcrSession,
String name,
Map<String,?> properties,
List<org.apache.sling.servlets.post.Modification> changes)
Update a user in the repository
|
collectContent, convertToRequestParameterArray, convertToString, convertToStringArray, hasItemPathPrefix, processDeletes, requireItemPathPrefix, writeContent
createHtmlResponse, doPost, externalizePath, getItemPath, getRedirectUrl, getRedirectUrl, handleOperation, isSetStatus
doDelete, doPut, getAllowedRequestMethods, isMethodValid, mayService
doGeneric, doGet, doHead, doOptions, doTrace, getServletInfo, handleMethodNotImplemented, service, service
protected void activate(Map<String,Object> props)
activate
in class AbstractAuthorizablePostServlet
protected void deactivate()
deactivate
in class AbstractAuthorizablePostServlet
protected void bindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
protected void unbindPostResponseCreator(org.apache.sling.servlets.post.PostResponseCreator creator, Map<String,Object> properties)
AbstractPostServlet
unbindPostResponseCreator
in class AbstractPostServlet
protected void handleOperation(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.servlets.post.PostResponse response, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
AbstractPostServlet
handleOperation
in class AbstractPostServlet
request
- the sling http request to processresponse
- the responsechanges
- the changes to reportjavax.jcr.RepositoryException
- in case of exceptions during the operationpublic org.apache.jackrabbit.api.security.user.User updateUser(javax.jcr.Session jcrSession, String name, Map<String,?> properties, List<org.apache.sling.servlets.post.Modification> changes) throws javax.jcr.RepositoryException
UpdateUser
updateUser
in interface UpdateUser
jcrSession
- the JCR session of the user updating the username
- The name of the user to update (required)properties
- Extra properties to update on the user. The entry values should be either a String or String[] (optional)changes
- The list of changes for this operation (optional)javax.jcr.RepositoryException
- if user can't be updatedCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.