directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1513435 - in /directory/escimo/trunk: common/src/main/java/org/apache/directory/scim/json/ ldap/src/main/java/org/apache/directory/scim/ldap/ ldap/src/main/java/org/apache/directory/scim/ldap/schema/ ldap/src/main/resources/
Date Tue, 13 Aug 2013 10:51:44 GMT
Author: kayyagari
Date: Tue Aug 13 10:51:43 2013
New Revision: 1513435

URL: http://svn.apache.org/r1513435
Log:
added enterprise user extension

Modified:
    directory/escimo/trunk/common/src/main/java/org/apache/directory/scim/json/ResourceSerializer.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/ResourceSchema.java
    directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml

Modified: directory/escimo/trunk/common/src/main/java/org/apache/directory/scim/json/ResourceSerializer.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/common/src/main/java/org/apache/directory/scim/json/ResourceSerializer.java?rev=1513435&r1=1513434&r2=1513435&view=diff
==============================================================================
--- directory/escimo/trunk/common/src/main/java/org/apache/directory/scim/json/ResourceSerializer.java
(original)
+++ directory/escimo/trunk/common/src/main/java/org/apache/directory/scim/json/ResourceSerializer.java
Tue Aug 13 10:51:43 2013
@@ -30,7 +30,6 @@ import org.apache.directory.scim.SimpleA
 import org.apache.directory.scim.SimpleAttributeGroup;
 import org.apache.directory.scim.User;
 
-import com.google.gson.Gson;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonPrimitive;
@@ -43,8 +42,6 @@ import com.google.gson.JsonPrimitive;
  */
 public class ResourceSerializer
 {
-    private Gson gson = new Gson();
-
     public static final String CORE_URI = "urn:scim:schemas:core:1.0";
     
     public static String serialize( User user )

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java?rev=1513435&r1=1513434&r2=1513435&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapResourceProvider.java
Tue Aug 13 10:51:43 2013
@@ -230,7 +230,6 @@ public class LdapResourceProvider implem
 
     public User toUser( RequestContext ctx, Entry entry ) throws Exception
     {
-        Collection<BaseType> coreTypes = userSchema.getCoreAttributes();
 
         User user = new User();
 
@@ -243,7 +242,18 @@ public class LdapResourceProvider implem
         
         user.setId( ( String ) idAttribute.getValue() );
         
-        for ( BaseType bt : coreTypes )
+        _loadAttributes( ctx, entry, userSchema.getCoreTypes(), idType );
+        _loadAttributes( ctx, entry, userSchema.getExtendedTypes(), idType );
+        
+        return user;
+    }
+    
+    
+    private User _loadAttributes( RequestContext ctx, Entry entry, Collection<BaseType>
types, SimpleType idType ) throws Exception
+    {
+        User user = ctx.getUser();
+        
+        for ( BaseType bt : types )
         {
             if ( bt instanceof SimpleType )
             {

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/ResourceSchema.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/ResourceSchema.java?rev=1513435&r1=1513434&r2=1513435&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/ResourceSchema.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/ResourceSchema.java
Tue Aug 13 10:51:43 2013
@@ -22,6 +22,7 @@ package org.apache.directory.scim.ldap.s
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -97,9 +98,15 @@ public abstract class ResourceSchema
     }
 
 
-    public Collection<BaseType> getCoreAttributes()
+    public Collection<BaseType> getCoreTypes()
     {
-        return coreTypes.values();
+        return Collections.unmodifiableCollection( coreTypes.values() );
+    }
+
+
+    public Collection<BaseType> getExtendedTypes()
+    {
+        return Collections.unmodifiableCollection( extendedTypes.values() );
     }
 
 

Modified: directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml?rev=1513435&r1=1513434&r2=1513435&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml (original)
+++ directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml Tue Aug 13 10:51:43
2013
@@ -1,5 +1,6 @@
 <?xml version="1.0"?>
 <entities>
+    <!-- Core User resource schema -->
     <schema id="user-core" uri="urn:scim:schemas:core:1.0">
         <attribute name="id" mappedTo="entryUUID" />
         <attribute name="userName" mappedTo="uid" />
@@ -70,12 +71,40 @@
             </type>
         </multival-attribute>
 
-        <multival-attribute name="groups" basedDn="ou=system" filter="(uniqueMember =
$entryDn)" handlerRef="groupsHandler"/>
+        <multival-attribute name="groups" basedDn="ou=system"
+            filter="(uniqueMember = $entryDn)" handlerRef="groupsHandler" />
+
+        <multival-attribute name="entitlements" />
+
+        <multival-attribute name="roles" />
+
+        <multival-attribute name="x509Certificates">
+            <at-group>
+                <attribute name="value" mappedTo="userCertificate" />
+            </at-group>
+        </multival-attribute>
 
         <complex-attribute name="meta" handlerRef="metaHandler" />
 
     </schema>
 
+    <!-- Enterprise User resource schema -->
+    <schema id="enterprise-user" uri="urn:scim:schemas:extension:enterprise:1.0">
+        <attribute name="employeeNumber" mappedTo="" />
+        <attribute name="costCenter" mappedTo="" />
+        <attribute name="organization" mappedTo="" />
+        <attribute name="division" mappedTo="" />
+        <attribute name="department" mappedTo="" />
+
+        <complex-attribute name="manager">
+            <at-group>
+                <attribute name="managerId" mappedTo="" />
+                <attribute name="$ref" mappedTo="" />
+                <attribute name="displayName" mappedTo="" />
+            </at-group>
+        </complex-attribute>
+    </schema>
+
     <schema id="group" uri="urn:scim:schemas:core:1.0">
         <attribute name="displayName" mappedTo="cn" />
         <attribute name="id" mappedTo="entryUUID" />
@@ -94,12 +123,13 @@
 
     <userType basedDn="ou=system" filter="(objectClass = inetOrgPerson)">
         <schemaRef id="user-core" />
+        <schemaRef id="enterprise-user" />
     </userType>
 
     <groupType basedDn="ou=system" filter="(objectClass = inetOrgPerson)">
         <schemaRef id="group" />
     </groupType>
- 
+
     <atHandlers>
         <handler name="activeHandler"
             class="org.apache.directory.scim.ldap.handlers.ActiveAttributeHandler" />



Mime
View raw message