incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From enor...@apache.org
Subject svn commit: r1208227 - in /sling/trunk/bundles/jcr/jackrabbit-usermanager: ./ src/main/java/org/apache/sling/jackrabbit/usermanager/impl/ src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/ src/main/java/org/apache/sling/jackrabbit/userman...
Date Wed, 30 Nov 2011 02:59:06 GMT
Author: enorman
Date: Wed Nov 30 02:58:56 2011
New Revision: 1208227

URL: http://svn.apache.org/viewvc?rev=1208227&view=rev
Log:
SLING-2305 UserManager - Convert @scr JavaDoc Tags to SCR Annotations

Modified:
    sling/trunk/bundles/jcr/jackrabbit-usermanager/pom.xml
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
    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/AbstractUserPostServlet.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
    sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/pom.xml?rev=1208227&r1=1208226&r2=1208227&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/pom.xml (original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/pom.xml Wed Nov 30 02:58:56 2011
@@ -125,5 +125,13 @@
             <groupId>org.slf4j</groupId>
             <artifactId>slf4j-api</artifactId>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.scr.annotations</artifactId>
+            <version>1.6.0</version>
+            <scope>provided</scope>
+        </dependency>
+
     </dependencies>
 </project>
\ No newline at end of file

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java?rev=1208227&r1=1208226&r2=1208227&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/AuthorizablePrivilegesInfoImpl.java
Wed Nov 30 02:58:56 2011
@@ -25,6 +25,10 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.servlet.Servlet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
@@ -59,42 +63,35 @@ import org.slf4j.LoggerFactory;
  * <li>group membership can only be edited by members of the 'Group administrator'
  * and the 'User administrator' group.</li>
  * </ul>
- * 
- * @scr.component immediate="true" metatype="no"
- * @scr.service
- *
- * @scr.property name="service.description" value="User/Group Privileges Information"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
  */
+@Component (immediate=true, metatype=true)
+@Service (value=AuthorizablePrivilegesInfo.class)
+@Properties ({
+	@Property (name="service.description",
+			value="User/Group Privileges Information"),
+	@Property (name="service.vendor",
+			value="The Apache Software Foundation")
+})
 public class AuthorizablePrivilegesInfoImpl implements AuthorizablePrivilegesInfo {
 
     /** default log */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     /**
-     * The name of the configuration parameter providing the 
-     * 'User administrator' group name.
-     *
-     * @scr.property valueRef="DEFAULT_USER_ADMIN_GROUP_NAME"
-     */
-    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
-
-    /**
      * The default 'User administrator' group name
      *
      * @see #PAR_USER_ADMIN_GROUP_NAME
      */
     private static final String DEFAULT_USER_ADMIN_GROUP_NAME = "UserAdmin";
  
-    private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
-
     /**
      * The name of the configuration parameter providing the 
-     * 'Group administrator' group name.
-     *
-     * @scr.property valueRef="DEFAULT_GROUP_ADMIN_GROUP_NAME"
+     * 'User administrator' group name.
      */
-    private static final String PAR_GROUP_ADMIN_GROUP_NAME = "group.admin.group.name";
+    @Property (value=DEFAULT_USER_ADMIN_GROUP_NAME)
+    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
+
+    private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
 
     /**
      * The default 'User administrator' group name
@@ -103,6 +100,13 @@ public class AuthorizablePrivilegesInfoI
      */
     private static final String DEFAULT_GROUP_ADMIN_GROUP_NAME = "GroupAdmin";
  
+    /**
+     * The name of the configuration parameter providing the 
+     * 'Group administrator' group name.
+     */
+    @Property (value=DEFAULT_GROUP_ADMIN_GROUP_NAME)
+    private static final String PAR_GROUP_ADMIN_GROUP_NAME = "group.admin.group.name";
+
     private String groupAdminGroupName = DEFAULT_GROUP_ADMIN_GROUP_NAME;
     
     

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -33,6 +33,8 @@ import javax.jcr.Value;
 import javax.jcr.ValueFactory;
 import javax.servlet.ServletException;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Property;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.sling.api.SlingIOException;
 import org.apache.sling.api.request.RequestParameter;
@@ -47,16 +49,19 @@ import org.osgi.service.component.Compon
 /**
  * Base class for all the POST servlets for the UserManager operations
  */
+@Component (componentAbstract=true)
 public abstract class AbstractAuthorizablePostServlet extends
         AbstractPostServlet {
     private static final long serialVersionUID = -5918670409789895333L;
 
-    /**
-     * @scr.property values.0="EEE MMM dd yyyy HH:mm:ss 'GMT'Z"
-     *               values.1="yyyy-MM-dd'T'HH:mm:ss.SSSZ"
-     *               values.2="yyyy-MM-dd'T'HH:mm:ss" values.3="yyyy-MM-dd"
-     *               values.4="dd.MM.yyyy HH:mm:ss" values.5="dd.MM.yyyy"
-     */
+    @Property (value={
+    		"EEE MMM dd yyyy HH:mm:ss 'GMT'Z",
+    		"yyyy-MM-dd'T'HH:mm:ss.SSSZ",
+    		"yyyy-MM-dd'T'HH:mm:ss",
+    		"yyyy-MM-dd",
+    		"dd.MM.yyyy HH:mm:ss",
+    		"dd.MM.yyyy"
+    })
     private static final String PROP_DATE_FORMAT = "servlet.post.dateFormats";
 
     private DateParser dateParser;

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractUserPostServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractUserPostServlet.java?rev=1208227&r1=1208226&r2=1208227&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractUserPostServlet.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/post/AbstractUserPostServlet.java
Wed Nov 30 02:58:56 2011
@@ -20,12 +20,14 @@ import java.io.UnsupportedEncodingExcept
 import java.security.NoSuchAlgorithmException;
 import java.util.Dictionary;
 
+import org.apache.felix.scr.annotations.Component;
 import org.apache.jackrabbit.util.Text;
 import org.osgi.service.component.ComponentContext;
 
 /**
  * Base class for servlets manipulating users
  */
+@Component (componentAbstract=true)
 public abstract class AbstractUserPostServlet extends
         AbstractAuthorizablePostServlet {
     private static final long serialVersionUID = -8401210711297654453L;

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -24,6 +24,12 @@ import javax.jcr.Credentials;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
+import javax.servlet.Servlet;
+
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
@@ -77,16 +83,22 @@ import org.slf4j.LoggerFactory;
  * </code>
  *
  * <h4>Notes</h4>
- *
- *
- * @scr.component immediate="true" label="%changeUserPassword.post.operation.name"
- *                description="%changeUserPassword.post.operation.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.ChangeUserPassword"
- * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="changePassword"
  */
+@Component (immediate=true, metatype=true,
+		label="%changeUserPassword.post.operation.name",
+		description="%changeUserPassword.post.operation.description")
+@Service (value={
+	Servlet.class,
+	ChangeUserPassword.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value="sling/user"),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="changePassword")
+})
 public class ChangeUserPasswordServlet extends AbstractUserPostServlet implements ChangeUserPassword
{
     private static final long serialVersionUID = 1923614318474654502L;
 
@@ -96,21 +108,20 @@ public class ChangeUserPasswordServlet e
     private final Logger log = LoggerFactory.getLogger(getClass());
 
     /**
-     * The name of the configuration parameter providing the 
-     * name of the group whose members are allowed to reset the password
-     * of a user without the 'oldPwd' value.
-     *
-     * @scr.property valueRef="DEFAULT_USER_ADMIN_GROUP_NAME"
-     */
-    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
-
-    /**
      * The default 'User administrator' group name
      *
      * @see #PAR_USER_ADMIN_GROUP_NAME
      */
     private static final String DEFAULT_USER_ADMIN_GROUP_NAME = "UserAdmin";
  
+    /**
+     * The name of the configuration parameter providing the 
+     * name of the group whose members are allowed to reset the password
+     * of a user without the 'oldPwd' value.
+     */
+    @Property (value=DEFAULT_USER_ADMIN_GROUP_NAME)
+    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
+
     private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
     
     // ---------- SCR integration ---------------------------------------------

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -22,7 +22,13 @@ import java.util.Map;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
@@ -30,13 +36,13 @@ import org.apache.sling.api.SlingHttpSer
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.servlets.HtmlResponse;
-import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.apache.sling.jackrabbit.usermanager.CreateGroup;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.jcr.resource.JcrResourceResolverFactory;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.SlingPostConstants;
+import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 
 /**
  * <p>
@@ -75,19 +81,26 @@ import org.apache.sling.servlets.post.Sl
  * </code>
  * 
  * <h4>Notes</h4>
- * 
- * @scr.component immediate="true" label="%createGroup.post.operation.name"
- *                description="%createGroup.post.operation.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.CreateGroup"
- * @scr.property name="sling.servlet.resourceTypes" value="sling/groups"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="create"
  */
+@Component (immediate=true, metatype=true,
+		label="%createGroup.post.operation.name",
+		description="%createGroup.post.operation.description")
+@Service (value={
+	Servlet.class,
+	CreateGroup.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value="sling/groups"),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="create")
+})
 public class CreateGroupServlet extends AbstractGroupPostServlet implements CreateGroup {
     private static final long serialVersionUID = -1084915263933901466L;
 
-    /** @scr.reference */
+    @Reference
     private JcrResourceResolverFactory resourceResolverFactory;
     
     /*

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -22,7 +22,13 @@ import java.util.Map;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
@@ -30,13 +36,13 @@ import org.apache.jackrabbit.api.securit
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.servlets.HtmlResponse;
 import org.apache.sling.commons.osgi.OsgiUtil;
-import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.apache.sling.jackrabbit.usermanager.CreateUser;
 import org.apache.sling.jackrabbit.usermanager.impl.resource.AuthorizableResourceProvider;
 import org.apache.sling.jcr.api.SlingRepository;
 import org.apache.sling.jcr.base.util.AccessControlUtil;
 import org.apache.sling.servlets.post.Modification;
 import org.apache.sling.servlets.post.SlingPostConstants;
+import org.apache.sling.servlets.post.impl.helper.RequestProperty;
 import org.osgi.service.component.ComponentContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -79,16 +85,22 @@ import org.slf4j.LoggerFactory;
  * <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"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.CreateUser"
- * @scr.property name="sling.servlet.resourceTypes" value="sling/users"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="create"
  */
+@Component (immediate=true, metatype=true, inherit=true,
+		label="%createUser.post.operation.name",
+		description="%createUser.post.operation.description")
+@Service(value={
+		Servlet.class,
+		CreateUser.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value="sling/users"),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="create")
+})
 public class CreateUserServlet extends AbstractUserPostServlet implements CreateUser {
     private static final long serialVersionUID = 6871481922737658675L;
 
@@ -97,51 +109,42 @@ public class CreateUserServlet extends A
      */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
-    /**
-     * @scr.property label="%self.registration.enabled.name"
-     *               description="%self.registration.enabled.description"
-     *               valueRef="DEFAULT_SELF_REGISTRATION_ENABLED"
-     */
-    private static final String PROP_SELF_REGISTRATION_ENABLED = "self.registration.enabled";
+    private static final boolean DEFAULT_SELF_REGISTRATION_ENABLED = false;
 
-    private static final Boolean DEFAULT_SELF_REGISTRATION_ENABLED = Boolean.FALSE;
+    @Property (label="%self.registration.enabled.name",
+    		description="%self.registration.enabled.description",
+    		boolValue=DEFAULT_SELF_REGISTRATION_ENABLED)
+    private static final String PROP_SELF_REGISTRATION_ENABLED = "self.registration.enabled";
 
     private Boolean selfRegistrationEnabled = DEFAULT_SELF_REGISTRATION_ENABLED;
 
     /**
-     * The name of the configuration parameter providing the 
-     * 'User administrator' group name.
-     *
-     * @scr.property valueRef="DEFAULT_USER_ADMIN_GROUP_NAME"
-     */
-    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
-
-    /**
      * The default 'User administrator' group name
      *
      * @see #PAR_USER_ADMIN_GROUP_NAME
      */
     private static final String DEFAULT_USER_ADMIN_GROUP_NAME = "UserAdmin";
  
+    /**
+     * The name of the configuration parameter providing the 
+     * 'User administrator' group name.
+     */
+    @Property (value=DEFAULT_USER_ADMIN_GROUP_NAME)
+    private static final String PAR_USER_ADMIN_GROUP_NAME = "user.admin.group.name";
+
     private String userAdminGroupName = DEFAULT_USER_ADMIN_GROUP_NAME;
     
     /**
      * The JCR Repository we access to resolve resources
-     *
-     * @scr.reference
      */
+    @Reference
     private SlingRepository repository;
 
-    /** Returns the JCR repository used by this service. */
-    protected SlingRepository getRepository() {
-        return repository;
-    }
-
     /**
      * Returns an administrative session to the default workspace.
      */
     private Session getSession() throws RepositoryException {
-        return getRepository().loginAdministrative(null);
+        return repository.loginAdministrative(null);
     }
 
     /**

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -22,8 +22,13 @@ import java.util.NoSuchElementException;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
@@ -74,19 +79,28 @@ import org.apache.sling.servlets.post.Sl
  * <code>
  * curl -Fgo=1 http://localhost:8080/system/userManager/user/ieb.delete.html
  * </code>
- *
- *
- * @scr.component immediate="true" label="%deleteAuthorizable.post.operation.name"
- *                description="%deleteAuthorizable.post.operation.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteUser"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteGroup"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.DeleteAuthorizables"
- * @scr.property name="sling.servlet.resourceTypes" values.0="sling/user"
- *               values.1="sling/group" values.2="sling/userManager"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="delete"
  */
+@Component (immediate=true, metatype=true,
+		label="%deleteAuthorizable.post.operation.name",
+		description="%deleteAuthorizable.post.operation.description")
+@Service (value={
+	Servlet.class,
+	DeleteUser.class,
+	DeleteGroup.class,
+	DeleteAuthorizables.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value={
+					"sling/user",
+					"sling/group",
+					"sling/userManager"
+				}),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="delete")
+})
 public class DeleteAuthorizableServlet extends AbstractPostServlet
         implements DeleteUser, DeleteGroup, DeleteAuthorizables {
     private static final long serialVersionUID = 5874621724096106496L;

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -21,7 +21,13 @@ import java.util.Map;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.UserManager;
@@ -75,20 +81,27 @@ import org.apache.sling.servlets.post.im
  * <code>
  * curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/group/testGroup.update.html
  * </code>
- *
- * @scr.component immediate="true" label="%updateGroup.post.operation.name"
- *                description="%updateGroup.post.operation.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateGroup"
- * @scr.property name="sling.servlet.resourceTypes" values="sling/group"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="update"
  */
+@Component (immediate=true, metatype=true, 
+		label="%updateGroup.post.operation.name",
+		description="%updateGroup.post.operation.description")
+@Service (value={
+	Servlet.class,
+	UpdateGroup.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value="sling/group"),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="update")
+})
 public class UpdateGroupServlet extends AbstractGroupPostServlet 
         implements UpdateGroup {
     private static final long serialVersionUID = -8292054361992488797L;
 
-    /** @scr.reference */
+    @Reference
     private JcrResourceResolverFactory resourceResolverFactory;
     
     /*

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=1208227&r1=1208226&r2=1208227&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
Wed Nov 30 02:58:56 2011
@@ -21,7 +21,12 @@ import java.util.Map;
 
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
+import javax.servlet.Servlet;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.api.security.user.UserManager;
@@ -72,17 +77,22 @@ import org.apache.sling.servlets.post.im
  * <code>
  * curl -Fprop1=value2 -Fproperty1=value1 http://localhost:8080/system/userManager/user/ieb.update.html
  * </code>
- * 
- *
- *
- * @scr.component immediate="true" label="%updateUser.post.operation.name"
- *                description="%updateUser.post.operation.description"
- * @scr.service interface="javax.servlet.Servlet"
- * @scr.service interface="org.apache.sling.jackrabbit.usermanager.UpdateUser"
- * @scr.property name="sling.servlet.resourceTypes" value="sling/user"
- * @scr.property name="sling.servlet.methods" value="POST"
- * @scr.property name="sling.servlet.selectors" value="update"
  */
+@Component (immediate=true, metatype=true,
+		label="%updateUser.post.operation.name",
+		description="%updateUser.post.operation.description")
+@Service (value={
+	Servlet.class,
+	UpdateUser.class
+})		
+@Properties ({
+	@Property (name="sling.servlet.resourceTypes",
+			value="sling/user"),
+	@Property (name="sling.servlet.methods",
+			value="POST"),
+	@Property (name="sling.servlet.selectors",
+			value="update")
+})
 public class UpdateUserServlet extends AbstractUserPostServlet 
         implements UpdateUser {
     private static final long serialVersionUID = 5874621724096106496L;

Modified: sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java?rev=1208227&r1=1208226&r2=1208227&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
(original)
+++ sling/trunk/bundles/jcr/jackrabbit-usermanager/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResourceProvider.java
Wed Nov 30 02:58:56 2011
@@ -25,6 +25,10 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.servlet.http.HttpServletRequest;
 
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Properties;
+import org.apache.felix.scr.annotations.Property;
+import org.apache.felix.scr.annotations.Service;
 import org.apache.jackrabbit.api.security.principal.PrincipalIterator;
 import org.apache.jackrabbit.api.security.principal.PrincipalManager;
 import org.apache.jackrabbit.api.security.user.Authorizable;
@@ -40,15 +44,19 @@ import org.slf4j.LoggerFactory;
 
 /**
  * Resource Provider implementation for jackrabbit UserManager resources.
- *
- * @scr.component immediate="true" label="%authorizable.resourceprovider.name"
- *                description="%authorizable.resourceprovider.description"
- * @scr.property name="service.description"
- *               value="Resource provider implementation for UserManager resources"
- * @scr.property name="service.vendor" value="The Apache Software Foundation"
- * @scr.property name="provider.roots" value="/system/userManager/"
- * @scr.service interface="org.apache.sling.api.resource.ResourceProvider"
  */
+@Component (immediate=true, metatype=true,
+		label="%authorizable.resourceprovider.name",
+		description="%authorizable.resourceprovider.description")
+@Service (value=ResourceProvider.class)
+@Properties ({
+	@Property (name="service.description", 
+			value="Resource provider implementation for UserManager resources"),
+	@Property (name="service.vendor",
+			value="The Apache Software Foundation"),
+	@Property (name="provider.roots",
+			value="/system/userManager/")			
+})
 public class AuthorizableResourceProvider implements ResourceProvider {
 
     /**



Mime
View raw message