directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1538372 - in /directory/escimo/trunk/ldap/src/main: java/org/apache/directory/scim/ldap/ java/org/apache/directory/scim/ldap/schema/ resources/
Date Sun, 03 Nov 2013 15:08:58 GMT
Author: kayyagari
Date: Sun Nov  3 15:08:58 2013
New Revision: 1538372

URL: http://svn.apache.org/r1538372
Log:
o handled attributes parameter
o removed 'formatted' attribute

Modified:
    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/LdapSchemaMapper.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/MultiValType.java
    directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/SimpleTypeGroup.java
    directory/escimo/trunk/ldap/src/main/resources/escimo-ldap-mapping.xml

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=1538372&r1=1538371&r2=1538372&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
Sun Nov  3 15:08:58 2013
@@ -310,7 +310,24 @@ public class LdapResourceProvider implem
         sr.setBase( new Dn( scimSchema.getBaseDn() ) );
         sr.setFilter( ldapFilter );
         sr.setScope( SearchScope.SUBTREE );
-        sr.addAttributes( ALL_ATTRIBUTES_ARRAY );
+        
+        List<String> ldapAtNames = new ArrayList<String>();
+        ldapAtNames.add( SchemaConstants.ENTRY_UUID_AT );
+        
+        if( Strings.isNotEmpty( attributes ) )
+        {
+            String[] names = attributes.split( "," );
+            for( String n : names )
+            {
+                AttributeType at = getLdapType( n, scimSchema );
+                if( at != null )
+                {
+                    ldapAtNames.add( at.getName() );
+                }
+            }
+        }
+        
+        sr.addAttributes( ldapAtNames.toArray( new String[1] ) );
         
         SearchCursor cursor = connection.search( sr );
         
@@ -1127,34 +1144,17 @@ public class LdapResourceProvider implem
     {
         List<SimpleAttribute> lstAts = new ArrayList<SimpleAttribute>();
 
-        // format="$givenName $familyName"
-        boolean hasFormat = !Strings.isEmpty( stg.getFormat() );
-
-        String format = stg.getFormat();
-
         for ( SimpleType st : stg.getSubTypes() )
         {
             SimpleAttribute at = getValueForSimpleType( st, entry );
             if ( at != null )
             {
                 lstAts.add( at );
-
-                if ( hasFormat )
-                {
-                    format = format.replaceAll( "\\$" + st.getName(), String.valueOf( at.getValue()
) );
-                }
             }
 
         }
 
-        if ( hasFormat )
-        {
-            SimpleAttribute atFormat = new SimpleAttribute( "formatted", format );
-            lstAts.add( atFormat );
-        }
-
         return lstAts;
-
     }
 
 

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java?rev=1538372&r1=1538371&r2=1538372&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/LdapSchemaMapper.java
Sun Nov  3 15:08:58 2013
@@ -368,17 +368,9 @@ public class LdapSchemaMapper implements
                 }
             }
 
-            String format = null;
-
-            Element elmFormat = elmAtGroup.element( "formatted" );
-            if ( elmFormat != null )
-            {
-                format = elmFormat.attributeValue( "format" );
-            }
-
             if ( !lstSTypes.isEmpty() )
             {
-                stg = new SimpleTypeGroup( lstSTypes, format );
+                stg = new SimpleTypeGroup( lstSTypes );
             }
         }
 

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/MultiValType.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/MultiValType.java?rev=1538372&r1=1538371&r2=1538372&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/MultiValType.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/MultiValType.java
Sun Nov  3 15:08:58 2013
@@ -36,10 +36,6 @@ public class MultiValType extends BaseTy
 
     private String filter;
 
-    /** used for setting the value of "formatted" attribute */
-    private String format;
-
-
     public MultiValType( String uri, String name, boolean show, SimpleTypeGroup atGroup,
String baseDn, String filter )
     {
         super( uri, name, show );
@@ -76,15 +72,6 @@ public class MultiValType extends BaseTy
     }
 
 
-    /**
-     * @return the format
-     */
-    public String getFormat()
-    {
-        return format;
-    }
-
-
     @Override
     public boolean isComplex()
     {

Modified: directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/SimpleTypeGroup.java
URL: http://svn.apache.org/viewvc/directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/SimpleTypeGroup.java?rev=1538372&r1=1538371&r2=1538372&view=diff
==============================================================================
--- directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/SimpleTypeGroup.java
(original)
+++ directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap/schema/SimpleTypeGroup.java
Sun Nov  3 15:08:58 2013
@@ -33,23 +33,9 @@ public class SimpleTypeGroup
 {
     private List<SimpleType> subTypes;
 
-    /** used for setting the value of "formatted" attribute */
-    private String format;
-
-
-    public SimpleTypeGroup( List<SimpleType> subTypes, String format )
+    public SimpleTypeGroup( List<SimpleType> subTypes )
     {
         this.subTypes = subTypes;
-        this.format = format;
-    }
-
-
-    /**
-     * @return the format
-     */
-    public String getFormat()
-    {
-        return format;
     }
 
 
@@ -87,13 +73,10 @@ public class SimpleTypeGroup
     }
 
 
-    /* (non-Javadoc)
-     * @see java.lang.Object#toString()
-     */
     @Override
     public String toString()
     {
-        return "SimpleTypeGroup [subTypes=" + subTypes + ", format=" + format + "]";
+        return "SimpleTypeGroup [subTypes=" + subTypes + "]";
     }
 
 }

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=1538372&r1=1538371&r2=1538372&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 Sun Nov  3 15:08:58
2013
@@ -22,7 +22,6 @@
                 <attribute name="middleName" mappedTo="" />
                 <attribute name="honorificPrefix" mappedTo="title" />
                 <attribute name="honorificSuffix" mappedTo="" />
-                <formatted format="$givenName $familyName" />
             </at-group>
         </complex-attribute>
 



Mime
View raw message