You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2010/10/27 22:30:03 UTC

svn commit: r1028087 - in /directory/apacheds/branches/apacheds-config: core/src/main/java/org/apache/directory/server/core/partition/ jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ server-config/src/main/java/...

Author: elecharny
Date: Wed Oct 27 20:30:03 2010
New Revision: 1028087

URL: http://svn.apache.org/viewvc?rev=1028087&view=rev
Log:
o Added the SchemaManager into the System partition instance
o Fixed the ContextEntry parsing
o Avoid a call to the testEntries loader if it's null

Modified:
    directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
    directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java

Modified: directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?rev=1028087&r1=1028086&r2=1028087&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-config/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java Wed Oct 27 20:30:03 2010
@@ -38,9 +38,7 @@ import javax.naming.directory.SearchCont
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.CoreSession;
 import org.apache.directory.server.core.DNFactory;
-import org.apache.directory.server.core.DefaultCoreSession;
 import org.apache.directory.server.core.DirectoryService;
-import org.apache.directory.server.core.LdapPrincipal;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.filtering.BaseEntryFilteringCursor;
 import org.apache.directory.server.core.filtering.CursorList;
@@ -72,7 +70,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.search.controls.pagedSearch.PagedResultsControl;
 import org.apache.directory.shared.ldap.codec.search.controls.persistentSearch.PersistentSearchControl;
 import org.apache.directory.shared.ldap.codec.search.controls.subentries.SubentriesControl;
-import org.apache.directory.shared.ldap.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.cursor.EmptyCursor;
 import org.apache.directory.shared.ldap.cursor.SingletonCursor;
@@ -294,6 +291,7 @@ public class DefaultPartitionNexus exten
             // TODO : we have to deal with this case !
         }
 
+        system.setSchemaManager( schemaManager );
         system.initialize();
 
         // Add root context entry for system partition

Modified: directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java?rev=1028087&r1=1028086&r2=1028087&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/apacheds-config/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java Wed Oct 27 20:30:03 2010
@@ -171,7 +171,7 @@ public class JdbmIndex<K, O> implements 
             this.wkDirPath = wkDirPath;
         }
 
-        File file = new File( this.wkDirPath.getPath() + File.separator + attribute.getOid() );
+        File file = new File( this.wkDirPath, attribute.getOid() );
         String path = file.getAbsolutePath();
         BaseRecordManager base = new BaseRecordManager( path );
         base.disableTransactions();
@@ -189,7 +189,7 @@ public class JdbmIndex<K, O> implements 
         }
 
         // finally write a text file in the format <OID>-<attribute-name>.txt
-        FileWriter fw = new FileWriter( new File( this.wkDirPath.getPath() + File.separator + attribute.getOid() + "-" + attribute.getName() + ".txt" ) );
+        FileWriter fw = new FileWriter( new File( this.wkDirPath.getPath(), attribute.getOid() + "-" + attribute.getName() + ".txt" ) );
         // write the AttributeType description
         fw.write( attribute.toString() );
         fw.close();

Modified: directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java?rev=1028087&r1=1028086&r2=1028087&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java (original)
+++ directory/apacheds/branches/apacheds-config/server-config/src/main/java/org/apache/directory/server/config/ConfigBuilder.java Wed Oct 27 20:30:03 2010
@@ -920,11 +920,11 @@ public class ConfigBuilder
             try
             {
                 // Replace '\n' to real LF
-                contextEntry.replaceAll( "\\n", "\n" );
+                String entryStr = contextEntry.replaceAll( "\\\\n", "\n" );
                 
                 LdifReader ldifReader = new LdifReader();
                 
-                List<LdifEntry> entries = ldifReader.parseLdif( contextEntry );
+                List<LdifEntry> entries = ldifReader.parseLdif( entryStr );
                 
                 if ( ( entries != null ) && ( entries.size() > 0 ) )
                 {
@@ -1063,7 +1063,11 @@ public class ConfigBuilder
 
         // testEntries
         String entryFilePath = directoryServiceBean.getDsTestEntries();
-        directoryService.setTestEntries( readTestEntries( entryFilePath ) );
+        
+        if ( entryFilePath != null )
+        {
+            directoryService.setTestEntries( readTestEntries( entryFilePath ) );
+        }
         
         // Enabled
         if ( !directoryServiceBean.isEnabled() )