directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r813820 - /directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Date Fri, 11 Sep 2009 13:19:31 GMT
Author: elecharny
Date: Fri Sep 11 13:19:31 2009
New Revision: 813820

URL: http://svn.apache.org/viewvc?rev=813820&view=rev
Log:
Fixed some pb with the modify operation applied on schema

Modified:
    directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java

Modified: directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=813820&r1=813819&r2=813820&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
(original)
+++ directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
Fri Sep 11 13:19:31 2009
@@ -273,6 +273,8 @@
     }
 
     
+    
+    
     /**
      * {@inheritDoc}
      */
@@ -312,9 +314,20 @@
     @Override
     public void modify( ModifyOperationContext modifyContext ) throws Exception
     {
-        wrappedPartition.modify( modifyContext );
+        Long id = getEntryId( modifyContext.getDn().getNormName() );
+
+        wrappedPartition.modify( id, modifyContext.getModItems() );
+        
         // just overwrite the existing file
-        add( modifyContext.getEntry() );
+        LdapDN dn = modifyContext.getDn();
+        
+        // Get the modified entry
+        Entry modifiedEntry = wrappedPartition.lookup( id );
+        
+        // And write it back on disk
+        FileWriter fw = new FileWriter( getFile( dn, DELETE ) );
+        fw.write( LdifUtils.convertEntryToLdif( modifiedEntry ) );
+        fw.close();
     }
 
 
@@ -487,7 +500,7 @@
         if ( ldifFile.exists() && create )
         {
             // The entry already exists
-            throw new NamingException( "The entry already exsists" );
+            throw new NamingException( "The entry already exists" );
         }
         
         return ldifFile;



Mime
View raw message