org.apache.sling.jackrabbit.usermanager.impl.post
Class CreateUserServlet

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 org.apache.sling.jackrabbit.usermanager.impl.post.AbstractAuthorizablePostServlet
                  extended by org.apache.sling.jackrabbit.usermanager.impl.post.AbstractUserPostServlet
                      extended by org.apache.sling.jackrabbit.usermanager.impl.post.CreateUserServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class CreateUserServlet
extends AbstractUserPostServlet

Sling Post Servlet implementation for creating a user in the jackrabbit UserManager.

Rest Service Description

Creates a new user. Maps on to nodes of resourceType sling/users like /rep:system/rep:userManager/rep:users mapped to a resource url /system/userManager/user. This servlet responds at /system/userManager/user.create.html

Methods

Post Parameters

:name
The name of the new user (required)
:pwd
The password of the new user (required)
:pwdConfirm
The password of the new user (required)
*
Any additional parameters become properties of the user node (optional)

Response

200
Success, a redirect is sent to the users resource locator. The redirect comes with HTML describing the status.
500
Failure, including user already exists. HTML explains the failure.

Example

curl -F:name=ieb -Fpwd=password -FpwdConfirm=password -Fproperty1=value1 http://localhost:8080/system/userManager/user.create.html

See Also:
Serialized Form

Constructor Summary
CreateUserServlet()
           
 
Method Summary
protected  void activate(org.osgi.service.component.ComponentContext componentContext)
          Activates this component.
protected  SlingRepository getRepository()
          Returns the JCR repository used by this service.
protected  void handleOperation(SlingHttpServletRequest request, HtmlResponse response, List<Modification> changes)
          Extending Servlet should implement this operation to do the work
 
Methods inherited from class org.apache.sling.jackrabbit.usermanager.impl.post.AbstractUserPostServlet
deactivate, digestPassword, digestPassword
 
Methods inherited from class org.apache.sling.jackrabbit.usermanager.impl.post.AbstractAuthorizablePostServlet
collectContent, createHtmlResponse, doPost, externalizePath, getItemPath, getRedirectUrl, hasItemPathPrefix, isSetStatus, processDeletes, requireItemPathPrefix, writeContent
 
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, doGet, 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
 

Constructor Detail

CreateUserServlet

public CreateUserServlet()
Method Detail

getRepository

protected SlingRepository getRepository()
Returns the JCR repository used by this service.


activate

protected void activate(org.osgi.service.component.ComponentContext componentContext)
Activates this component.

Overrides:
activate in class AbstractUserPostServlet
Parameters:
componentContext - The OSGi ComponentContext of this component.

handleOperation

protected void handleOperation(SlingHttpServletRequest request,
                               HtmlResponse response,
                               List<Modification> changes)
                        throws javax.jcr.RepositoryException
Description copied from class: AbstractAuthorizablePostServlet
Extending Servlet should implement this operation to do the work

Specified by:
handleOperation in class AbstractAuthorizablePostServlet
Parameters:
request - the sling http request to process
response - the response
Throws:
javax.jcr.RepositoryException


Copyright © 2007-2013 The Apache Software Foundation. All Rights Reserved.