incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jus...@apache.org
Subject svn commit: r958690 - /sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/
Date Mon, 28 Jun 2010 19:43:11 GMT
Author: justin
Date: Mon Jun 28 19:43:11 2010
New Revision: 958690

URL: http://svn.apache.org/viewvc?rev=958690&view=rev
Log:
SLING-1577 - using full property path instead of simple property name in creation of RequestProperty
object

Modified:
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.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/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-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java?rev=958690&r1=958689&r2=958690&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractAuthorizablePostServlet.java
Mon Jun 28 19:43:11 2010
@@ -287,7 +287,8 @@ public abstract class AbstractAuthorizab
      * @throws ServletException if an internal error occurs
      */
     protected Map<String, RequestProperty> collectContent(
-            SlingHttpServletRequest request, HtmlResponse response) {
+            SlingHttpServletRequest request, HtmlResponse response,
+            String authorizablePath) {
 
         boolean requireItemPrefix = requireItemPathPrefix(request);
 
@@ -321,6 +322,8 @@ public abstract class AbstractAuthorizab
                 // be used.
                 continue; // skip it.
             }
+            
+            propPath = authorizablePath + "/" + propPath;
 
             // @TypeHint example
             // <input type="text" name="./age" />
@@ -421,23 +424,23 @@ public abstract class AbstractAuthorizab
      * <code>props</code>.
      * 
      * @param props The map of already seen request properties.
-     * @param paramName The absolute path of the property including the
+     * @param paramPath The absolute path of the property including the
      *            <code>suffix</code> to be looked up.
      * @param suffix The (optional) suffix to remove from the
      *            <code>paramName</code> before looking it up.
      * @return The {@link RequestProperty} for the <code>paramName</code>.
      */
     private RequestProperty getOrCreateRequestProperty(
-            Map<String, RequestProperty> props, String paramName, String suffix) {
-        if (suffix != null && paramName.endsWith(suffix)) {
-            paramName = paramName.substring(0, paramName.length()
+            Map<String, RequestProperty> props, String paramPath, String suffix) {
+        if (suffix != null && paramPath.endsWith(suffix)) {
+            paramPath = paramPath.substring(0, paramPath.length()
                 - suffix.length());
         }
 
-        RequestProperty prop = props.get(paramName);
+        RequestProperty prop = props.get(paramPath);
         if (prop == null) {
-            prop = new RequestProperty(paramName);
-            props.put(paramName, prop);
+            prop = new RequestProperty(paramPath);
+            props.put(paramPath, prop);
         }
 
         return prop;

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=958690&r1=958689&r2=958690&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
Mon Jun 28 19:43:11 2010
@@ -114,9 +114,6 @@ public class CreateGroupServlet extends 
                     "A principal already exists with the requested name: "
                         + principalName);
             } else {
-                Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response);
-
                 Group group = userManager.createGroup(new Principal() {
                     public String getName() {
                         return principalName;
@@ -125,6 +122,9 @@ public class CreateGroupServlet extends 
 
                 String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
                     + group.getID();
+                
+                Map<String, RequestProperty> reqProperties = collectContent(
+                    request, response, groupPath);
                 response.setPath(groupPath);
                 response.setLocation(externalizePath(request, groupPath));
                 response.setParentLocation(externalizePath(request,

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=958690&r1=958689&r2=958690&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
Mon Jun 28 19:43:11 2010
@@ -219,13 +219,13 @@ public class CreateUserServlet extends A
                     "A principal already exists with the requested name: "
                         + principalName);
             } else {
-                Map<String, RequestProperty> reqProperties = collectContent(
-                    request, response);
-
                 User user = userManager.createUser(principalName,
                     digestPassword(pwd));
                 String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_USER_PREFIX
                     + user.getID();
+                
+                Map<String, RequestProperty> reqProperties = collectContent(
+                    request, response, userPath);
 
                 response.setPath(userPath);
                 response.setLocation(externalizePath(request, userPath));

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=958690&r1=958689&r2=958690&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
Mon Jun 28 19:43:11 2010
@@ -28,6 +28,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.jackrabbit.usermanager.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
 
 /**
@@ -105,9 +106,12 @@ public class UpdateGroupServlet extends 
         if (session == null) {
             throw new RepositoryException("JCR Session not found");
         }
+        
+        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+            + authorizable.getID();
 
         Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse);
+            htmlResponse, groupPath);
         try {
             // cleanup any old content (@Delete parameters)
             processDeletes(authorizable, reqProperties, changes);

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=958690&r1=958689&r2=958690&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
Mon Jun 28 19:43:11 2010
@@ -28,6 +28,7 @@ import org.apache.sling.api.resource.Res
 import org.apache.sling.api.resource.ResourceNotFoundException;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.jackrabbit.usermanager.impl.helper.RequestProperty;
+import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.servlets.post.Modification;
 
 /**
@@ -106,9 +107,12 @@ public class UpdateUserServlet extends A
         if (session == null) {
             throw new RepositoryException("JCR Session not found");
         }
+        
+        String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
+            + authorizable.getID();
 
         Map<String, RequestProperty> reqProperties = collectContent(request,
-            htmlResponse);
+            htmlResponse, userPath);
         try {
             // cleanup any old content (@Delete parameters)
             processDeletes(authorizable, reqProperties, changes);



Mime
View raw message