directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1512881 - in /directory/escimo/trunk/ldap/src/main/java/org/apache/directory/scim/ldap: LdapResourceProvider.java schema/SimpleTypeGroup.java
Date Sun, 11 Aug 2013 06:37:54 GMT
Author: kayyagari
Date: Sun Aug 11 06:37:54 2013
New Revision: 1512881

URL: http://svn.apache.org/r1512881
Log:
handle the 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/schema/SimpleTypeGroup.java

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=1512881&r1=1512880&r2=1512881&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 Aug 11 06:37:54 2013
@@ -543,17 +543,32 @@ 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.getLstSTypes() )
         {
             SimpleAttribute at = getValueForSimpleType( st, entry );
             if ( at != null )
             {
                 lstAts.add( at );
+                
+                if( hasFormat )
+                {
+                    format = format.replaceAll( "\\$" + st.getName(), String.valueOf( at.getValue()
) );
+                }
             }
 
-            //TODO handle the format
         }
 
+        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/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=1512881&r1=1512880&r2=1512881&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 Aug 11 06:37:54 2013
@@ -39,6 +39,7 @@ public class SimpleTypeGroup
     public SimpleTypeGroup( List<SimpleType> lstSTypes, String format )
     {
         this.lstSTypes = lstSTypes;
+        this.format = format;
     }
 
 



Mime
View raw message