incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r794751 - in /sling/trunk/bundles/jcr: jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/
Date Thu, 16 Jul 2009 16:54:40 GMT
Author: ieb
Date: Thu Jul 16 16:54:39 2009
New Revision: 794751

URL: http://svn.apache.org/viewvc?rev=794751&view=rev
Log:
SLING-940
Applied patch from myself.
Adds Javadoc to accessmanager and usermanager servlets.

Modified:
    sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/AbstractAccessPostServlet.java
    sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/DeleteAcesServlet.java
    sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/GetAclServlet.java
    sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ModifyAceServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java

Modified: sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/AbstractAccessPostServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/AbstractAccessPostServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/AbstractAccessPostServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/AbstractAccessPostServlet.java
Thu Jul 16 16:54:39 2009
@@ -48,7 +48,7 @@
      * default log
      */
     private final Logger log = LoggerFactory.getLogger(getClass());
-    
+   
 	/* (non-Javadoc)
 	 * @see org.apache.sling.api.servlets.SlingAllMethodsServlet#doPost(org.apache.sling.api.SlingHttpServletRequest,
org.apache.sling.api.SlingHttpServletResponse)
 	 */
@@ -76,12 +76,12 @@
         Session session = request.getResourceResolver().adaptTo(Session.class);
 
         final List<Modification> changes = new ArrayList<Modification>();
-        
+       
         try {
             handleOperation(request, htmlResponse, changes);
-            
+           
             //TODO: maybe handle SlingAuthorizablePostProcessor handlers here
-            
+           
             // set changes on html response
             for(Modification change : changes) {
                 switch ( change.getType() ) {
@@ -93,7 +93,7 @@
                     case ORDER : htmlResponse.onChange("ordered", change.getSource(), change.getDestination());
break;
                 }
             }
-            
+           
             if (session.hasPendingChanges()) {
                 session.save();
             }
@@ -115,7 +115,7 @@
                     e.getMessage(), e);
             }
         }
-        
+       
         // check for redirect URL if processing succeeded
         if (htmlResponse.isSuccessful()) {
             String redirect = getRedirectUrl(request, htmlResponse);
@@ -131,10 +131,10 @@
 
 	/**
 	 * Extending Servlet should implement this operation to do the work
-	 * 
+	 *
 	 * @param request the sling http request to process
-	 * @param htmlResponse the response 
-	 * @param changes 
+	 * @param htmlResponse the response
+	 * @param changes
 	 */
 	abstract protected void handleOperation(SlingHttpServletRequest request,
 			HtmlResponse htmlResponse, List<Modification> changes) throws RepositoryException;
@@ -250,5 +250,5 @@
 
         return ret.toString();
     }
-    
+   
 }

Modified: sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/DeleteAcesServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/DeleteAcesServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/DeleteAcesServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/DeleteAcesServlet.java
Thu Jul 16 16:54:39 2009
@@ -40,14 +40,41 @@
 import org.apache.sling.servlets.post.SlingPostConstants;
 
 /**
- * Sling Post Servlet implementation for deleting the ACE for a set of principals on
- * a JCR resource.
- * 
- * @scr.component immediate="true" 
+ * <p>
+ * Sling Post Servlet implementation for deleting the ACE for a set of principals on a JCR
+ * resource.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Delete a set of Ace's from a node, the node is identified as a resource by the request
+ * url &gt;resource&lt;.deleteAce.html
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>:applyTo</dt>
+ * <dd>An array of ace principal names to delete. Note the principal name is the primary
+ * key of the Ace in the Acl</dd>
+ * </dl>
+ *
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found.</dd>
+ * <dt>500</dt>
+ * <dd>Failure. HTML explains the failure.</dd>
+ * </dl>
+ *
+ * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/servlet/default"
- * @scr.property name="sling.servlet.methods" value="POST" 
- * @scr.property name="sling.servlet.selectors" value="deleteAce" 
+ * @scr.property name="sling.servlet.methods" value="POST"
+ * @scr.property name="sling.servlet.selectors" value="deleteAce"
  */
 public class DeleteAcesServlet extends AbstractAccessPostServlet {
 	private static final long serialVersionUID = 3784866802938282971L;

Modified: sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/GetAclServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/GetAclServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/GetAclServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/GetAclServlet.java
Thu Jul 16 16:54:39 2009
@@ -47,15 +47,76 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Sling GET servlet implementation for dumping the declared ACL of a resource
- * to JSON.
- * 
- * @scr.component immediate="true" 
+ * <p>
+ * Sling GET servlet implementation for dumping the declared ACL of a resource to JSON.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Mapped to the default resourceType. Gets and Acl for a resource. Get of the form
+ * &gt;resource&lt;.acl.json Provided the user has access to the ACL, they get a
chunk of
+ * JSON of the form.
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>GET</li>
+ * </ul>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found.</dd>
+ * <dt>500</dt>
+ * <dd>Failure. HTML explains the failure.</dd>
+ * </dl>
+ * <h4>Example Response</h4>
+ * <code>
+ * <pre>
+ * {
+ * &quot;principalNameA&quot;:
+ *      { &quot;granted&quot; : [
+ *           &quot;permission1&quot;,
+ *           &quot;permission2&quot;,
+ *           &quot;permission3&quot;,
+ *           &quot;permission4&quot; ],
+ *        &quot;denied&quot; : [
+ *           &quot;permission5&quot;,
+ *           &quot;permission6&quot;,
+ *           &quot;permission7&quot;,
+ *           &quot;permission8&quot;]
+ *       },
+ * &quot;principalNameB&quot;:
+ *       { &quot;granted&quot; : [
+ *           &quot;permission1&quot;,
+ *           &quot;permission2&quot;,
+ *           &quot;permission3&quot;,
+ *           &quot;permission4&quot; ],
+ *         &quot;denied&quot; : [
+ *           &quot;permission5&quot;,
+ *           &quot;permission6&quot;,
+ *           &quot;permission7&quot;,
+ *           &quot;permission8&quot;] },
+ * &quot;principalNameC&quot;:
+ *       { &quot;granted&quot; : [
+ *           &quot;permission1&quot;,
+ *           &quot;permission2&quot;,
+ *           &quot;permission3&quot;,
+ *           &quot;permission4&quot; ],
+ *         &quot;denied&quot; : [
+ *           &quot;permission5&quot;,
+ *           &quot;permission6&quot;,
+ *           &quot;permission7&quot;,
+ *           &quot;permission8&quot;] }
+ * }
+ * </pre>
+ * </code>
+ *
+ * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/servlet/default"
- * @scr.property name="sling.servlet.methods" value="GET" 
- * @scr.property name="sling.servlet.selectors" value="acl" 
- * @scr.property name="sling.servlet.extensions " value="json" 
+ * @scr.property name="sling.servlet.methods" value="GET"
+ * @scr.property name="sling.servlet.selectors" value="acl"
+ * @scr.property name="sling.servlet.extensions " value="json"
  */
 public class GetAclServlet extends SlingAllMethodsServlet {
 	private static final long serialVersionUID = 3391376559396223184L;

Modified: sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ModifyAceServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ModifyAceServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ModifyAceServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-accessmanager/src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/post/ModifyAceServlet.java
Thu Jul 16 16:54:39 2009
@@ -43,14 +43,51 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Sling Post Servlet implementation for modifying the ACE for a principal on
- * a JCR resource.
- * 
- * @scr.component immediate="true" 
+ * <p>
+ * Sling Post Servlet implementation for modifying the ACE for a principal on a JCR
+ * resource.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Delete a set of Ace's from a node, the node is identified as a resource by the request
+ * url &gt;resource&lt;.modifyAce.html
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>principalId</dt>
+ * <dd>The principal of the Ace to modify in the ACL specified by the path.</dd>
+ * <dt>privilege@*</dt>
+ * <dd>One of more privileges, either granted or denied, where set the permission in
the
+ * stored ACE is modified to match the request. Any permissions that are present in the
+ * stored ACE, but are not in the request are left untouched.</dd>
+ * </dl>
+ *
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found.</dd>
+ * <dt>500</dt>
+ * <dd>Failure. HTML explains the failure.</dd>
+ * </dl>
+ *
+ * <h4>Notes</h4>
+ * <p>
+ * The principalId is assumed to refer directly to an Authorizable, that comes direct from
+ * the UserManager. This can be a group or a user, but if its a group, denied permissions
+ * will not be added to the group. The group will only contain granted privileges.
+ * </p>
+ *
+ * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/servlet/default"
- * @scr.property name="sling.servlet.methods" value="POST" 
- * @scr.property name="sling.servlet.selectors" value="modifyAce" 
+ * @scr.property name="sling.servlet.methods" value="POST"
+ * @scr.property name="sling.servlet.selectors" value="modifyAce"
  */
 public class ModifyAceServlet extends AbstractAccessPostServlet {
 	private static final long serialVersionUID = -9182485466670280437L;

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ChangeUserPasswordServlet.java
Thu Jul 16 16:54:39 2009
@@ -31,9 +31,43 @@
 import org.apache.sling.servlets.post.Modification;
 
 /**
- * Sling Post Operation implementation for updating the password of a user in
- * the jackrabbit UserManager.
- * 
+ * <p>
+ * Changes the password associated with a user. a new group. Maps on to nodes of resourceType
<code>sling/groups</code> like
+ * <code>/rep:system/rep:userManager/rep:users/ae/fd/3e/ieb</code> mapped to
a resource url
+ * <code>/system/userManager/user/ieb</code>. This servlet responds at
+ * <code>/system/userManager/user/ieb.changePassword.create.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>oldPwd</dt>
+ * <dd>The current password for the user (required)</dd>
+ * <dt>newPwd</dt>
+ * <dd>The new password for the user (required)</dd>
+ * <dt>newPwdConfirm</dt>
+ * <dd>The confirm new password for the user (required)</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Sucess sent with no body</dd>
+ * <dt>404</dt>
+ * <dd>If the user was not found.</dd>
+ * <dt>500</dt>
+ * <dd>Failure, including group already exists. HTML explains the failure.</dd>
+ * </dl>
+ * <h4>Example</h4>
+ *
+ * <code>
+ * curl -FoldPwd=oldpassword -FnewPwd=newpassword =FnewPwdConfirm=newpassword http://localhost:8080/system/userManager/user/ieb.changePassword.html
+ * </code>
+ *
+ * <h4>Notes</h4>
+ *
+ *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateGroupServlet.java
Thu Jul 16 16:54:39 2009
@@ -35,8 +35,42 @@
 import org.apache.sling.servlets.post.SlingPostConstants;
 
 /**
- * Sling Post Servlet implementation for creating a group in the jackrabbit
- * UserManager.
+ * <p>
+ * Sling Post Servlet implementation for creating a group in the jackrabbit UserManager.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Creates a new group. Maps on to nodes of resourceType <code>sling/groups</code>
like
+ * <code>/rep:system/rep:userManager/rep:groups</code> mapped to a resource url
+ * <code>/system/userManager/group</code>. This servlet responds at
+ * <code>/system/userManager/group.create.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>:name</dt>
+ * <dd>The name of the new group (required)</dd>
+ * <dt>*</dt>
+ * <dd>Any additional parameters become properties of the group node (optional)</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success, a redirect is sent to the group resource locator. The redirect comes
with
+ * HTML describing the status.</dd>
+ * <dt>500</dt>
+ * <dd>Failure, including group already exists. HTML explains the failure.</dd>
+ * </dl>
+ * <h4>Example</h4>
+ * 
+ * <code>
+ * curl -F:name=newGroupA  -Fproperty1=value1 http://localhost:8080/system/userManager/group.create.html
+ * </code>
+ * 
+ * <h4>Notes</h4>
  * 
  * @scr.component immediate="true"
  * @scr.service interface="javax.servlet.Servlet"

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/CreateUserServlet.java
Thu Jul 16 16:54:39 2009
@@ -39,9 +39,45 @@
 import org.slf4j.LoggerFactory;
 
 /**
- * Sling Post Servlet implementation for creating a user in the jackrabbit
- * UserManager.
- * 
+ * <p>
+ * Sling Post Servlet implementation for creating a user in the jackrabbit UserManager.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Creates a new user. Maps on to nodes of resourceType <code>sling/users</code>
like
+ * <code>/rep:system/rep:userManager/rep:users</code> mapped to a resource url
+ * <code>/system/userManager/user</code>. This servlet responds at <code>/system/userManager/user.create.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>:name</dt>
+ * <dd>The name of the new user (required)</dd>
+ * <dt>:pwd</dt>
+ * <dd>The password of the new user (required)</dd>
+ * <dt>:pwdConfirm</dt>
+ * <dd>The password of the new user (required)</dd>
+ * <dt>*</dt>
+ * <dd>Any additional parameters become properties of the user node (optional)</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success, a redirect is sent to the users resource locator. The redirect comes
with
+ * HTML describing the status.</dd>
+ * <dt>500</dt>
+ * <dd>Failure, including user already exists. HTML explains the failure.</dd>
+ * </dl>
+ * <h4>Example</h4>
+ *
+ * <code>
+ * curl -F:name=ieb -Fpwd=password -FpwdConfirm=password -Fproperty1=value1 http://localhost:8080/system/userManager/user.create.html
+ * </code>
+ *
+ *
  * @scr.component immediate="true" label="%createUser.post.operation.name"
  *                description="%createUser.post.operation.description"
  * @scr.service interface="javax.servlet.Servlet"
@@ -70,7 +106,7 @@
 
     /**
      * The JCR Repository we access to resolve resources
-     * 
+     *
      * @scr.reference
      */
     private SlingRepository repository;
@@ -104,7 +140,7 @@
 
     /**
      * Activates this component.
-     * 
+     *
      * @param componentContext The OSGi <code>ComponentContext</code> of this
      *            component.
      */

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/DeleteAuthorizableServlet.java
Thu Jul 16 16:54:39 2009
@@ -33,9 +33,40 @@
 import org.apache.sling.servlets.post.SlingPostConstants;
 
 /**
- * Sling Post Operation implementation for deleting one or more users and/or
- * groups from the jackrabbit UserManager.
+ 
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Deletes an Authorizable, currently a user or a group. Maps on to nodes of resourceType
<code>sling/users</code> or <code>sling/users</code> like
+ * <code>/rep:system/rep:userManager/rep:users</code> or <code>/rep:system/rep:userManager/rep:groups</code>
mapped to a resource url
+ * <code>/system/userManager/user</code> or <code>/system/userManager/group</code>.
This servlet responds at
+ * <code>/system/userManager/user.delete.html</code> or <code>/system/userManager/group.delete.html</code>.
+ * The servlet also responds to single delete requests eg <code>/system/userManager/group/newGroup.delete.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>:applyTo</dt>
+ * <dd>An array of relative resource references to Authorizables to be deleted, if
this parameter is present, the url is ignored and all the Authorizables in the list are removed.</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success, no body.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found</dd>
+ * <dt>500</dt>
+ * <dd>Failure</dd>
+ * </dl>
+ * <h4>Example</h4>
  * 
+ * <code>
+ * curl -Fgo=1 http://localhost:8080/system/userManager/user/ieb.delete.html
+ * </code>
+ *
+ *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" values.0="sling/user"
@@ -90,7 +121,7 @@
      * set with valid resources an empty iterator is returned. Any resources
      * addressed in the {@link SlingPostConstants#RP_APPLY_TO} parameter is
      * ignored.
-     * 
+     *
      * @param request The <code>SlingHttpServletRequest</code> object used to
      *            get the {@link SlingPostConstants#RP_APPLY_TO} parameter.
      * @return The iterator of resources listed in the parameter or

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateGroupServlet.java
Thu Jul 16 16:54:39 2009
@@ -31,9 +31,44 @@
 import org.apache.sling.servlets.post.Modification;
 
 /**
- * Sling Post Operation implementation for updating a group in the jackrabbit
- * UserManager.
+ * <p>
+ * Sling Post Operation implementation for updating a group in the 
+ * jackrabbit UserManager.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Updates a group's properties. Maps on to nodes of resourceType <code>sling/groups</code>
like
+ * <code>/rep:system/rep:userManager/rep:groups/ae/3f/ed/testGroup</code> mapped
to a resource url
+ * <code>/system/userManager/group/testGroup</code>. This servlet responds at
+ * <code>/system/userManager/group/testGroup.update.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>*</dt>
+ * <dd>Any additional parameters become properties of the group node (optional)</dd>
+ * <dt>*@Delete</dt>
+ * <dd>The property is deleted, eg prop1@Delete</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success, a redirect is sent to the group's resource locator. The redirect comes
with
+ * HTML describing the status.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found</dd>
+ * <dt>500</dt>
+ * <dd>Failure</dd>
+ * </dl>
+ * <h4>Example</h4>
  * 
+ * <code>
+ * curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/group/testGroup.update.html
+ * </code>
+ *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" values="sling/group"

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java?rev=794751&r1=794750&r2=794751&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/UpdateUserServlet.java
Thu Jul 16 16:54:39 2009
@@ -31,9 +31,45 @@
 import org.apache.sling.servlets.post.Modification;
 
 /**
- * Sling Post Operation implementation for updating a user in the jackrabbit
- * UserManager.
+ * <p>
+ * Sling Post Operation implementation for updating a user in the jackrabbit UserManager.
+ * </p>
+ * <h2>Rest Service Description</h2>
+ * <p>
+ * Updates a users properties. Maps on to nodes of resourceType <code>sling/users</code>
like
+ * <code>/rep:system/rep:userManager/rep:users</code> mapped to a resource url
+ * <code>/system/userManager/user/ieb</code>. This servlet responds at
+ * <code>/system/userManager/user/ieb.update.html</code>
+ * </p>
+ * <h4>Methods</h4>
+ * <ul>
+ * <li>POST</li>
+ * </ul>
+ * <h4>Post Parameters</h4>
+ * <dl>
+ * <dt>*</dt>
+ * <dd>Any additional parameters become properties of the user node (optional)</dd>
+ * <dt>*@Delete</dt>
+ * <dd>Delete the property eg prop3@Delete means prop3 will be deleted (optional)</dd>
+ * </dl>
+ * <h4>Response</h4>
+ * <dl>
+ * <dt>200</dt>
+ * <dd>Success, a redirect is sent to the users resource locator. The redirect comes
with
+ * HTML describing the status.</dd>
+ * <dt>404</dt>
+ * <dd>The resource was not found</dd>
+ * <dt>500</dt>
+ * <dd>Failure</dd>
+ * </dl>
+ * <h4>Example</h4>
  * 
+ * <code>
+ * curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/user/ieb.update.html
+ * </code>
+ * 
+ *
+ *
  * @scr.component metatype="no" immediate="true"
  * @scr.service interface="javax.servlet.Servlet"
  * @scr.property name="sling.servlet.resourceTypes" value="sling/user"



Mime
View raw message