This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag 
org.apache.sling.jcr.jackrabbit.usermanager-2.2.2
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-jackrabbit-usermanager.git

commit 6bf3da362e2dd3e142deda18ddeb2818bbc9f06b
Author: Justin Edelson <[email protected]>
AuthorDate: Fri Dec 2 03:08:39 2011 +0000

    SLING-2312 - adding adapter annotations in usermanager bundle
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/bundles/jcr/jackrabbit-usermanager@1209347
 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                              | 20 ++++++++++++++++++++
 .../impl/resource/AuthorizableResource.java          |  7 +++++++
 2 files changed, 27 insertions(+)

diff --git a/pom.xml b/pom.xml
index 7f4a388..3441791 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,20 @@
                 <artifactId>maven-scr-plugin</artifactId>
             </plugin>
             <plugin>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>maven-sling-plugin</artifactId>
+                <version>2.0.7-SNAPSHOT</version>
+                <executions>
+                    <execution>
+                        <id>generate-adapter-metadata</id>
+                        <phase>process-classes</phase>
+                        <goals>
+                            <goal>generate-adapter-metadata</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
@@ -132,6 +146,12 @@
             <version>1.6.0</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>adapter-annotations</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <scope>provided</scope>
+        </dependency>
 
     </dependencies>
 </project>
\ No newline at end of file
diff --git 
a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
 
b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
index b7e2790..fad6c38 100644
--- 
a/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
+++ 
b/src/main/java/org/apache/sling/jackrabbit/usermanager/impl/resource/AuthorizableResource.java
@@ -23,6 +23,8 @@ import javax.jcr.RepositoryException;
 import org.apache.jackrabbit.api.security.user.Authorizable;
 import org.apache.jackrabbit.api.security.user.Group;
 import org.apache.jackrabbit.api.security.user.User;
+import org.apache.sling.adapter.annotations.Adaptable;
+import org.apache.sling.adapter.annotations.Adapter;
 import org.apache.sling.api.resource.AbstractResource;
 import org.apache.sling.api.resource.Resource;
 import org.apache.sling.api.resource.ResourceMetadata;
@@ -32,6 +34,11 @@ import org.apache.sling.api.resource.ValueMap;
 /**
  * Resource implementation for Authorizable
  */
+@Adaptable(adaptableClass = Resource.class, adapters = {
+    @Adapter({Map.class, ValueMap.class, Authorizable.class}),
+    @Adapter(condition="If the resource is an AuthorizableResource and 
represents a JCR User", value = User.class),
+    @Adapter(condition="If the resource is an AuthorizableResource and 
represents a JCR Group", value = Group.class)
+})
 public class AuthorizableResource extends AbstractResource implements Resource 
{
     private Authorizable authorizable = null;
 

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to