You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2006/12/31 18:05:19 UTC

svn commit: r491444 - in /directory/branches/trunks/schema: apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/ apacheds/core/src/main/java/org/apache/directory/server/core/ apacheds/core/src/main/java/org/apache/...

Author: akarasulu
Date: Sun Dec 31 09:05:18 2006
New Revision: 491444

URL: http://svn.apache.org/viewvc?view=rev&rev=491444
Log:
fixed bug where all STRUCTURAL objectClasses were being set as ABSTRACT

Modified:
    directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
    directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoaderTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
    directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
    directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaComparatorProducer.java
    directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
    directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java
    directory/branches/trunks/schema/apacheds/schema-extras/src/test/java/org/apache/directory/server/schema/bootstrap/ExtraSchemaLoadTest.java
    directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java
    directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java
    directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
    directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
    directory/branches/trunks/schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClassTypeEnum.java

Modified: directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java (original)
+++ directory/branches/trunks/schema/apacheds/bootstrap-plugin/src/main/java/org/apache/directory/server/core/bootstrap/plugin/BootstrapPlugin.java Sun Dec 31 09:05:18 2006
@@ -553,7 +553,7 @@
         getLog().info( "" );
         
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
         try
         {
             loader.loadWithDependencies( schemas.values(), registries );

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Sun Dec 31 09:05:18 2006
@@ -36,6 +36,7 @@
 import org.apache.directory.server.core.configuration.Configuration;
 import org.apache.directory.server.core.configuration.ConfigurationException;
 import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
+import org.apache.directory.server.core.configuration.PartitionConfiguration;
 import org.apache.directory.server.core.configuration.StartupConfiguration;
 import org.apache.directory.server.core.interceptor.InterceptorChain;
 import org.apache.directory.server.core.jndi.AbstractContextFactory;
@@ -47,6 +48,7 @@
 import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
 import org.apache.directory.server.core.schema.PartitionSchemaLoader;
 import org.apache.directory.server.core.schema.SchemaManager;
+import org.apache.directory.server.core.schema.SchemaPartitionDao;
 import org.apache.directory.server.schema.SerializableComparator;
 import org.apache.directory.server.schema.bootstrap.ApacheSchema;
 import org.apache.directory.server.schema.bootstrap.ApachemetaSchema;
@@ -755,7 +757,7 @@
 
         // setup temporary loader and temp registry 
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
         
         // load essential bootstrap schemas 
         Set<Schema> bootstrapSchemas = new HashSet<Schema>();
@@ -814,11 +816,58 @@
         schemaPartitionConfig.setContextPartition( schemaPartition );
 
         // --------------------------------------------------------------------
+        // Enable schemas of all indices of partition configurations 
+        // --------------------------------------------------------------------
+
+        /*
+         * We need to make sure that every attribute indexed by a partition is
+         * loaded into the registries on the next step.  So here we must enable
+         * the schemas of those attributes so they are loaded into the global
+         * registries.
+         */
+        
+        SchemaPartitionDao dao = new SchemaPartitionDao( schemaPartition, registries );
+        Map<String,Schema> schemaMap = dao.getSchemas();
+        PartitionConfiguration pc = startupConfiguration.getSystemPartitionConfiguration();
+        Set<PartitionConfiguration> pcs = new HashSet<PartitionConfiguration>();
+        if ( pc != null )
+        {
+            pcs.add( pc );
+        }
+        else
+        {
+            log.warn( "Encountered null configuration." );
+        }
+            
+        
+        pcs.addAll( startupConfiguration.getPartitionConfigurations() );
+        
+        for ( PartitionConfiguration pconf : pcs )
+        {
+            Iterator indices = pconf.getIndexedAttributes().iterator();
+            while ( indices.hasNext() )
+            {
+                Object indexedAttr = indices.next();
+                String schemaName = dao.findSchema( indexedAttr.toString() );
+                if ( schemaName == null )
+                {
+                    throw new NamingException( "Index on unidentified attribute" );
+                }
+                
+                Schema schema = schemaMap.get( schemaName );
+                if ( schema.isDisabled() )
+                {
+                    dao.enableSchema( schemaName );
+                }
+            }
+        }
+        
+        // --------------------------------------------------------------------
         // Initialize schema subsystem and reset registries
         // --------------------------------------------------------------------
         
         PartitionSchemaLoader schemaLoader = new PartitionSchemaLoader( schemaPartition, registries );
-        Registries globalRegistries = new DefaultRegistries( schemaLoader );
+        Registries globalRegistries = new DefaultRegistries( "global", schemaLoader );
         schemaLoader.loadEnabled( globalRegistries );
         registries = globalRegistries;
         SerializableComparator.setRegistry( globalRegistries.getComparatorRegistry() );
@@ -868,6 +917,7 @@
         while ( list.hasNext() )
         {
             AttributeType type = ( AttributeType ) list.next();
+            
             if ( !type.getSyntax().isHumanReadible() )
             {
                 // add the OID for the attributeType

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java Sun Dec 31 09:05:18 2006
@@ -232,7 +232,7 @@
     /**
      * Returns {@link PartitionConfiguration}s to configure context partitions.
      */
-    public Set getPartitionConfigurations()
+    public Set<PartitionConfiguration> getPartitionConfigurations()
     {
         return ConfigurationUtil.getClonedSet( partitionConfigurations );
     }

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Sun Dec 31 09:05:18 2006
@@ -184,7 +184,7 @@
      * <a href="http://java.sun.com/j2se/1.4.2/docs/api/
      * javax/naming/directory/SearchResult.html">SearchResult</a>.
      */
-    NamingEnumeration search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
+    NamingEnumeration<SearchResult> search( LdapDN baseName, Map environment, ExprNode filter, SearchControls searchControls )
         throws NamingException;
 
 

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java Sun Dec 31 09:05:18 2006
@@ -39,17 +39,7 @@
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.AbstractSchemaLoader;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
-import org.apache.directory.server.schema.registries.ComparatorRegistry;
-import org.apache.directory.server.schema.registries.DITContentRuleRegistry;
-import org.apache.directory.server.schema.registries.DITStructureRuleRegistry;
-import org.apache.directory.server.schema.registries.MatchingRuleRegistry;
-import org.apache.directory.server.schema.registries.MatchingRuleUseRegistry;
-import org.apache.directory.server.schema.registries.NameFormRegistry;
-import org.apache.directory.server.schema.registries.NormalizerRegistry;
-import org.apache.directory.server.schema.registries.ObjectClassRegistry;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.server.schema.registries.SyntaxCheckerRegistry;
-import org.apache.directory.server.schema.registries.SyntaxRegistry;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.Normalizer;
@@ -79,23 +69,23 @@
     private AttributeTypeRegistry attrRegistry;
 
     
-    public PartitionSchemaLoader( Partition partition, Registries bootstrapRegiistries ) throws NamingException
+    public PartitionSchemaLoader( Partition partition, Registries bootstrapRegistries ) throws NamingException
     {
-        this.factory = new SchemaEntityFactory( bootstrapRegiistries );
+        this.factory = new SchemaEntityFactory( bootstrapRegistries );
         this.partition = partition;
-        this.attrRegistry = bootstrapRegiistries.getAttributeTypeRegistry();
+        this.attrRegistry = bootstrapRegistries.getAttributeTypeRegistry();
         
-        dao = new SchemaPartitionDao( this.partition, bootstrapRegiistries );
+        dao = new SchemaPartitionDao( this.partition, bootstrapRegistries );
     }
     
     
     /**
      * Utility method to load all enabled schemas into this registry.
      * 
-     * @param registries
+     * @param targetRegistries
      * @throws NamingException
      */
-    public void loadEnabled( Registries registries ) throws NamingException
+    public void loadEnabled( Registries targetRegistries ) throws NamingException
     {
         Map<String, Schema> allSchemaMap = getSchemas();
         Set<Schema> enabledSchemaSet = new HashSet<Schema>();
@@ -113,7 +103,7 @@
             }
         }
 
-        loadWithDependencies( enabledSchemaSet, registries );
+        loadWithDependencies( enabledSchemaSet, targetRegistries );
     }
 
     
@@ -141,7 +131,7 @@
     }
 
 
-    public final void loadWithDependencies( Collection<Schema> schemas, Registries registries ) throws NamingException
+    public final void loadWithDependencies( Collection<Schema> schemas, Registries targetRegistries ) throws NamingException
     {
         HashMap<String,Schema> notLoaded = new HashMap<String,Schema>();
         Iterator<Schema> list = schemas.iterator();
@@ -156,15 +146,15 @@
         while ( list.hasNext() )
         {
             Schema schema = ( Schema ) list.next();
-            loadDepsFirst( new Stack<String>(), notLoaded, schema, registries, null );
+            loadDepsFirst( new Stack<String>(), notLoaded, schema, targetRegistries, null );
             list = notLoaded.values().iterator();
         }
     }
 
 
-    public final void load( Schema schema, Registries registries ) throws NamingException
+    public final void load( Schema schema, Registries targetRegistries ) throws NamingException
     {
-        if ( registries.getLoadedSchemas().containsKey( schema.getSchemaName() ) )
+        if ( targetRegistries.getLoadedSchemas().containsKey( schema.getSchemaName() ) )
         {
             log.debug( "schema {} already seems to be loaded", schema.getSchemaName() );
             return;
@@ -172,54 +162,54 @@
         
         log.info( "loading {} schema ...", schema.getSchemaName() );
         
-        loadComparators( schema, registries.getComparatorRegistry() );
-        loadNormalizers( schema, registries.getNormalizerRegistry() );
-        loadSyntaxCheckers( schema, registries.getSyntaxCheckerRegistry() );
-        loadSyntaxes( schema, registries.getSyntaxRegistry() );
-        loadMatchingRules( schema, registries.getMatchingRuleRegistry() );
-        loadAttributeTypes( schema, registries.getAttributeTypeRegistry() );
-        loadObjectClasses( schema, registries.getObjectClassRegistry() );
-        loadMatchingRuleUses( schema, registries.getMatchingRuleUseRegistry() );
-        loadDitContentRules( schema, registries.getDitContentRuleRegistry() );
-        loadNameForms( schema, registries.getNameFormRegistry() );
+        loadComparators( schema, targetRegistries );
+        loadNormalizers( schema, targetRegistries );
+        loadSyntaxCheckers( schema, targetRegistries );
+        loadSyntaxes( schema, targetRegistries );
+        loadMatchingRules( schema, targetRegistries );
+        loadAttributeTypes( schema, targetRegistries );
+        loadObjectClasses( schema, targetRegistries );
+        loadMatchingRuleUses( schema, targetRegistries );
+        loadDitContentRules( schema, targetRegistries );
+        loadNameForms( schema, targetRegistries );
         
         // order does matter here so some special trickery is needed
         // we cannot load a DSR before the DSRs it depends on are loaded?
         // TODO need ot confirm this ( or we must make the class for this and use deferred 
         // resolution until everything is available?
         
-        loadDitStructureRules( schema, registries.getDitStructureRuleRegistry() );
+        loadDitStructureRules( schema, targetRegistries );
         
         
-        notifyListenerOrRegistries( schema, registries );
+        notifyListenerOrRegistries( schema, targetRegistries );
     }
 
     
-    private void loadMatchingRuleUses( Schema schema, MatchingRuleUseRegistry matchingRuleUseRegistry )
+    private void loadMatchingRuleUses( Schema schema, Registries targetRegistries )
     {
         // TODO Auto-generated method stub
     }
 
 
-    private void loadDitStructureRules( Schema schema, DITStructureRuleRegistry registry ) throws NamingException
+    private void loadDitStructureRules( Schema schema, Registries targetRegistries ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    private void loadNameForms( Schema schema, NameFormRegistry registry ) throws NamingException
+    private void loadNameForms( Schema schema, Registries targetRegistries ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    private void loadDitContentRules( Schema schema, DITContentRuleRegistry registry ) throws NamingException
+    private void loadDitContentRules( Schema schema, Registries targetRegistries ) throws NamingException
     {
         // TODO Auto-generated method stub
     }
 
 
-    private void loadObjectClasses( Schema schema, ObjectClassRegistry registry ) throws NamingException
+    private void loadObjectClasses( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=objectClasses,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -238,13 +228,13 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            ObjectClass oc = factory.getObjectClass( attrs );
-            registry.register( schema.getSchemaName(), oc );
+            ObjectClass oc = factory.getObjectClass( attrs, targetRegistries );
+            targetRegistries.getObjectClassRegistry().register( schema.getSchemaName(), oc );
         }
     }
 
 
-    private void loadAttributeTypes( Schema schema, AttributeTypeRegistry registry ) throws NamingException
+    private void loadAttributeTypes( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=attributeTypes,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -263,13 +253,13 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            AttributeType at = factory.getAttributeType( attrs );
-            registry.register( schema.getSchemaName(), at );
+            AttributeType at = factory.getAttributeType( attrs, targetRegistries );
+            targetRegistries.getAttributeTypeRegistry().register( schema.getSchemaName(), at );
         }
     }
 
 
-    private void loadMatchingRules( Schema schema, MatchingRuleRegistry registry ) throws NamingException
+    private void loadMatchingRules( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=matchingRules,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -288,14 +278,14 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            MatchingRule mrule = factory.getMatchingRule( attrs );
-            registry.register( schema.getSchemaName(), mrule );
+            MatchingRule mrule = factory.getMatchingRule( attrs, targetRegistries );
+            targetRegistries.getMatchingRuleRegistry().register( schema.getSchemaName(), mrule );
 
         }
     }
 
 
-    private void loadSyntaxes( Schema schema, SyntaxRegistry registry ) throws NamingException
+    private void loadSyntaxes( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=syntaxes,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -314,13 +304,13 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            Syntax syntax = factory.getSyntax( attrs );
-            registry.register( schema.getSchemaName(), syntax );
+            Syntax syntax = factory.getSyntax( attrs, targetRegistries );
+            targetRegistries.getSyntaxRegistry().register( schema.getSchemaName(), syntax );
         }
     }
 
 
-    private void loadSyntaxCheckers( Schema schema, SyntaxCheckerRegistry registry ) throws NamingException
+    private void loadSyntaxCheckers( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=syntaxCheckers,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -339,13 +329,13 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            SyntaxChecker sc = factory.getSyntaxChecker( attrs );
-            registry.register( schema.getSchemaName(), sc.getSyntaxOid(), sc );
+            SyntaxChecker sc = factory.getSyntaxChecker( attrs, targetRegistries );
+            targetRegistries.getSyntaxCheckerRegistry().register( schema.getSchemaName(), sc.getSyntaxOid(), sc );
         }
     }
 
 
-    private void loadNormalizers( Schema schema, NormalizerRegistry registry ) throws NamingException
+    private void loadNormalizers( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=normalizers,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -364,14 +354,14 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            Normalizer normalizer = factory.getNormalizer( attrs );
+            Normalizer normalizer = factory.getNormalizer( attrs, targetRegistries );
             String oid = ( String ) attrs.get( "m-oid" ).get();
-            registry.register( schema.getSchemaName(), oid, normalizer );
+            targetRegistries.getNormalizerRegistry().register( schema.getSchemaName(), oid, normalizer );
         }
     }
 
 
-    private void loadComparators( Schema schema, ComparatorRegistry registry ) throws NamingException
+    private void loadComparators( Schema schema, Registries targetRegistries ) throws NamingException
     {
         LdapDN dn = new LdapDN( "ou=comparators,cn=" + schema.getSchemaName() + ",ou=schema" );
         dn.normalize( this.attrRegistry.getNormalizerMapping() );
@@ -390,9 +380,9 @@
             LdapDN resultDN = new LdapDN( result.getName() );
             resultDN.normalize( attrRegistry.getNormalizerMapping() );
             Attributes attrs = partition.lookup( resultDN );
-            Comparator comparator = factory.getComparator( attrs );
+            Comparator comparator = factory.getComparator( attrs, targetRegistries );
             String oid = ( String ) attrs.get( "m-oid" ).get();
-            registry.register( schema.getSchemaName(), oid, comparator );
+            targetRegistries.getComparatorRegistry().register( schema.getSchemaName(), oid, comparator );
         }
     }
 

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaChecker.java Sun Dec 31 09:05:18 2006
@@ -666,6 +666,7 @@
      * @return the set of attributes composing the Rdn for the name
      * @throws NamingException if the syntax of the Rdn is incorrect
      */
+    @SuppressWarnings("unchecked")
     private static Set getRdnAttributes( Name name ) throws NamingException
     {
         String[] comps = NamespaceTools.getCompositeComponents( name.get( name.size() - 1 ) );

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaEntityFactory.java Sun Dec 31 09:05:18 2006
@@ -55,19 +55,19 @@
     private static final String[] EMPTY = new String[0];
     
     /** Used for dependency injection of Registries via setter into schema objects */
-    private final Registries registries;
+    private final Registries bootstrapRegistries;
     /** A special ClassLoader that loads a class from the bytecode attribute */
     private final AttributeClassLoader classLoader;
     private final AttributeType oidAT;
     private AttributeType byteCodeAT;
     
     
-    public SchemaEntityFactory( Registries registries ) throws NamingException
+    public SchemaEntityFactory( Registries bootstrapRegistries ) throws NamingException
     {
-        this.registries = registries;
+        this.bootstrapRegistries = bootstrapRegistries;
         this.classLoader = new AttributeClassLoader();
-        this.oidAT = registries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_OID_AT );
-        this.byteCodeAT = registries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
+        this.oidAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_OID_AT );
+        this.byteCodeAT = bootstrapRegistries.getAttributeTypeRegistry().lookup( MetaSchemaConstants.M_BYTECODE_AT );
     }
 
     
@@ -125,7 +125,7 @@
      * @return the loaded SyntaxChecker
      * @throws NamingException if anything fails during loading
      */
-    public SyntaxChecker getSyntaxChecker( Attributes entry ) throws NamingException
+    public SyntaxChecker getSyntaxChecker( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         if ( entry == null )
         {
@@ -203,7 +203,7 @@
         }
 
         // try now before returning to check if we can inject a Registries object
-        injectRegistries( syntaxChecker );
+        injectRegistries( syntaxChecker, targetRegistries );
         String syntaxOid = ( String ) ServerUtils.getAttribute( oidAT, entry ).get();
         injectOid( syntaxOid, syntaxChecker );
         return syntaxChecker;
@@ -217,7 +217,7 @@
      * @return the loaded Comparator
      * @throws NamingException if anything fails during loading
      */
-    public Comparator getComparator( Attributes entry ) throws NamingException
+    public Comparator getComparator( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         if ( entry == null )
         {
@@ -294,7 +294,7 @@
         }
 
         // try now before returning to check if we can inject a Registries object
-        injectRegistries( comparator );
+        injectRegistries( comparator, targetRegistries );
         return comparator;
     }
     
@@ -306,7 +306,7 @@
      * @return the loaded Normalizer
      * @throws NamingException if anything fails during loading
      */
-    public Normalizer getNormalizer( Attributes entry ) throws NamingException
+    public Normalizer getNormalizer( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         if ( entry == null )
         {
@@ -383,7 +383,7 @@
         }
 
         // try now before returning to check if we can inject a Registries object
-        injectRegistries( normalizer );
+        injectRegistries( normalizer, targetRegistries );
         return normalizer;
     }
     
@@ -395,7 +395,7 @@
      * 
      * @param obj a schema object to have a Registries dependency injected.
      */
-    private void injectRegistries( Object obj ) throws NamingException
+    private void injectRegistries( Object obj, Registries targetRegistries ) throws NamingException
     {
         String className = obj.getClass().getName();
         
@@ -408,7 +408,7 @@
                 return;
             }
             
-            Object[] args = new Object[] { this.registries };
+            Object[] args = new Object[] { this.bootstrapRegistries };
             method.invoke( obj, args );
         }
         catch ( SecurityException e )
@@ -504,10 +504,10 @@
     }
 
 
-    public Syntax getSyntax( Attributes entry ) throws NamingException
+    public Syntax getSyntax( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
-        SyntaxImpl syntax = new SyntaxImpl( oid, registries.getSyntaxCheckerRegistry() );
+        SyntaxImpl syntax = new SyntaxImpl( oid, targetRegistries.getSyntaxCheckerRegistry() );
         
         if ( entry.get( MetaSchemaConstants.X_HUMAN_READIBLE_AT ) != null )
         {
@@ -524,11 +524,11 @@
     }
 
     
-    public MatchingRule getMatchingRule( Attributes entry ) throws NamingException
+    public MatchingRule getMatchingRule( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
         String syntaxOid = ( String ) entry.get( MetaSchemaConstants.M_SYNTAX_AT ).get();
-        MatchingRuleImpl mr = new MatchingRuleImpl( oid, syntaxOid, registries );
+        MatchingRuleImpl mr = new MatchingRuleImpl( oid, syntaxOid, targetRegistries );
         setSchemaObjectProperties( mr, entry );
         return mr;
     }
@@ -550,10 +550,16 @@
     }
     
     
-    public ObjectClass getObjectClass( Attributes entry ) throws NamingException
+    public ObjectClass getObjectClass( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
-        ObjectClassImpl oc = new ObjectClassImpl( oid, registries );
+        
+        if ( oid.equals( "2.5.6.5" ) )
+        {
+            System.out.println( "got objectClass for organizationalUnit" );
+        }
+        
+        ObjectClassImpl oc = new ObjectClassImpl( oid, targetRegistries );
         
         if ( entry.get( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) != null )
         {
@@ -586,10 +592,10 @@
     }
     
     
-    public AttributeType getAttributeType( Attributes entry ) throws NamingException
+    public AttributeType getAttributeType( Attributes entry, Registries targetRegistries ) throws NamingException
     {
         String oid = ( String ) entry.get( MetaSchemaConstants.M_OID_AT ).get();
-        AttributeTypeImpl at = new AttributeTypeImpl( oid, registries );
+        AttributeTypeImpl at = new AttributeTypeImpl( oid, targetRegistries );
         setSchemaObjectProperties( at, entry );
         
         if ( entry.get( MetaSchemaConstants.M_SYNTAX_AT ) != null )

Modified: directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartitionDao.java Sun Dec 31 09:05:18 2006
@@ -28,18 +28,27 @@
 
 import javax.naming.NamingEnumeration;
 import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.ModificationItem;
 import javax.naming.directory.SearchControls;
 import javax.naming.directory.SearchResult;
 
+import org.apache.directory.server.constants.MetaSchemaConstants;
+import org.apache.directory.server.constants.SystemSchemaConstants;
+import org.apache.directory.server.core.ServerUtils;
 import org.apache.directory.server.core.partition.Partition;
 import org.apache.directory.server.schema.bootstrap.Schema;
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.OidRegistry;
 import org.apache.directory.server.schema.registries.Registries;
-import org.apache.directory.shared.ldap.NotImplementedException;
 import org.apache.directory.shared.ldap.filter.ExprNode;
 import org.apache.directory.shared.ldap.filter.SimpleNode;
+import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.name.Rdn;
+import org.apache.directory.shared.ldap.schema.AttributeType;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -63,6 +72,10 @@
     private final OidRegistry oidRegistry;
     private final AttributeTypeRegistry attrRegistry;
     
+    private final String M_NAME_OID;
+    private final String CN_OID;
+    
+    private final AttributeType disabledAttributeType;
     
     /**
      * Creates a schema dao object backing information within a schema partition.
@@ -77,6 +90,10 @@
         this.factory = new SchemaEntityFactory( this.bootstrapRegistries );
         this.oidRegistry = this.bootstrapRegistries.getOidRegistry();
         this.attrRegistry = this.bootstrapRegistries.getAttributeTypeRegistry();
+        
+        this.M_NAME_OID = oidRegistry.getOid( MetaSchemaConstants.M_NAME_AT );
+        this.CN_OID = oidRegistry.getOid( SystemSchemaConstants.CN_AT );
+        this.disabledAttributeType = attrRegistry.lookup( MetaSchemaConstants.M_DISABLED_AT );
     }
     
     
@@ -116,7 +133,6 @@
         ExprNode filter = new SimpleNode( oidRegistry.getOid( "objectClass" ), "metaSchema", SimpleNode.EQUALITY );
         SearchControls searchControls = new SearchControls();
         searchControls.setSearchScope( SearchControls.ONELEVEL_SCOPE );
-        
         return partition.search( base, new HashMap(), filter, searchControls );
     }
 
@@ -131,12 +147,88 @@
 
     public Schema getSchema( String schemaName, Properties schemaProperties ) throws NamingException
     {
-        return getSchema( schemaName );
+        return getSchema( schemaName ); 
     }
     
     
-    public String getSchemaNameForAttribute( String attributeName ) throws NamingException
+    /**
+     * Given the non-normalized name (alias) for a schema entity.  This method 
+     * finds the schema under which that entity is located. 
+     * 
+     * NOTE: this method presumes that all alias names across schemas are unique.  
+     * This should be the case for LDAP but this can potentially be violated so 
+     * we should make sure this is a unique name.
+     * 
+     * @param entityName one of the names of the entity 
+     * @return the name of the schema that contains that entity or null if no entity with 
+     * that alias name exists
+     * @throws NamingException if more than one entity has the name, or if there 
+     * are underlying data access problems
+     */
+    public String findSchema( String entityName ) throws NamingException
     {
-        throw new NotImplementedException();
+        SimpleNode filter = new SimpleNode( M_NAME_OID, entityName.toLowerCase(), SimpleNode.EQUALITY );
+        SearchControls searchControls = new SearchControls();
+        searchControls.setSearchScope( SearchControls.SUBTREE_SCOPE );
+        NamingEnumeration<SearchResult> ne = null;
+        
+        try
+        {
+            ne = partition.search( partition.getSuffix(), new HashMap(), filter, searchControls );
+            
+            if ( ! ne.hasMore() )
+            {
+                return null;
+            }
+            
+            SearchResult sr = ne.next();
+            if ( ne.hasMore() )
+            {
+                throw new NamingException( "Got more than one result for the entity name: " + entityName );
+            }
+
+            LdapDN dn = new LdapDN( sr.getName() );
+            dn.normalize( attrRegistry.getNormalizerMapping() );
+            Rdn rdn = dn.getRdn( 1 );
+            if ( ! rdn.getType().equalsIgnoreCase( CN_OID ) )
+            {
+                throw new NamingException( "Attribute of second rdn in dn '" + dn.toNormName() 
+                    + "' expected to be CN oid of " + CN_OID + " but was " + rdn.getType() );
+            }
+            
+            return ( String ) rdn.getValue();
+        }
+        finally
+        {
+            ne.close();
+        }
+    }
+
+
+    public void enableSchema( String schemaName ) throws NamingException
+    {
+        LdapDN dn = new LdapDN( "cn=" + schemaName + ",ou=schema" );
+        dn.normalize( attrRegistry.getNormalizerMapping() );
+        Attributes entry = partition.lookup( dn );
+        Attribute disabledAttr = ServerUtils.getAttribute( disabledAttributeType, entry );
+        ModificationItem[] mods = new ModificationItem[1];
+        
+        if ( disabledAttr == null )
+        {
+            log.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
+            return;
+        }
+        
+        boolean isDisabled = ( ( String ) disabledAttr.get() ).equalsIgnoreCase( "TRUE" );
+        if ( ! isDisabled )
+        {
+            log.warn( "Does not make sense: you're trying to enable {} schema which is already enabled", schemaName );
+            return;
+        }
+        
+        mods[0] = new ModificationItem( DirContext.REMOVE_ATTRIBUTE, 
+            new LockableAttributeImpl( MetaSchemaConstants.M_DISABLED_AT ) );
+        
+        partition.modify( dn, mods );
     }
 }

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/PartitionSchemaLoaderTest.java Sun Dec 31 09:05:18 2006
@@ -88,7 +88,7 @@
 
         // setup temporary loader and temp registry 
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
         
         // load essential bootstrap schemas 
         Set<Schema> bootstrapSchemas = new HashSet<Schema>();

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaCheckerTest.java Sun Dec 31 09:05:18 2006
@@ -66,7 +66,7 @@
         super( name );
 
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
 
         Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new SystemSchema() );

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/SchemaServiceTest.java Sun Dec 31 09:05:18 2006
@@ -53,7 +53,7 @@
     public void setUp() throws Exception
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
         loader.load( new SystemSchema(), registries );
         loader.load( new ApacheSchema(), registries );
         loader.load( new CoreSchema(), registries );

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoaderTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoaderTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoaderTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/schema/bootstrap/BootstrapSchemaLoaderTest.java Sun Dec 31 09:05:18 2006
@@ -54,7 +54,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        registries = new DefaultRegistries( loader );
+        registries = new DefaultRegistries( "bootstrap", loader );
     }
 
 

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementEvaluatorTest.java Sun Dec 31 09:05:18 2006
@@ -63,7 +63,7 @@
     private void init() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        DefaultRegistries bsRegistries = new DefaultRegistries( loader );
+        DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader );
         Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new SystemSchema() );
         schemas.add( new ApacheSchema() );

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/RefinementLeafEvaluatorTest.java Sun Dec 31 09:05:18 2006
@@ -58,7 +58,7 @@
     private void init() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        DefaultRegistries bsRegistries = new DefaultRegistries( loader );
+        DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader );
         Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new SystemSchema() );
         schemas.add( new ApacheSchema() );

Modified: directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java (original)
+++ directory/branches/trunks/schema/apacheds/core/src/test/java/org/apache/directory/server/core/subtree/SubtreeEvaluatorTest.java Sun Dec 31 09:05:18 2006
@@ -57,7 +57,7 @@
     private void init() throws NamingException
     {
         BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
-        DefaultRegistries bsRegistries = new DefaultRegistries( loader );
+        DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader );
         registries = bsRegistries;
         Set<Schema> schemas = new HashSet<Schema>();
         schemas.add( new SystemSchema() );

Modified: directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaComparatorProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaComparatorProducer.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaComparatorProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaComparatorProducer.java Sun Dec 31 09:05:18 2006
@@ -25,8 +25,12 @@
 
 import javax.naming.NamingException;
 
+import jdbm.helper.StringComparator;
+
 import org.apache.directory.server.schema.bootstrap.ProducerTypeEnum;
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
+import org.apache.directory.shared.ldap.schema.NormalizingComparator;
 import org.apache.directory.shared.ldap.util.StringTools;
 
 
@@ -47,7 +51,16 @@
         super( ProducerTypeEnum.COMPARATOR_PRODUCER );
     }
 
+    
+    public static class DeepTrimToLowerNormalizingComparator extends NormalizingComparator
+    {
+        public DeepTrimToLowerNormalizingComparator()
+        {
+            super( new DeepTrimToLowerNormalizer(), new StringComparator() );
+        }
+    }
 
+    
     // ------------------------------------------------------------------------
     // BootstrapProducer Methods
     // ------------------------------------------------------------------------
@@ -66,6 +79,15 @@
 
         comparator = new ObjectClassTypeComparator();
         cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.1", comparator );
+        
+        comparator = new StringComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.2", comparator );
+        
+        comparator = new DeepTrimToLowerNormalizingComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.3", comparator );
+        
+        comparator = new DeepTrimToLowerNormalizingComparator();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.4", comparator );
     }
 
 

Modified: directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaMatchingRuleProducer.java Sun Dec 31 09:05:18 2006
@@ -142,6 +142,7 @@
     
     public static class SupDITStructureRuleMatch implements MatchingRule
     {
+        private static final String OID = "1.3.6.1.4.1.18060.0.4.0.1.3";
         private static final long serialVersionUID = 1L;
         String[] NAMES = new String[] { "supDITStructureRuleMatch" };
         Syntax syntax;
@@ -185,7 +186,7 @@
 
         public String getOid()
         {
-            return "1.3.6.1.4.1.18060.0.4.0.1.3";
+            return OID;
         }
 
         public boolean isObsolete()
@@ -197,6 +198,8 @@
     
     public static class NumericOidMatch implements MatchingRule
     {
+        private static final String OID = "1.3.6.1.4.1.18060.0.4.0.1.2";
+
         private static final long serialVersionUID = 1L;
 
         final String[] NAMES = new String[] { "numericOidMatch" };
@@ -239,7 +242,7 @@
 
         public String getOid()
         {
-            return "1.3.6.1.4.1.18060.0.4.0.1.2";
+            return OID;
         }
 
         public boolean isObsolete()

Modified: directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-bootstrap/src/main/java/org/apache/directory/server/schema/bootstrap/ApachemetaNormalizerProducer.java Sun Dec 31 09:05:18 2006
@@ -23,6 +23,7 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.server.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.DeepTrimToLowerNormalizer;
 import org.apache.directory.shared.ldap.schema.NoOpNormalizer;
 import org.apache.directory.shared.ldap.schema.Normalizer;
 
@@ -63,5 +64,14 @@
 
         normalizer = new NoOpNormalizer();
         cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.1", normalizer );
+        
+        normalizer = new NoOpNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.2", normalizer );
+        
+        normalizer = new DeepTrimToLowerNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.3", normalizer );
+        
+        normalizer = new DeepTrimToLowerNormalizer();
+        cb.schemaObjectProduced( this, "1.3.6.1.4.1.18060.0.4.0.1.4", normalizer );
     }
 }

Modified: directory/branches/trunks/schema/apacheds/schema-extras/src/test/java/org/apache/directory/server/schema/bootstrap/ExtraSchemaLoadTest.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-extras/src/test/java/org/apache/directory/server/schema/bootstrap/ExtraSchemaLoadTest.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-extras/src/test/java/org/apache/directory/server/schema/bootstrap/ExtraSchemaLoadTest.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-extras/src/test/java/org/apache/directory/server/schema/bootstrap/ExtraSchemaLoadTest.java Sun Dec 31 09:05:18 2006
@@ -52,7 +52,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        registries = new DefaultRegistries( new BootstrapSchemaLoader() );
+        registries = new DefaultRegistries( "bootstrap", new BootstrapSchemaLoader() );
     }
 
 

Modified: directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/DefaultRegistries.java Sun Dec 31 09:05:18 2006
@@ -58,10 +58,12 @@
     private DefaultSyntaxRegistry syntaxRegistry;
     private Map<String,Schema> byName = new HashMap<String, Schema>();
     private final SchemaLoader schemaLoader;
+    private final String name;
 
 
-    public DefaultRegistries( SchemaLoader schemaLoader )
+    public DefaultRegistries( String name, SchemaLoader schemaLoader )
     {
+        this.name = name;
         this.schemaLoader = schemaLoader;
         this.schemaLoader.setListener( new SchemaLoaderListener() {
             public void schemaLoaded( Schema schema )
@@ -84,6 +86,12 @@
     }
 
 
+    public String getName()
+    {
+        return name;
+    }
+    
+    
     public AttributeTypeRegistry getAttributeTypeRegistry()
     {
         return attributeTypeRegistry;

Modified: directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java (original)
+++ directory/branches/trunks/schema/apacheds/schema-registries/src/main/java/org/apache/directory/server/schema/registries/Registries.java Sun Dec 31 09:05:18 2006
@@ -37,6 +37,8 @@
  */
 public interface Registries
 {
+    String getName();
+    
     Map<String,Schema> getLoadedSchemas();
     
     void load( String schemaName ) throws NamingException;

Modified: directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java (original)
+++ directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/BaseCommand.java Sun Dec 31 09:05:18 2006
@@ -81,7 +81,7 @@
     protected void init()
     {
         BaseToolCommandCL command;
-
+ 
         command = new DiagnosticCommandCL();
         commands.put( command.getName(), command );
         commandsOrdered.add( command.getName() );

Modified: directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java (original)
+++ directory/branches/trunks/schema/apacheds/server-tools/src/main/java/org/apache/directory/server/tools/commands/dumpcmd/DumpCommandExecutor.java Sun Dec 31 09:05:18 2006
@@ -18,7 +18,7 @@
  *  
  */
 package org.apache.directory.server.tools.commands.dumpcmd;
-
+ 
 
 import java.io.File;
 import java.io.FileWriter;
@@ -76,7 +76,7 @@
     public static final String EXCLUDEDATTRIBUTES_PARAMETER = "excluded-attributes";
     public static final String INCLUDEOPERATIONAL_PARAMETER = "include-operational";
 
-    private DefaultRegistries bootstrapRegistries = new DefaultRegistries( new BootstrapSchemaLoader() );
+    private DefaultRegistries bootstrapRegistries = new DefaultRegistries( "bootstrap", new BootstrapSchemaLoader() );
     //private BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
     private Set<String> exclusions = new HashSet<String>();
     private boolean includeOperational = false;

Modified: directory/branches/trunks/schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClassTypeEnum.java
URL: http://svn.apache.org/viewvc/directory/branches/trunks/schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClassTypeEnum.java?view=diff&rev=491444&r1=491443&r2=491444
==============================================================================
--- directory/branches/trunks/schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClassTypeEnum.java (original)
+++ directory/branches/trunks/schema/shared/ldap/src/main/java/org/apache/directory/shared/ldap/schema/ObjectClassTypeEnum.java Sun Dec 31 09:05:18 2006
@@ -91,7 +91,7 @@
 
         if ( upperCase.equals( "STRUCTURAL" ) )
         {
-            return ABSTRACT;
+            return STRUCTURAL;
         }
         else if ( upperCase.equals( "AUXILIARY" ) )
         {