<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>commits@directory.apache.org Archives</title>
<link rel="self" href="http://mail-archives.apache.org/mod_mbox/directory-commits/?format=atom"/>
<link href="http://mail-archives.apache.org/mod_mbox/directory-commits/"/>
<id>http://mail-archives.apache.org/mod_mbox/directory-commits/</id>
<updated>2009-12-05T16:26:00Z</updated>
<entry>
<title>[CONF] Apache Directory Server v1.5 &gt; Downloads</title>
<author><name>confluence@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c1019776250.850.1260022620028.JavaMail.www-data@brutus%3e"/>
<id>urn:uuid:%3c1019776250-850-1260022620028-JavaMail-www-data@brutus%3e</id>
<updated>2009-12-05T14:17:00Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
&lt;html&gt;
&lt;head&gt;
    &lt;base href="http://cwiki.apache.org/confluence"&gt;
            &lt;link rel="stylesheet" href="/confluence/s/1519/1/1/_/styles/combined.css?spaceKey=DIRxSRVx11&amp;amp;forWysiwyg=true"
type="text/css"&gt;
    &lt;/head&gt;
&lt;body style="background-color: white" bgcolor="white"&gt;
&lt;div id="pageContent"&gt;
&lt;div id="notificationFormat"&gt;
&lt;div class="wiki-content"&gt;
&lt;div class="email"&gt;
     &lt;h2&gt;&lt;a href="http://cwiki.apache.org/confluence/display/DIRxSRVx11/Downloads"&gt;Downloads&lt;/a&gt;&lt;/h2&gt;
     &lt;h4&gt;Page &lt;b&gt;edited&lt;/b&gt; by             &lt;a href="http://cwiki.apache.org/confluence/display/~pamarcelot"&gt;Pierre-Arnaud
Marcelot&lt;/a&gt;
    &lt;/h4&gt;
     
          &lt;br/&gt;
     &lt;div class="notificationGreySide"&gt;
         &lt;h1&gt;&lt;a name="Downloads-Downloads"&gt;&lt;/a&gt;Downloads&lt;/h1&gt;

&lt;p&gt;Apache Directory Server is a multi-platform application and runs on Mac OS X, Linux
and Windows.&lt;/p&gt;

&lt;p&gt;Please select your installer download:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-tux.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-linux-bin.html"
rel="nofollow"&gt;Download Linux Binary installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-tux.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-linux-deb.html"
rel="nofollow"&gt;Download Linux Debian DEB installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-tux.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-linux-rpm.html"
rel="nofollow"&gt;Download Linux Fedora RPM installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-solaris.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-solaris.html"
rel="nofollow"&gt;Download Solaris PKG installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-osx-uni.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-macosx.html"
rel="nofollow"&gt;Download Mac OS X installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-win.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-windows.html"
rel="nofollow"&gt;Download Windows installer&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/ico-archive.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-archive.html"
rel="nofollow"&gt;Download Archive zip/tar.gz&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;img src="/confluence/download/attachments/89755/page_white_stack.png" align="absmiddle"
border="0" /&gt; &lt;a href="http://directory.apache.org/apacheds/1.5/download/download-sources.html"
rel="nofollow"&gt;Download Sources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

     &lt;/div&gt;
     &lt;div id="commentsSection" class="wiki-content pageSection"&gt;
       &lt;div style="float: right;"&gt;
            &lt;a href="http://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey"&gt;Change Notification Preferences&lt;/a&gt;
       &lt;/div&gt;

       &lt;a href="http://cwiki.apache.org/confluence/display/DIRxSRVx11/Downloads"&gt;View
Online&lt;/a&gt;
       |
       &lt;a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=89755&amp;revisedVersion=11&amp;originalVersion=10"&gt;View
Change&lt;/a&gt;
            &lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;


</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887543 - in /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema: SchemaManagerAddTest.java SchemaManagerLoadTest.java SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091205133521.7785C238898B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091205133521-7785C238898B@eris-apache-org%3e</id>
<updated>2009-12-05T13:35:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Sat Dec  5 13:35:20 2009
New Revision: 887543

URL: http://svn.apache.org/viewvc?rev=887543&amp;view=rev
Log:
Splitted the SchemaManager test class in two classes to have smaller test classes in the future (we have so many methods to tests that at the end it would have become thousands of lines long)

Added:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerAddTest.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerLoadTest.java
Removed:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Added: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerAddTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerAddTest.java?rev=887543&amp;view=auto
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerAddTest.java (added)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerAddTest.java Sat Dec  5 13:35:20 2009
@@ -0,0 +1,619 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.schema;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import javax.naming.NamingException;
+import javax.naming.directory.NoSuchAttributeException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * A test class for SchemaManager.
+ *
+ * @author &lt;a href="mailto:dev@directory.apache.org"&gt;Apache Directory Project&lt;/a&gt;
+ * @version $Rev$, $Date$
+ */
+public class SchemaManagerAddTest
+{
+    // A directory in which the ldif files will be stored
+    private static String workingDirectory;
+
+    // The schema repository
+    private static File schemaRepository;
+
+
+    @BeforeClass
+    public static void setup() throws Exception
+    {
+        workingDirectory = System.getProperty( "workingDirectory" );
+
+        if ( workingDirectory == null )
+        {
+            String path = SchemaManagerAddTest.class.getResource( "" ).getPath();
+            int targetPos = path.indexOf( "target" );
+            workingDirectory = path.substring( 0, targetPos + 6 );
+        }
+
+        schemaRepository = new File( workingDirectory, "schema" );
+
+        // Cleanup the target directory
+        FileUtils.deleteDirectory( schemaRepository );
+
+        SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
+        extractor.extractOrCopy();
+    }
+
+
+    @AfterClass
+    public static void cleanup() throws IOException
+    {
+        // Cleanup the target directory
+        FileUtils.deleteDirectory( schemaRepository );
+    }
+
+
+    private SchemaManager loadSystem() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        String schemaName = "system";
+
+        schemaManager.loadWithDeps( schemaName );
+
+        return schemaManager;
+    }
+
+
+    private boolean isATPresent( SchemaManager schemaManager, String oid )
+    {
+        try
+        {
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid );
+
+            return attributeType != null;
+        }
+        catch ( NoSuchAttributeException nsae )
+        {
+            return false;
+        }
+        catch ( NamingException ne )
+        {
+            return false;
+        }
+    }
+
+
+    //=========================================================================
+    // For each test, we will check many different things.
+    // If the test is successful, we want to know if the SchemaObject
+    // Registry has grown : its size must be one bigger. If the SchemaObject
+    // is not loadable, then the GlobalOidRegistry must also have grwon.
+    //=========================================================================
+    // AttributeType addition tests
+    //-------------------------------------------------------------------------
+    // First, not defined superior
+    //-------------------------------------------------------------------------
+    /**
+     * Try to inject an AttributeType without any superior nor Syntax : it's invalid
+     */
+    @Test
+    public void testAddAttributeTypeNoSupNoSyntaxNoSuperior() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is Collective, and userApplication AT
+     */
+    @Test
+    public void testAddAttributeTypeNoSupCollectiveUser() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+        attributeType.setCollective( true );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is Collective, but an operational AT
+     */
+    @Test
+    public void testAddAttributeTypeNoSupCollectiveOperational() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.DIRECTORY_OPERATION );
+        attributeType.setCollective( true );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is a NO-USER-MODIFICATION and userApplication
+     */
+    @Test
+    public void testAddAttributeTypeNoSupNoUserModificationUserAplication() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+        attributeType.setUserModifiable( false );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is a NO-USER-MODIFICATION and is operational
+     */
+    @Test
+    public void testAddAttributeTypeNoSupNoUserModificationOpAttr() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+        attributeType.setUserModifiable( false );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid EQUALITY MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidEqualityMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "0.0" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid ORDERING MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidOrderingMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( "0.0" );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid SUBSTR MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidSubstringMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( "0.0" );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with valid MRs
+     */
+    @Test
+    public void testAddAttributeTypeNoSupValidMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( "2.5.13.1" );
+        attributeType.setSubstringOid( "2.5.13.1" );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which already exist
+     */
+    @Test
+    public void testAddAttributeTypeAlreadyExist() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "2.5.18.4" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( "2.5.13.1" );
+        attributeType.setSubstringOid( "2.5.13.1" );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        // The AT must be there
+        assertTrue( isATPresent( schemaManager, "2.5.18.4" ) );
+
+        // Check that it hasen't changed
+        AttributeType original = schemaManager.lookupAttributeTypeRegistry( "2.5.18.4" );
+        assertEquals( "distinguishedNameMatch", original.getEqualityOid() );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    //-------------------------------------------------------------------------
+    // Then, with a superior
+    //-------------------------------------------------------------------------
+    /**
+     * Try to inject an AttributeType with a superior and no Syntax : it should
+     * take its superior' syntax and MR
+     */
+    @Test
+    public void testAddAttributeTypeSupNoSyntaxNoSuperior() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "2.5.18.4" );
+        attributeType.setUsage( UsageEnum.DIRECTORY_OPERATION );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        AttributeType result = schemaManager.lookupAttributeTypeRegistry( "1.1.0" );
+
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.12", result.getSyntaxOid() );
+        assertEquals( "2.5.13.1", result.getEqualityOid() );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with a superior and different USAGE
+     */
+    @Test
+    public void testAddAttributeTypeSupDifferentUsage() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "2.5.18.4" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with itself as a superior
+     */
+    @Test
+    public void testAddAttributeTypeSupWithOwnSup() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "1.1.0" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with a bad superior
+     */
+    @Test
+    public void testAddAttributeTypeSupBadSup() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "0.0" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
+    }
+
+    //=========================================================================
+    // Comparator addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // DITContentRule addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // DITStructureRule addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // MatchingRule addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // MatchingRuleUse addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // NameForm addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // Normalizer addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // ObjectClass addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // Syntax addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+    //=========================================================================
+    // SyntaxChecker addition tests
+    //-------------------------------------------------------------------------
+    // TODO
+
+}

Added: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerLoadTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerLoadTest.java?rev=887543&amp;view=auto
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerLoadTest.java (added)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerLoadTest.java Sat Dec  5 13:35:20 2009
@@ -0,0 +1,525 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.server.schema;
+
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
+import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
+import org.apache.directory.shared.schema.DefaultSchemaManager;
+import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * A test class for SchemaManager load() method. We test those methods here :
+ * 
+ *  Server API
+ *     boolean load( Schema... schemas ) throws Exception
+ *     boolean load( String... schemas ) throws Exception
+ *     boolean loadWithDeps( Schema... schemas ) throws Exception
+ *     boolean loadWithDeps( String... schemas ) throws Exception
+ *     boolean loadDisabled( Schema... schemas ) throws Exception
+ *     boolean loadDisabled( String... schemas ) throws Exception
+ *     boolean loadAllEnabled() throws Exception
+ *
+ *  Studio API :
+ *     boolean loadRelaxed( Schema... schemas ) throws Exception
+ *     boolean loadRelaxed( String... schemas ) throws Exception
+ *     boolean loadWithDepsRelaxed( Schema... schemas ) throws Exception
+ *     boolean loadWithDepsRelaxed( String... schemas ) throws Exception
+ *     boolean loadAllEnabledRelaxed() throws Exception 
+ *
+ * @author &lt;a href="mailto:dev@directory.apache.org"&gt;Apache Directory Project&lt;/a&gt;
+ * @version $Rev$, $Date$
+ */
+public class SchemaManagerLoadTest
+{
+    // A directory in which the ldif files will be stored
+    private static String workingDirectory;
+
+    // The schema repository
+    private static File schemaRepository;
+
+
+    @BeforeClass
+    public static void setup() throws Exception
+    {
+        workingDirectory = System.getProperty( "workingDirectory" );
+
+        if ( workingDirectory == null )
+        {
+            String path = SchemaManagerLoadTest.class.getResource( "" ).getPath();
+            int targetPos = path.indexOf( "target" );
+            workingDirectory = path.substring( 0, targetPos + 6 );
+        }
+
+        schemaRepository = new File( workingDirectory, "schema" );
+
+        // Cleanup the target directory
+        FileUtils.deleteDirectory( schemaRepository );
+
+        SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory ) );
+        extractor.extractOrCopy();
+    }
+
+
+    @AfterClass
+    public static void cleanup() throws IOException
+    {
+        // Cleanup the target directory
+        FileUtils.deleteDirectory( schemaRepository );
+    }
+
+
+    //-------------------------------------------------------------------------
+    // Test the load( String... schemaName) method
+    //-------------------------------------------------------------------------
+    /**
+     * test loading the "system" schema 
+     */
+    @Test
+    public void testLoadSystem() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "system" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 38, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 9, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 141, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+    }
+
+
+    /**
+     * test loading the "core" schema, which depends on "system"
+     */
+    @Test
+    public void testLoadCore() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 92, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 222, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+    }
+
+
+    /**
+     * test loading the "apache" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadApache() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "apache" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 145, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 43, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 307, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apache" ) );
+    }
+
+
+    /**
+     * test loading the "apacheMeta" schema, which depends on "system"
+     */
+    @Test
+    public void testLoadApacheMeta() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "apacheMeta" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 69, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 40, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 40, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 42, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 22, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 63, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 64, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 195, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apachemeta" ) );
+    }
+
+
+    /**
+     * test loading the "java" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadJava() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Java" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 99, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 41, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 234, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Java" ) );
+    }
+
+
+    /**
+     * test loading the "other" schema, which depends on "system", "core",
+     * "apache" and "apacheMeta"
+     */
+    @Test
+    public void testLoadOther() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "other" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 176, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 48, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 50, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 66, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 361, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 5, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apache" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apacheMeta" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "other" ) );
+    }
+
+
+    /**
+     * test loading the "cosine" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadCosine() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "cosine" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 133, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 49, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 276, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson" schema, which depends on "system", "core"
+     * and "cosine"
+     */
+    @Test
+    public void testLoadInetOrgPerson() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "Collective" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadCollective() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Collective" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 105, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 235, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "collective" ) );
+    }
+
+
+    /**
+     * test loading the "Krb5Kdc" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadKrb5Kdc() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Krb5Kdc" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 107, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 39, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 240, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Krb5Kdc" ) );
+    }
+
+
+    /**
+     * test loading the "nis" schema, which depends on "system", "core" and "cosine",
+     * but is disabled
+     */
+    @Test
+    public void testLoadNis() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "nis" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 0, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+    }
+
+
+    /**
+     * Test loading a wrong schema
+     */
+    @Test
+    public void testLoadWrongSchema() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "bad" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 0, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson" and "core" schema, which depends on "system" and "cosine"
+     */
+    @Test
+    public void testLoadCoreAndInetOrgPerson() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson", "core" and a bad schema
+     */
+    @Test
+    public void testLoadCoreInetOrgPersonAndBad() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "bad", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson", "core" and a disabled schema
+     */
+    @Test
+    public void testLoadCoreInetOrgPersonAndNis() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "nis", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+}




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887371 - /directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java</title>
<author><name>felixk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204214206.C2A6523889B6@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204214206-C2A6523889B6@eris-apache-org%3e</id>
<updated>2009-12-04T21:42:06Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: felixk
Date: Fri Dec  4 21:42:05 2009
New Revision: 887371

URL: http://svn.apache.org/viewvc?rev=887371&amp;view=rev
Log:
Fix annotation, it's "aggregator" instead of "aggregate". Interesting it worked anyway...

Modified:
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java?rev=887371&amp;r1=887370&amp;r2=887371&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
Fri Dec  4 21:42:05 2009
@@ -35,7 +35,7 @@
  * 
  * @goal prepare-jar-package
  * @phase process-resources
- * @aggregate
+ * @aggregator
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887370 - /directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/</title>
<author><name>felixk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204214040.4E19323889B6@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204214040-4E19323889B6@eris-apache-org%3e</id>
<updated>2009-12-04T21:40:39Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: felixk
Date: Fri Dec  4 21:40:38 2009
New Revision: 887370

URL: http://svn.apache.org/viewvc?rev=887370&amp;view=rev
Log:
@description isn't a valid javadoc tag

Modified:
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCleanMojo.java
Fri Dec  4 21:40:38 2009
@@ -30,7 +30,6 @@
  * 
  * @goal clean
  * @execute phase="generate-resources"
- * @description Clean stuff generated by studio:eclipse
  * @requiresProject
  * @since 1.0
  * 

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioCopyEclipseDependencyMojo.java
Fri Dec  4 21:40:38 2009
@@ -34,13 +34,10 @@
 
 
 /**
- * Copy a set of artifacts to a configured output directory by replacing the
- * separator between artifactId and version by an underscore instead of a dash.
+ * Replace the separator between artifactId and version by an underscore instead
+ * of a dash and copy the artifact to a given destination directory.
  * 
  * @goal copy-eclipse-artifact
- * @description Replace the separator between artifactId and version by an
- *              underscore instead of a dash and copy the artifact to a given
- *              destination directory
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioEclipseMojo.java
Fri Dec  4 21:40:38 2009
@@ -46,16 +46,13 @@
  * &lt;ul&gt;
  * &lt;li&gt;Fork eclipse:eclipse goal and adapt generate files where needed&lt;/li&gt;
  * &lt;li&gt;Copy artifacts nonscoped "provided" to ${basedir}/lib&lt;/li&gt;
+ * &lt;li&gt;Add artifacts nonscoped "provided" to Bundle-ClassPath and MANIFEST.MF&lt;/li&gt;
  * &lt;li&gt;Adapt ${basedir}/.classpath for artifacts nonscoped "provided"&lt;/li&gt;
  * &lt;/ul&gt;
  * &lt;/p&gt;
  * 
  * @goal eclipse
  * @execute phase="generate-resources"
- * @description Copy artifacts nonscoped "provided" to libraryPath, Add
- *              artifacts nonscoped "provided" to Bundle-ClassPath and
- *              MANIFEST.MF, Adapt ${basedir}/.classpath for artifacts nonscoped
- *              "provided"
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioPrepareJarPackageMojo.java
Fri Dec  4 21:40:38 2009
@@ -36,8 +36,6 @@
  * @goal prepare-jar-package
  * @phase process-resources
  * @aggregate
- * @description Prepares for jar: Copy artifacts nonscoped "provided" to
- *              ${project.build.outputDirectory}/libraryPath
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioReplaceFileInJarMojo.java
Fri Dec  4 21:40:38 2009
@@ -31,11 +31,10 @@
 
 
 /**
- * Add ro replace file in existing, distributed artifact
+ * Add/Replace a file within a given eclipse artifact at a specific location
+ * (zip or jar file)
  * 
  * @goal replace-file-in-eclipse-artifact
- * @description Add/Replace a file within a given eclipse artifact at a specific
- *              location (zip or jar file)
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java?rev=887370&amp;r1=887369&amp;r2=887370&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/StudioUnpackPrefixedMojo.java
Fri Dec  4 21:40:38 2009
@@ -34,8 +34,6 @@
  * named based on the artifacts final name
  * 
  * @goal unpack-with-artifactid-prefix
- * @description Prefixes the unpack of an artifact into a given directory with a
- *              directory named based on the artifacts final name
  * @requiresProject
  * @requiresDependencyResolution runtime
  * @since 1.0




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887357 - /directory/studio-plugin/trunk/pom.xml</title>
<author><name>felixk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204210855.EA56F23889B6@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204210855-EA56F23889B6@eris-apache-org%3e</id>
<updated>2009-12-04T21:08:54Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: felixk
Date: Fri Dec  4 21:08:53 2009
New Revision: 887357

URL: http://svn.apache.org/viewvc?rev=887357&amp;view=rev
Log:
Add additional javadoc taglets libraries for javadoc tags used by plugins.

Modified:
    directory/studio-plugin/trunk/pom.xml

Modified: directory/studio-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/pom.xml?rev=887357&amp;r1=887356&amp;r2=887357&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/pom.xml (original)
+++ directory/studio-plugin/trunk/pom.xml Fri Dec  4 21:08:53 2009
@@ -192,6 +192,20 @@
       &lt;plugin&gt;
         &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
         &lt;artifactId&gt;maven-javadoc-plugin&lt;/artifactId&gt;
+        &lt;configuration&gt;
+          &lt;tagletArtifacts&gt;
+            &lt;tagletArtifact&gt;
+              &lt;groupId&gt;org.apache.maven.plugin-tools&lt;/groupId&gt;
+              &lt;artifactId&gt;maven-plugin-tools-javadoc&lt;/artifactId&gt;
+              &lt;version&gt;2.5.1&lt;/version&gt;
+            &lt;/tagletArtifact&gt;
+            &lt;tagletArtifact&gt;
+              &lt;groupId&gt;org.codehaus.plexus&lt;/groupId&gt;
+              &lt;artifactId&gt;plexus-javadoc&lt;/artifactId&gt;
+              &lt;version&gt;1.0&lt;/version&gt;
+            &lt;/tagletArtifact&gt;
+          &lt;/tagletArtifacts&gt;
+        &lt;/configuration&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;
         &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887350 - in /directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins: AbstractStudioMojo.java ArtifactItem.java</title>
<author><name>felixk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204203941.DFCC223889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204203941-DFCC223889B3@eris-apache-org%3e</id>
<updated>2009-12-04T20:39:41Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: felixk
Date: Fri Dec  4 20:39:40 2009
New Revision: 887350

URL: http://svn.apache.org/viewvc?rev=887350&amp;view=rev
Log:
Some Javadoc fixes

Modified:
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
    directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java?rev=887350&amp;r1=887349&amp;r2=887350&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/AbstractStudioMojo.java
Fri Dec  4 20:39:40 2009
@@ -423,7 +423,7 @@
      * Delete a directory
      * 
      * @param path
-     * @return
+     * @return True if directory is deleted
      */
     protected static boolean deleteDirectory( File path )
     {
@@ -448,7 +448,7 @@
     /**
      * Return a list of artifacts nonscoped "provided"
      * 
-     * @return
+     * @return The artifact list
      */
     protected List&lt;Artifact&gt; createArtifactList()
     {
@@ -610,7 +610,7 @@
 
 
     /**
-     * @param libraryPath
+     * @param pLibraryPath
      *            the libraryPath to set
      */
     public void setLibraryPath( String pLibraryPath )

Modified: directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java?rev=887350&amp;r1=887349&amp;r2=887350&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java
(original)
+++ directory/studio-plugin/trunk/src/main/java/org/apache/directory/studio/maven/plugins/ArtifactItem.java
Fri Dec  4 20:39:40 2009
@@ -116,8 +116,8 @@
 
 
     /**
-     * @param artifactId
-     *            The artifactId to set.
+     * @param artifact
+     *            The artifact to set.
      */
     public void setArtifactId( String artifact )
     {




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887349 - /directory/studio-plugin/trunk/pom.xml</title>
<author><name>felixk@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204203427.8B34E23889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204203427-8B34E23889B3@eris-apache-org%3e</id>
<updated>2009-12-04T20:34:27Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: felixk
Date: Fri Dec  4 20:34:27 2009
New Revision: 887349

URL: http://svn.apache.org/viewvc?rev=887349&amp;view=rev
Log:
Fix deprecated taglist configuration

Modified:
    directory/studio-plugin/trunk/pom.xml

Modified: directory/studio-plugin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio-plugin/trunk/pom.xml?rev=887349&amp;r1=887348&amp;r2=887349&amp;view=diff
==============================================================================
--- directory/studio-plugin/trunk/pom.xml (original)
+++ directory/studio-plugin/trunk/pom.xml Fri Dec  4 20:34:27 2009
@@ -223,12 +223,24 @@
         &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
         &lt;artifactId&gt;taglist-maven-plugin&lt;/artifactId&gt;
         &lt;configuration&gt;
-          &lt;tags&gt;
-            &lt;tag&gt;TODO&lt;/tag&gt;
-            &lt;tag&gt;@todo&lt;/tag&gt;
-            &lt;tag&gt;@deprecated&lt;/tag&gt;
-            &lt;tag&gt;FIXME&lt;/tag&gt;
-          &lt;/tags&gt;
+          &lt;encoding&gt;UTF-8&lt;/encoding&gt;
+          &lt;tagListOptions&gt;
+            &lt;tagClasses&gt;
+              &lt;tagClass&gt;
+                &lt;displayName&gt;Todo Work&lt;/displayName&gt;
+                &lt;tags&gt;
+                  &lt;tag&gt;
+                    &lt;matchString&gt;todo&lt;/matchString&gt;
+                    &lt;matchType&gt;ignoreCase&lt;/matchType&gt;
+                  &lt;/tag&gt;
+                  &lt;tag&gt;
+                    &lt;matchString&gt;fixme&lt;/matchString&gt;
+                    &lt;matchType&gt;ignoreCase&lt;/matchType&gt;
+                  &lt;/tag&gt;
+                &lt;/tags&gt;
+              &lt;/tagClass&gt;
+            &lt;/tagClasses&gt;
+          &lt;/tagListOptions&gt;
         &lt;/configuration&gt;
       &lt;/plugin&gt;
       &lt;plugin&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887306 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204181121.CE768238898A@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204181121-CE768238898A@eris-apache-org%3e</id>
<updated>2009-12-04T18:11:21Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 18:11:21 2009
New Revision: 887306

URL: http://svn.apache.org/viewvc?rev=887306&amp;view=rev
Log:
Fixed some errors in initialization as we were using the registries instead of the schemaManager

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java?rev=887306&amp;r1=887305&amp;r2=887306&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/normalizers/NameOrNumericIdNormalizer.java
Fri Dec  4 18:11:21 2009
@@ -28,7 +28,7 @@
 import org.apache.directory.shared.ldap.exception.LdapNamingException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.schema.Normalizer;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
+import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.syntaxCheckers.NumericOidSyntaxChecker;
 
 
@@ -47,14 +47,14 @@
     public static final long serialVersionUID = 1L;
 
     private NumericOidSyntaxChecker checker = new NumericOidSyntaxChecker();
-    
-    /** The global registries */
-    private Registries registries;
-    
+
+    /** A reference to the schema manager used to normalize the Name */
+    private SchemaManager schemaManager;
+
     /** A static instance of this normalizer */
     public static final NameOrNumericIdNormalizer INSTANCE = new NameOrNumericIdNormalizer();
-    
-    
+
+
     /**
      * Creates a new instance of GeneralizedTimeNormalizer.
      */
@@ -62,15 +62,8 @@
     {
         super( SchemaConstants.NAME_OR_NUMERIC_ID_MATCH_OID );
     }
-    
-    
-    public NameOrNumericIdNormalizer( Registries registries )
-    {
-        super(  SchemaConstants.NAME_OR_NUMERIC_ID_MATCH_OID  );
-        this.registries = registries;
-    }
-    
-    
+
+
     /**
      * {@inheritDoc} 
      */
@@ -80,34 +73,34 @@
         {
             return null;
         }
-        
+
         String strValue = value.getString();
 
         if ( strValue.length() == 0 )
         {
             return new ClientStringValue( "" );
         }
-        
+
         // if value is a numeric id then return it as is
         if ( checker.isValidSyntax( strValue ) )
         {
             return value;
         }
-        
+
         // if it is a name we need to do a lookup
-        String oid = registries.getOid( strValue );
-        
+        String oid = schemaManager.getRegistries().getOid( strValue );
+
         if ( oid != null )
         {
             return new ClientStringValue( oid );
         }
-        
+
         // if all else fails
-        throw new LdapNamingException( "Encountered name based id of " + value 
-            + " which was not found in the OID registry" , ResultCodeEnum.OTHER );
+        throw new LdapNamingException( "Encountered name based id of " + value
+            + " which was not found in the OID registry", ResultCodeEnum.OTHER );
     }
-    
-    
+
+
     /**
      * {@inheritDoc} 
      */
@@ -117,37 +110,37 @@
         {
             return null;
         }
-        
+
         if ( value.length() == 0 )
         {
             return value;
         }
-        
+
         // if value is a numeric id then return it as is
         if ( checker.isValidSyntax( value ) )
         {
             return value;
         }
-        
+
         // if it is a name we need to do a lookup
-        String oid = registries.getOid( value );
-        
-        if ( oid != null  )
+        String oid = schemaManager.getRegistries().getOid( value );
+
+        if ( oid != null )
         {
             return oid;
         }
-        
+
         // if all else fails
-        throw new LdapNamingException( "Encountered name based id of " + value 
-            + " which was not found in the OID registry" , ResultCodeEnum.OTHER );
+        throw new LdapNamingException( "Encountered name based id of " + value
+            + " which was not found in the OID registry", ResultCodeEnum.OTHER );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public void applyRegistries( Registries registries )
+    public void setSchemaManager( SchemaManager schemaManager )
     {
-        this.registries = registries;
+        this.schemaManager = schemaManager;
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887298 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204175310.AE23723888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204175310-AE23723888FE@eris-apache-org%3e</id>
<updated>2009-12-04T17:53:10Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 17:53:10 2009
New Revision: 887298

URL: http://svn.apache.org/viewvc?rev=887298&amp;view=rev
Log:
Added some extra tests for the load( SchemaName... ) method, with corner cases and error cases

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887298&amp;r1=887297&amp;r2=887298&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 17:53:10 2009
@@ -576,7 +576,7 @@
 
 
     //-------------------------------------------------------------------------
-    // Test the load( String... schemaname) method
+    // Test the load( String... schemaName) method
     //-------------------------------------------------------------------------
     /**
      * test loading the "system" schema 
@@ -887,4 +887,115 @@
         assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
     }
 
+
+    /**
+     * Test loading a wrong schema
+     */
+    @Test
+    public void testLoadWrongSchema() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "bad" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 0, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson" and "core" schema, which depends on "system" and
"cosine"
+     */
+    @Test
+    public void testLoadCoreAndInetOrgPerson() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson", "core" and a bad schema
+     */
+    @Test
+    public void testLoadCoreInetOrgPersonAndBad() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "bad", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson", "core" and a disabled schema
+     */
+    @Test
+    public void testLoadCoreInetOrgPersonAndNis() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core", "nis", "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887297 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204175207.95E3423888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204175207-95E3423888FE@eris-apache-org%3e</id>
<updated>2009-12-04T17:52:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 17:52:07 2009
New Revision: 887297

URL: http://svn.apache.org/viewvc?rev=887297&amp;view=rev
Log:
Fixed a NPE when trying to load a bad schema (schema that does not exist)

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=887297&amp;r1=887296&amp;r2=887297&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Fri Dec  4 17:52:07 2009
@@ -822,6 +822,12 @@
      */
     private final void loadDepsFirst( Registries registries, Schema schema ) throws Exception
     {
+        if ( schema == null )
+        {
+            LOG.info( "The schema is null" );
+            return;
+        }
+
         if ( schema.isDisabled() &amp;&amp; !registries.isDisabledAccepted() )
         {
             LOG.info( "The schema is disabled and the registries does not accepted disabled
schema" );




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887292 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204174220.6032723889E4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204174220-6032723889E4@eris-apache-org%3e</id>
<updated>2009-12-04T17:42:20Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 17:42:19 2009
New Revision: 887292

URL: http://svn.apache.org/viewvc?rev=887292&amp;view=rev
Log:
Added tests for the load( schemaName... ) method

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887292&amp;r1=887291&amp;r2=887292&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 17:42:19 2009
@@ -22,6 +22,8 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -571,4 +573,318 @@
         assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
         assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
+
+
+    //-------------------------------------------------------------------------
+    // Test the load( String... schemaname) method
+    //-------------------------------------------------------------------------
+    /**
+     * test loading the "system" schema 
+     */
+    @Test
+    public void testLoadSystem() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "system" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 38, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 9, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 141, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 1, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+    }
+
+
+    /**
+     * test loading the "core" schema, which depends on "system"
+     */
+    @Test
+    public void testLoadCore() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "core" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 92, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 222, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+    }
+
+
+    /**
+     * test loading the "apache" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadApache() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "apache" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 145, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 43, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 43, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 43, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 53, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 62, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 66, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 307, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apache" ) );
+    }
+
+
+    /**
+     * test loading the "apacheMeta" schema, which depends on "system"
+     */
+    @Test
+    public void testLoadApacheMeta() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "apacheMeta" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 69, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 40, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 40, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 42, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 22, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 63, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 64, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 195, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 2, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apachemeta" ) );
+    }
+
+
+    /**
+     * test loading the "java" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadJava() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Java" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 99, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 41, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 234, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Java" ) );
+    }
+
+
+    /**
+     * test loading the "other" schema, which depends on "system", "core",
+     * "apache" and "apacheMeta"
+     */
+    @Test
+    public void testLoadOther() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "other" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 176, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 48, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 48, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 50, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 66, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 66, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 71, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 361, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 5, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apache" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "apacheMeta" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "other" ) );
+    }
+
+
+    /**
+     * test loading the "cosine" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadCosine() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "cosine" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 133, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 49, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 276, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+    }
+
+
+    /**
+     * test loading the "InetOrgPerson" schema, which depends on "system", "core"
+     * and "cosine"
+     */
+    @Test
+    public void testLoadInetOrgPerson() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "InetOrgPerson" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 142, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 50, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 286, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 4, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "InetOrgPerson" ) );
+    }
+
+
+    /**
+     * test loading the "Collective" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadCollective() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Collective" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 105, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 36, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 235, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "collective" ) );
+    }
+
+
+    /**
+     * test loading the "Krb5Kdc" schema, which depends on "system" and "core"
+     */
+    @Test
+    public void testLoadKrb5Kdc() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "Krb5Kdc" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 107, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 35, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 35, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 35, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 39, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 59, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 59, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 240, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 3, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNotNull( schemaManager.getRegistries().getLoadedSchema( "Krb5Kdc" ) );
+    }
+
+
+    /**
+     * test loading the "nis" schema, which depends on "system", "core" and "cosine",
+     * but is disabled
+     */
+    @Test
+    public void testLoadNis() throws Exception
+    {
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
+        SchemaManager schemaManager = new DefaultSchemaManager( loader );
+
+        schemaManager.loadWithDeps( "nis" );
+
+        assertTrue( schemaManager.getErrors().isEmpty() );
+        assertEquals( 0, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( 0, schemaManager.getComparatorRegistry().size() );
+        assertEquals( 0, schemaManager.getMatchingRuleRegistry().size() );
+        assertEquals( 0, schemaManager.getNormalizerRegistry().size() );
+        assertEquals( 0, schemaManager.getObjectClassRegistry().size() );
+        assertEquals( 0, schemaManager.getSyntaxCheckerRegistry().size() );
+        assertEquals( 0, schemaManager.getLdapSyntaxRegistry().size() );
+        assertEquals( 0, schemaManager.getOidRegistry().size() );
+
+        assertEquals( 0, schemaManager.getRegistries().getLoadedSchemas().size() );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "system" ) );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "core" ) );
+        assertNull( schemaManager.getRegistries().getLoadedSchema( "cosine" ) );
+    }
+
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887284 [2/2] - /directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204173414.DC9482388978@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204173414-DC9482388978@eris-apache-org%3e</id>
<updated>2009-12-04T17:34:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java
Fri Dec  4 17:34:13 2009
@@ -58,42 +58,44 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( SyntaxSynchronizer.class );
 
+
     /**
      * Creates a new instance of SyntaxSynchronizer.
      *
      * @param schemaManager The global schemaManager
      * @throws Exception If the initialization failed
      */
-    public SyntaxSynchronizer( SchemaManager schemaManager ) 
-        throws Exception
+    public SyntaxSynchronizer( SchemaManager schemaManager ) throws Exception
     {
         super( schemaManager );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean
cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean
cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String oid = getOid( entry );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
getSchemaName( name ) );
+        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+            getSchemaName( name ) );
         String schemaName = getSchemaName( entry.getDn() );
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             schemaManager.unregisterLdapSyntax( oid );
             schemaManager.add( syntax );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -108,10 +110,10 @@
 
         // The new schemaObject's OID must not already exist
         checkOidIsUnique( entry );
-        
+
         // Build the new Syntax from the given entry
         String schemaName = getSchemaName( dn );
-        
+
         LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
 
         // At this point, the constructed Syntax has not been checked against the 
@@ -119,31 +121,31 @@
         // there, if the schema and the Syntax are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         if ( schema.isEnabled() &amp;&amp; syntax.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Inject the newly created Syntax in the cloned registries
             clonedRegistries.add( errors, syntax );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, apply the addition to the real retistries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, syntax );
+                schemaManager.getRegistries().add( errors, syntax );
 
                 LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName
);
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the Syntax " + entry.getDn().getUpName() + " into
the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
+                String msg = "Cannot add the Syntax " + entry.getDn().getUpName() + " into
the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
             }
@@ -152,20 +154,28 @@
         {
             // At least, we register the OID in the globalOidRegistry, and associates it
with the
             // schema
-            schemaManager.getRegistries().associateWithSchema( syntax );
+            schemaManager.getRegistries().associateWithSchema( errors, syntax );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the Syntax " + entry.getDn().getUpName() + " into
the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+            }
 
             LOG.debug( "The Syntax {} cannot be added in schema {}", dn.getUpName(), schemaName
);
         }
     }
 
-    
+
     /**
      * Check if a syntax is used by an AT or a MR
      */
     private List&lt;SchemaObject&gt; checkInUse( String oid )
     {
         List&lt;SchemaObject&gt; dependees = new ArrayList&lt;SchemaObject&gt;();
-        
+
         for ( AttributeType attributeType : schemaManager.getAttributeTypeRegistry() )
         {
             if ( oid.equals( attributeType.getSyntax().getOid() ) )
@@ -173,7 +183,7 @@
                 dependees.add( attributeType );
             }
         }
-        
+
         for ( MatchingRule matchingRule : schemaManager.getMatchingRuleRegistry() )
         {
             if ( oid.equals( matchingRule.getSyntax().getOid() ) )
@@ -181,11 +191,11 @@
                 dependees.add( matchingRule );
             }
         }
-        
+
         return dependees;
     }
-    
-    
+
+
     /**
      * Get the list of SchemaObject's name using a given syntax
      */
@@ -193,7 +203,7 @@
     {
         StringBuilder sb = new StringBuilder();
         boolean isFirst = true;
-        
+
         for ( SchemaObject schemaObject : schemaObjects )
         {
             if ( isFirst )
@@ -204,14 +214,14 @@
             {
                 sb.append( ", " );
             }
-            
-            sb.append(  schemaObject.getName() );
+
+            sb.append( schemaObject.getName() );
         }
-        
+
         return sb.toString();
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -220,14 +230,14 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=syntaxes,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX );
-        
+
         // Get the Syntax from the given entry ( it has been grabbed from the server earlier)
         String schemaName = getSchemaName( entry.getDn() );
         LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
-        
+
         // Applies the Registries to this Syntax 
         Schema schema = schemaManager.getLoadedSchema( schemaName );
 
@@ -237,18 +247,18 @@
         }
 
         String oid = syntax.getOid();
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             if ( schemaManager.getRegistries().isReferenced( syntax ) )
             {
-                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are
some " +
-                    " dependant SchemaObjects :\n" + getReferenced( syntax );
+                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are
some "
+                    + " dependant SchemaObjects :\n" + getReferenced( syntax );
                 LOG.warn( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
             }
         }
-        
+
         deleteFromSchema( syntax, schemaName );
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
@@ -256,10 +266,10 @@
             // Update the references.
             // The SyntaxChecker
             schemaManager.getRegistries().delReference( syntax, syntax.getSyntaxChecker()
);
-            
+
             // Update the Registry
             schemaManager.unregisterLdapSyntax( oid );
-            
+
             LOG.debug( "Removed {} from the enabled schema {}", syntax, schemaName );
         }
         else
@@ -269,7 +279,7 @@
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -280,23 +290,23 @@
 
         // Check that this syntax is not used by an AttributeType
         List&lt;SchemaObject&gt; dependees = checkInUse( oldOid );
-        
+
         if ( dependees.size() != 0 )
         {
-            throw new LdapOperationNotSupportedException( "The syntax with OID " + oldOid

-              + " cannot be deleted until all entities" 
-              + " using this syntax have also been deleted.  The following dependees exist:
" 
-              + getNames( dependees ), 
-              ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The syntax with OID " + oldOid + " cannot be deleted until all entities"
+                    + " using this syntax have also been deleted.  The following dependees
exist: "
+                    + getNames( dependees ), ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
-        
+
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
getSchemaName( entry.getDn() ) );
-        
+        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+            getSchemaName( entry.getDn() ) );
+
         if ( isSchemaEnabled( schemaName ) )
         {
             schemaManager.unregisterLdapSyntax( oldOid );
@@ -322,22 +332,22 @@
 
         // Check that this syntax is not used by an AttributeType
         List&lt;SchemaObject&gt; dependees = checkInUse( oldOid );
-        
+
         if ( dependees.size() != 0 )
         {
-            throw new LdapOperationNotSupportedException( "The syntax with OID " + oldOid

-              + " cannot be deleted until all entities" 
-              + " using this syntax have also been deleted.  The following dependees exist:
" 
-              + getNames( dependees ), 
-              ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The syntax with OID " + oldOid + " cannot be deleted until all entities"
+                    + " using this syntax have also been deleted.  The following dependees
exist: "
+                    + getNames( dependees ), ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRn.getValue();
         checkOidIsUnique( newOid );
-        
+
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
getSchemaName( newParentName ) );
+        LdapSyntax syntax = factory.getSyntax( schemaManager, targetEntry, schemaManager.getRegistries(),
+            getSchemaName( newParentName ) );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
@@ -360,8 +370,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oid = getOid( entry );
@@ -369,20 +378,21 @@
         String newSchemaName = getSchemaName( newParentName );
 
         // schema dep check before delete to be handled by the SchemaPartition
-//        
-//        Set&lt;ServerEntry&gt; dependees = dao.listSyntaxDependents( oid );
-//        
-//        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
-//        {
-//            throw new LdapOperationNotSupportedException( "The syntax with OID " + oid

-//                + " cannot be deleted until all entities" 
-//                + " using this syntax have also been deleted.  The following dependees
exist: " 
-//                + getOids( dependees ), 
-//                ResultCodeEnum.UNWILLING_TO_PERFORM );
-//        }
-        
-        LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
getSchemaName( newParentName ) );
-        
+        //        
+        //        Set&lt;ServerEntry&gt; dependees = dao.listSyntaxDependents( oid );
+        //        
+        //        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
+        //        {
+        //            throw new LdapOperationNotSupportedException( "The syntax with OID
" + oid 
+        //                + " cannot be deleted until all entities" 
+        //                + " using this syntax have also been deleted.  The following dependees
exist: " 
+        //                + getOids( dependees ), 
+        //                ResultCodeEnum.UNWILLING_TO_PERFORM );
+        //        }
+
+        LdapSyntax syntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
+            getSchemaName( newParentName ) );
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterLdapSyntax( oid );
@@ -391,7 +401,7 @@
         {
             unregisterOids( syntax );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( syntax );
@@ -401,28 +411,29 @@
             registerOids( syntax );
         }
     }
-    
-    
+
+
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a syntax should be at most 3 name components in length.",

+            throw new LdapInvalidNameException(
+                "The parent dn of a syntax should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
SchemaConstants.OU_AT_OID ) )
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a syntax should be an
organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a syntax should be an
organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( "syntaxes" ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( "syntaxes" ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a syntax should have a relative name of ou=syntaxes.",

+            throw new LdapInvalidNameException(
+                "The parent entry of a syntax should have a relative name of ou=syntaxes.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887284 [1/2] - /directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204173414.D727723888FE@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204173414-D727723888FE@eris-apache-org%3e</id>
<updated>2009-12-04T17:34:14Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 17:34:13 2009
New Revision: 887284

URL: http://svn.apache.org/viewvc?rev=887284&amp;view=rev
Log:
Fixed compilation errors (a new parameter added in a method was missing in the callers)

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxSynchronizer.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ComparatorSynchronizer.java Fri Dec  4 17:34:13 2009
@@ -57,7 +57,7 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( ComparatorSynchronizer.class );
 
-    
+
     /**
      * Creates a new instance of ComparatorSynchronizer.
      *
@@ -69,31 +69,33 @@
         super( schemaManager );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
         String oid = getOid( entry );
-        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
-        
+        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, targetEntry, schemaManager
+            .getRegistries(), schemaName );
+
         if ( isSchemaEnabled( schemaName ) )
         {
             comparator.setSchemaName( schemaName );
 
             schemaManager.unregisterComparator( oid );
             schemaManager.add( comparator );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -103,18 +105,19 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=comparators,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.COMPARATOR );
-        
+
         // The new schemaObject's OID must not already exist
         checkOidIsUniqueForComparator( entry );
 
         // Build the new Comparator from the given entry
         String schemaName = getSchemaName( dn );
-        
-        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(), schemaName );
-        
+
+        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
+
         // At this point, the constructed LdapComparator has not been checked against the 
         // existing Registries. It will be checked there, if the schema and the 
         // LdapComparator are both enabled.
@@ -125,36 +128,45 @@
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Inject the newly created Comparator in the cloned registries
             clonedRegistries.add( errors, comparator );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, add the Comparator into the real registries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, comparator );
+                schemaManager.getRegistries().add( errors, comparator );
+
+                LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
+
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
-            
-            LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
         }
         else
         {
-            LOG.debug( "The comparator {} cannot be added in schema {}", dn.getUpName(), schemaName );
-
             // At least, we associates the comparator with the schema
-            schemaManager.getRegistries().associateWithSchema( comparator );
+            schemaManager.getRegistries().associateWithSchema( errors, comparator );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            }
+
+            LOG.debug( "The comparator {} cannot be added in schema {}", dn.getUpName(), schemaName );
         }
     }
 
@@ -167,16 +179,16 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=comparators,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.COMPARATOR );
-        
+
         // Test that the Oid exists
         LdapComparator&lt;?&gt; comparator = null;
-        
+
         try
         {
-            comparator = (LdapComparator&lt;?&gt;)checkComparatorOidExists( entry );
+            comparator = ( LdapComparator&lt;?&gt; ) checkComparatorOidExists( entry );
         }
         catch ( LdapSchemaViolationException lsve )
         {
@@ -184,11 +196,11 @@
             // We will check that by looking on the disk
             String schemaName = getSchemaName( dn );
             comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(), schemaName );
-            
+
             if ( schemaManager.getRegistries().contains( comparator ) )
             {
                 // Remove the Comparator from the schema/SchemaObject Map
-                schemaManager.getRegistries().dissociateFromSchema( comparator);
+                schemaManager.getRegistries().dissociateFromSchema( comparator );
 
                 // Ok, we can exit. 
                 return;
@@ -196,27 +208,27 @@
             else
             {
                 // Ok, definitively an error
-                String msg = "Cannot delete the Comparator " + entry.getDn().getUpName() + " as it "+
-                    "does not exist in any schema";
+                String msg = "Cannot delete the Comparator " + entry.getDn().getUpName() + " as it "
+                    + "does not exist in any schema";
                 LOG.info( msg );
                 throw new LdapSchemaViolationException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
         }
-        
+
         // Get the SchemaName
-        String schemaName = getSchemaName( entry.getDn() ); 
-        
+        String schemaName = getSchemaName( entry.getDn() );
+
         // Get the Schema
         Schema schema = schemaManager.getLoadedSchema( schemaName );
-        
+
         if ( schema.isEnabled() &amp;&amp; comparator.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Relax the cloned registries
             clonedRegistries.setRelaxed();
-            
+
             // Before removing a comparator, we have to check that there are no MR pointing
             // on it, as it won't be done during the integrity check : in this case, the
             // check will create a default comparator instead of raising an error...
@@ -228,7 +240,7 @@
 
                 String msg = "There is at least one MatchingRule using the Comparator with OID " + comparator.getOid();
                 LOG.debug( msg );
-                
+
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
 
@@ -240,22 +252,22 @@
 
             // Check the registries now
             List&lt;Throwable&gt; errors = clonedRegistries.checkRefInteg();
-            
+
             // If we didn't get any error, swap the registries
             if ( errors.size() == 0 )
             {
                 clonedRegistries.setStrict();
-                schemaManager.swapRegistries( clonedRegistries  );
+                schemaManager.swapRegistries( clonedRegistries );
             }
             else
             {
                 // We have some error : reject the deletion and get out
                 // Destroy the cloned registries
                 clonedRegistries.clear();
-                
+
                 // The schema is disabled. We still have to update the backend
-                String msg = "Cannot delete the Comparator " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot delete the Comparator " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -266,7 +278,7 @@
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -276,17 +288,16 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The comparator with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "matchingRules using that comparator have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The comparator with OID " + oldOid + " cannot have it's OID changed until all "
+                    + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getValue();
         checkOidIsUniqueForComparator( oid );
-        
+
         String schemaName = getSchemaName( entry.getDn() );
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             // Inject the new OID in the entry
@@ -294,15 +305,16 @@
             String newOid = ( String ) newRdn.getValue();
             checkOidIsUnique( newOid );
             targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-            
+
             // Inject the new DN
             LdapDN newDn = new LdapDN( targetEntry.getDn() );
             newDn.remove( newDn.size() - 1 );
             newDn.add( newRdn );
             targetEntry.setDn( newDn );
-            
+
             // Register the new comparator, and unregister the old one
-            LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
+            LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, targetEntry, schemaManager
+                .getRegistries(), schemaName );
             schemaManager.unregisterComparator( oldOid );
             schemaManager.add( comparator );
         }
@@ -317,21 +329,21 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The comparator with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "matchingRules using that comparator have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The comparator with OID " + oldOid + " cannot have it's OID changed until all "
+                    + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getValue();
         checkOidIsUniqueForComparator( oid );
-        
+
         String newSchemaName = getSchemaName( newParentName );
-        
-        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
+
+        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
 
         String oldSchemaName = getSchemaName( oriChildName );
-        
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterComparator( oldOid );
@@ -344,43 +356,42 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oid = getOid( entry );
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The comparator with OID " + oid 
-                + " cannot be moved to another schema until all " 
-                + "matchingRules using that comparator have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( "The comparator with OID " + oid
+                + " cannot be moved to another schema until all "
+                + "matchingRules using that comparator have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String newSchemaName = getSchemaName( newParentName );
 
-        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
-        
+        LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
+
         String oldSchemaName = getSchemaName( oriChildName );
-        
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterComparator( oid );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( comparator );
         }
     }
-    
-    
+
+
     private void checkOidIsUniqueForComparator( String oid ) throws NamingException
     {
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.", 
+            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.",
                 ResultCodeEnum.OTHER );
         }
     }
@@ -389,10 +400,10 @@
     private void checkOidIsUniqueForComparator( ServerEntry entry ) throws Exception
     {
         String oid = getOid( entry );
-        
+
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.", 
+            throw new LdapNamingException( "Oid " + oid + " for new schema comparator is not unique.",
                 ResultCodeEnum.OTHER );
         }
     }
@@ -408,7 +419,7 @@
 
         if ( schemaManager.getComparatorRegistry().contains( oid ) )
         {
-            return (LdapComparator&lt;?&gt;)schemaManager.getComparatorRegistry().get( oid );
+            return ( LdapComparator&lt;?&gt; ) schemaManager.getComparatorRegistry().get( oid );
         }
         else
         {
@@ -417,28 +428,29 @@
         }
     }
 
-    
+
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a comparator should be at most 3 name components in length.", 
+            throw new LdapInvalidNameException(
+                "The parent dn of a comparator should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
-        
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a comparator should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a comparator should be an organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a comparator should have a relative name of ou=comparators.", 
+            throw new LdapInvalidNameException(
+                "The parent entry of a comparator should have a relative name of ou=comparators.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/MatchingRuleSynchronizer.java Fri Dec  4 17:34:13 2009
@@ -55,14 +55,14 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( MatchingRuleSynchronizer.class );
 
+
     /**
      * Creates a new instance of MatchingRuleSynchronizer.
      *
      * @param schemaManager The global schemaManager
      * @throws Exception If the initialization failed
      */
-    public MatchingRuleSynchronizer( SchemaManager schemaManager ) 
-        throws Exception
+    public MatchingRuleSynchronizer( SchemaManager schemaManager ) throws Exception
     {
         super( schemaManager );
     }
@@ -71,21 +71,22 @@
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, 
-        boolean cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
-        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
-        
+        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(),
+            schemaName );
+
         String oldOid = getOid( entry );
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             schemaManager.unregisterMatchingRule( oldOid );
             schemaManager.add( mr );
-            
+
             return SCHEMA_MODIFIED;
         }
         else
@@ -109,41 +110,42 @@
 
         // The new schemaObject's OID must not already exist
         checkOidIsUnique( entry );
-        
+
         // Build the new MatchingRule from the given entry
         String schemaName = getSchemaName( dn );
-        
-        MatchingRule matchingRule = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), schemaName );
+
+        MatchingRule matchingRule = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
 
         // At this point, the constructed MatchingRule has not been checked against the 
         // existing Registries. It may be broken (missing SUP, or such), it will be checked
         // there, if the schema and the MatchingRule are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
-        
+
         if ( schema.isEnabled() &amp;&amp; matchingRule.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
 
             clonedRegistries.add( errors, matchingRule );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, swap the registries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, matchingRule );
+                schemaManager.getRegistries().add( errors, matchingRule );
 
                 LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -152,7 +154,15 @@
         {
             // At least, we register the OID in the globalOidRegistry, and associates it with the
             // schema
-            schemaManager.getRegistries().associateWithSchema( matchingRule );
+            schemaManager.getRegistries().associateWithSchema( errors, matchingRule );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            }
 
             LOG.debug( "Added {} into the disabled schema {}", dn.getUpName(), schemaName );
         }
@@ -167,54 +177,54 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=matchingrules,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.MATCHING_RULE );
 
         // Test that the Oid exists
-        MatchingRule matchingRule = (MatchingRule)checkOidExists( entry );
-        
+        MatchingRule matchingRule = ( MatchingRule ) checkOidExists( entry );
+
         // Get the SchemaName
         String schemaName = getSchemaName( entry.getDn() );
-        
+
         // Get the schema 
         Schema schema = schemaManager.getLoadedSchema( schemaName );
-        
+
         if ( schema.isEnabled() &amp;&amp; matchingRule.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Relax the cloned registries
             clonedRegistries.setRelaxed();
-            
+
             // Remove this MatchingRule from the Registries
             clonedRegistries.unregister( matchingRule );
-            
+
             // Remove the MatchingRule from the schema/SchemaObject Map
             clonedRegistries.dissociateFromSchema( matchingRule );
 
             // Update the cross references for MatchingRule
             clonedRegistries.delCrossReferences( matchingRule );
-            
+
             // Check the registries now
             List&lt;Throwable&gt; errors = clonedRegistries.checkRefInteg();
-            
+
             // If we didn't get any error, swap the registries
             if ( errors.size() == 0 )
             {
                 clonedRegistries.setStrict();
-                schemaManager.swapRegistries( clonedRegistries  );
+                schemaManager.swapRegistries( clonedRegistries );
             }
             else
             {
                 // We have some error : reject the deletion and get out
                 // Destroy the cloned registries
                 clonedRegistries.clear();
-                
+
                 // The schema is disabled. We still have to update the backend
-                String msg = "Cannot delete the MatchingRule " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot delete the MatchingRule " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -222,15 +232,15 @@
         else
         {
             unregisterOids( matchingRule );
-            
+
             // Remove the MatchingRule from the schema/SchemaObject Map
             schemaManager.getRegistries().dissociateFromSchema( matchingRule );
-            
+
             LOG.debug( "Removed {} from the disabled schema {}", matchingRule, schemaName );
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -241,9 +251,10 @@
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
-        
+
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
+        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(),
+            schemaName );
 
         if ( isSchemaEnabled( schemaName ) )
         {
@@ -258,20 +269,22 @@
     }
 
 
-    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn, 
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
-        MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), oldSchemaName );
+        MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
+            oldSchemaName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
-        
+
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(), newSchemaName );
-        
+        MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(),
+            newSchemaName );
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterMatchingRule( oldMr.getOid() );
@@ -292,14 +305,15 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
-        MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), oldSchemaName );
-        MatchingRule newMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
+        MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
+            oldSchemaName );
+        MatchingRule newMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
@@ -309,7 +323,7 @@
         {
             unregisterOids( oldMr );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( newMr );
@@ -319,28 +333,29 @@
             registerOids( newMr );
         }
     }
-    
-    
+
+
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a matchingRule should be at most 3 name components in length.", 
+            throw new LdapInvalidNameException(
+                "The parent dn of a matchingRule should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a matchingRule should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a matchingRule should be an organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a syntax should have a relative name of ou=matchingRules.", 
+            throw new LdapInvalidNameException(
+                "The parent entry of a syntax should have a relative name of ou=matchingRules.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/NormalizerSynchronizer.java Fri Dec  4 17:34:13 2009
@@ -55,6 +55,7 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( NormalizerSynchronizer.class );
 
+
     /**
      * Creates a new instance of NormalizerSynchronizer.
      *
@@ -65,29 +66,31 @@
     {
         super( schemaManager );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
         String oldOid = getOid( entry );
-        Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
-        
+        Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(),
+            schemaName );
+
         if ( isSchemaEnabled( schemaName ) )
         {
             normalizer.setSchemaName( schemaName );
 
             schemaManager.unregisterNormalizer( oldOid );
             schemaManager.add( normalizer );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
 
@@ -106,10 +109,10 @@
 
         // The new schemaObject's OID must not already exist
         checkOidIsUniqueForNormalizer( entry );
-        
+
         // Build the new Normalizer from the given entry
         String schemaName = getSchemaName( dn );
-        
+
         Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(), schemaName );
 
         // At this point, the constructed Normalizer has not been checked against the 
@@ -117,41 +120,49 @@
         // Normalizer are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         if ( schema.isEnabled() &amp;&amp; normalizer.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Inject the newly created Normalizer in the cloned registries
             clonedRegistries.add( errors, normalizer );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, add the Normalizer into the real registries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, normalizer );
+                schemaManager.getRegistries().add( errors, normalizer );
+
+                LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
-            
-            LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
         }
         else
         {
-            LOG.debug( "The normalizer {} cannot be added in schema {}", dn.getUpName(), schemaName );
-
             // At least, we associates the Normalizer with the schema
-            schemaManager.getRegistries().associateWithSchema( normalizer );
+            schemaManager.getRegistries().associateWithSchema( errors, normalizer );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            }
+
+            LOG.debug( "The normalizer {} cannot be added in schema {}", dn.getUpName(), schemaName );
         }
     }
 
@@ -164,22 +175,22 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=normalizers,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.NORMALIZER );
-        
+
         // Get the Normalizer from the given entry ( it has been grabbed from the server earlier)
         String schemaName = getSchemaName( entry.getDn() );
         Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(), schemaName );
-        
+
         String oid = normalizer.getOid();
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             if ( schemaManager.getRegistries().isReferenced( normalizer ) )
             {
-                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some " +
-                    " dependant SchemaObjects :\n" + getReferenced( normalizer );
+                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some "
+                    + " dependant SchemaObjects :\n" + getReferenced( normalizer );
                 LOG.warn( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -188,7 +199,6 @@
             // be loaded into the schemaManager if it's disabled
             deleteFromSchema( normalizer, schemaName );
         }
-        
 
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
@@ -200,7 +210,7 @@
             LOG.debug( "Removed {} from the enabled schema {}", normalizer, schemaName );
         }
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -212,28 +222,28 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The normalizer with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "matchingRules using that normalizer have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The normalizer with OID " + oldOid + " cannot have it's OID changed until all "
+                    + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUniqueForNormalizer( newOid );
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             // Inject the new OID
             ServerEntry targetEntry = ( ServerEntry ) entry.clone();
             targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-            
+
             // Inject the new DN
             LdapDN newDn = new LdapDN( targetEntry.getDn() );
             newDn.remove( newDn.size() - 1 );
             newDn.add( newRdn );
             targetEntry.setDn( newDn );
 
-            Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
+            Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(),
+                schemaName );
             schemaManager.unregisterNormalizer( oldOid );
             schemaManager.add( normalizer );
         }
@@ -250,15 +260,15 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The normalizer with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "matchingRules using that normalizer have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException(
+                "The normalizer with OID " + oldOid + " cannot have it's OID changed until all "
+                    + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         String oid = ( String ) newRdn.getValue();
         checkOidIsUniqueForNormalizer( oid );
-        Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
+        Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
@@ -272,8 +282,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oid = getOid( entry );
@@ -282,32 +291,31 @@
 
         if ( schemaManager.getMatchingRuleRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The normalizer with OID " + oid 
-                + " cannot be moved to another schema until all " 
-                + "matchingRules using that normalizer have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( "The normalizer with OID " + oid
+                + " cannot be moved to another schema until all "
+                + "matchingRules using that normalizer have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
-        
+        Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterNormalizer( oid );
         }
-        
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( normalizer );
         }
     }
 
-    
+
     private void checkOidIsUniqueForNormalizer( String oid ) throws NamingException
     {
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.", 
+            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
                 ResultCodeEnum.OTHER );
         }
     }
@@ -316,10 +324,10 @@
     private void checkOidIsUniqueForNormalizer( ServerEntry entry ) throws Exception
     {
         String oid = getOid( entry );
-        
+
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.", 
+            throw new LdapNamingException( "Oid " + oid + " for new schema normalizer is not unique.",
                 ResultCodeEnum.OTHER );
         }
     }
@@ -329,23 +337,24 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a normalizer should be at most 3 name components in length.", 
+            throw new LdapInvalidNameException(
+                "The parent dn of a normalizer should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
 
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a normalizer should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a normalizer should be an organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a normalizer should have a relative name of ou=normalizers.", 
+            throw new LdapInvalidNameException(
+                "The parent entry of a normalizer should have a relative name of ou=normalizers.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/ObjectClassSynchronizer.java Fri Dec  4 17:34:13 2009
@@ -71,22 +71,24 @@
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String oid = getOid( entry );
-        ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(), getSchemaName( name ) );
+        ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(),
+            getSchemaName( name ) );
         String schemaName = getSchemaName( entry.getDn() );
 
         if ( isSchemaEnabled( schemaName ) )
         {
             schemaManager.unregisterObjectClass( oid );
             schemaManager.add( oc );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
 
@@ -99,47 +101,48 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=objectclasses,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.OBJECT_CLASS );
-        
+
         // The new schemaObject's OID must not already exist
         checkOidIsUnique( entry );
-        
+
         // Build the new ObjectClass from the given entry
         String schemaName = getSchemaName( dn );
-        
-        ObjectClass objectClass = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), schemaName );
+
+        ObjectClass objectClass = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
 
         // At this point, the constructed ObjectClass has not been checked against the 
         // existing Registries. It may be broken (missing SUP, or such), it will be checked
         // there, if the schema and the ObjectClass are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
-        
+
         if ( schema.isEnabled() &amp;&amp; objectClass.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
 
             clonedRegistries.add( errors, objectClass );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, swap the registries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, objectClass );
+                schemaManager.getRegistries().add( errors, objectClass );
 
                 LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -148,7 +151,15 @@
         {
             // At least, we register the OID in the globalOidRegistry, and associates it with the
             // schema
-            schemaManager.getRegistries().associateWithSchema( objectClass );
+            schemaManager.getRegistries().associateWithSchema( errors, objectClass );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the OjectClass " + entry.getDn().getUpName() + " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            }
 
             LOG.debug( "Added {} into the disabled schema {}", dn.getUpName(), schemaName );
         }
@@ -163,13 +174,14 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=objectclasses,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.OBJECT_CLASS );
-        
+
         // Get the ObjectClass from the given entry ( it has been grabbed from the server earlier)
         String schemaName = getSchemaName( entry.getDn() );
-        ObjectClass objectClass = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), schemaName );
+        ObjectClass objectClass = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
 
         // Applies the Registries to this ObjectClass 
         Schema schema = schemaManager.getLoadedSchema( schemaName );
@@ -178,15 +190,15 @@
         {
             objectClass.applyRegistries( null, schemaManager.getRegistries() );
         }
-        
+
         String oid = objectClass.getOid();
 
         if ( isSchemaEnabled( schemaName ) )
         {
             if ( schemaManager.getRegistries().isReferenced( objectClass ) )
             {
-                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some " +
-                    " dependant SchemaObjects :\n" + getReferenced( objectClass );
+                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some "
+                    + " dependant SchemaObjects :\n" + getReferenced( objectClass );
                 LOG.warn( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -203,22 +215,22 @@
             {
                 schemaManager.getRegistries().delReference( objectClass, may );
             }
-            
+
             // The MUST AttributeTypes
             for ( AttributeType must : objectClass.getMayAttributeTypes() )
             {
                 schemaManager.getRegistries().delReference( objectClass, must );
             }
-            
+
             // The superiors
             for ( ObjectClass superior : objectClass.getSuperiors() )
             {
                 schemaManager.getRegistries().delReference( objectClass, superior );
             }
-            
+
             // Update the Registry
             schemaManager.unregisterObjectClass( objectClass.getOid() );
-            
+
             LOG.debug( "Removed {} from the enabled schema {}", objectClass, schemaName );
         }
         else
@@ -238,26 +250,26 @@
         ObjectClass oldOc = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), schemaName );
 
         // Dependency constraints are not managed by this class
-//        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldOc );
-//        
-//        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
-//        {
-//            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldOc.getOid()
-//                + " cannot be deleted until all entities" 
-//                + " using this objectClass have also been deleted.  The following dependees exist: " 
-//                + getOids( dependees ), 
-//                ResultCodeEnum.UNWILLING_TO_PERFORM );
-//        }
+        //        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldOc );
+        //        
+        //        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
+        //        {
+        //            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldOc.getOid()
+        //                + " cannot be deleted until all entities" 
+        //                + " using this objectClass have also been deleted.  The following dependees exist: " 
+        //                + getOids( dependees ), 
+        //                ResultCodeEnum.UNWILLING_TO_PERFORM );
+        //        }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        
+
         // Inject the new DN
         LdapDN newDn = new LdapDN( targetEntry.getDn() );
         newDn.remove( newDn.size() - 1 );
         newDn.add( newRdn );
-        
+
         checkOidIsUnique( newOid );
         ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
 
@@ -266,12 +278,12 @@
             // Check that the entry has no descendant
             if ( schemaManager.getObjectClassRegistry().hasDescendants( oldOc.getOid() ) )
             {
-                String msg = "Cannot rename " + entry.getDn().getUpName() + " to " + newDn + 
-                    " as the later has descendants' ObjectClasses";
-                
+                String msg = "Cannot rename " + entry.getDn().getUpName() + " to " + newDn
+                    + " as the later has descendants' ObjectClasses";
+
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
-            
+
             schemaManager.unregisterObjectClass( oldOc.getOid() );
             schemaManager.add( oc );
         }
@@ -283,30 +295,31 @@
     }
 
 
-    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn, ServerEntry entry, 
-        boolean cascade ) throws Exception
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
+        ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oldSchemaName = getSchemaName( oriChildName );
         ObjectClass oldOc = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), oldSchemaName );
 
         // this class does not handle dependencies
-//        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldOc );
-//        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
-//        {
-//            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldOc.getOid()
-//                + " cannot be deleted until all entities" 
-//                + " using this objectClass have also been deleted.  The following dependees exist: " 
-//                + getOids( dependees ), 
-//                ResultCodeEnum.UNWILLING_TO_PERFORM );
-//        }
+        //        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldOc );
+        //        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
+        //        {
+        //            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldOc.getOid()
+        //                + " cannot be deleted until all entities" 
+        //                + " using this objectClass have also been deleted.  The following dependees exist: " 
+        //                + getOids( dependees ), 
+        //                ResultCodeEnum.UNWILLING_TO_PERFORM );
+        //        }
 
         String newSchemaName = getSchemaName( newParentName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
         checkOidIsUnique( newOid );
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(), newSchemaName );
+        ObjectClass oc = factory.getObjectClass( schemaManager, targetEntry, schemaManager.getRegistries(),
+            newSchemaName );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
@@ -316,7 +329,7 @@
         {
             unregisterOids( oldOc );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( oc );
@@ -328,8 +341,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oldSchemaName = getSchemaName( oriChildName );
@@ -337,18 +349,18 @@
         ObjectClass oldAt = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), oldSchemaName );
 
         // dependencies are not managed by this class
-//        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldAt );
-//        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
-//        {s
-//            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldAt.getOid() 
-//                + " cannot be deleted until all entities" 
-//                + " using this objectClass have also been deleted.  The following dependees exist: " 
-//                + getOids( dependees ), 
-//                ResultCodeEnum.UNWILLING_TO_PERFORM );
-//        }
+        //        Set&lt;ServerEntry&gt; dependees = dao.listObjectClassDependents( oldAt );
+        //        if ( dependees != null &amp;&amp; dependees.size() &gt; 0 )
+        //        {s
+        //            throw new LdapOperationNotSupportedException( "The objectClass with OID " + oldAt.getOid() 
+        //                + " cannot be deleted until all entities" 
+        //                + " using this objectClass have also been deleted.  The following dependees exist: " 
+        //                + getOids( dependees ), 
+        //                ResultCodeEnum.UNWILLING_TO_PERFORM );
+        //        }
 
         ObjectClass oc = factory.getObjectClass( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
-        
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterObjectClass( oldAt.getOid() );
@@ -357,7 +369,7 @@
         {
             unregisterOids( oldAt );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( oc );
@@ -373,23 +385,24 @@
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a objectClass should be at most 3 name components in length.", 
+            throw new LdapInvalidNameException(
+                "The parent dn of a objectClass should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
-        
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a objectClass should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a objectClass should be an organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a attributeType should have a relative name of ou=objectClasses.", 
+            throw new LdapInvalidNameException(
+                "The parent entry of a attributeType should have a relative name of ou=objectClasses.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java?rev=887284&amp;r1=887283&amp;r2=887284&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java (original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/SyntaxCheckerSynchronizer.java Fri Dec  4 17:34:13 2009
@@ -56,6 +56,7 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( SyntaxCheckerSynchronizer.class );
 
+
     /**
      * Creates a new instance of SyntaxCheckerSynchronizer.
      *
@@ -71,24 +72,26 @@
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade ) throws Exception
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean cascade )
+        throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
         String oid = getOid( entry );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
-        
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
+            .getRegistries(), schemaName );
+
         if ( isSchemaEnabled( schemaName ) )
         {
             syntaxChecker.setSchemaName( schemaName );
 
             schemaManager.unregisterSyntaxChecker( oid );
             schemaManager.add( syntaxChecker );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
 
@@ -107,52 +110,61 @@
 
         // The new schemaObject's OID must not already exist
         checkOidIsUniqueForSyntaxChecker( entry );
-        
+
         // Build the new SyntaxChecker from the given entry
         String schemaName = getSchemaName( dn );
-        
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), schemaName );
+
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
 
         // At this point, the constructed SyntaxChecker has not been checked against the 
         // existing Registries. It will be checked there, if the schema and the 
         // SyntaxChecker are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         if ( schema.isEnabled() &amp;&amp; syntaxChecker.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Inject the newly created SyntaxChecker in the cloned registries
             clonedRegistries.add( errors, syntaxChecker );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, add the SyntaxChecker into the real registries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
-            	schemaManager.getRegistries().add( errors, syntaxChecker );
+                schemaManager.getRegistries().add( errors, syntaxChecker );
+
+                LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
-            
-            LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName );
         }
         else
         {
-            LOG.debug( "The syntaxChecker {} cannot be added in schema {}", dn.getUpName(), schemaName );
-
             // At least, we associates the syntaxChecker with the schema
-            schemaManager.getRegistries().associateWithSchema( syntaxChecker );
+            schemaManager.getRegistries().associateWithSchema( errors, syntaxChecker );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+            }
+
+            LOG.debug( "The syntaxChecker {} cannot be added in schema {}", dn.getUpName(), schemaName );
         }
     }
 
@@ -165,22 +177,23 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=syntaxcheckers,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.SYNTAX_CHECKER );
 
         // Get the SyntaxChecker's instance
         String schemaName = getSchemaName( entry.getDn() );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), schemaName );
-        
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
+
         String oid = syntaxChecker.getOid();
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
             if ( schemaManager.getRegistries().isReferenced( syntaxChecker ) )
             {
-                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some " +
-                    " dependant SchemaObjects :\n" + getReferenced( syntaxChecker );
+                String msg = "Cannot delete " + entry.getDn().getUpName() + ", as there are some "
+                    + " dependant SchemaObjects :\n" + getReferenced( syntaxChecker );
                 LOG.warn( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
             }
@@ -189,7 +202,7 @@
             // be loaded into the schemaManager if it's disabled
             deleteFromSchema( syntaxChecker, schemaName );
         }
-        
+
         // Update the Registries now
         if ( schemaManager.getSyntaxCheckerRegistry().contains( oid ) )
         {
@@ -213,33 +226,33 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "syntaxes using that syntaxChecker have been deleted.", 
+            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid
+                + " cannot have it's OID changed until all " + "syntaxes using that syntaxChecker have been deleted.",
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRdn.getValue();
-        
+
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.", 
+            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
                 ResultCodeEnum.OTHER );
         }
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        
+
         if ( isSchemaEnabled( schemaName ) )
         {
-            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), schemaName );
+            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
+                .getRegistries(), schemaName );
             schemaManager.unregisterSyntaxChecker( oldOid );
             schemaManager.add( syntaxChecker );
         }
     }
 
 
-    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn, 
+    public void moveAndRename( LdapDN oriChildName, LdapDN newParentName, Rdn newRdn, boolean deleteOldRn,
         ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
@@ -249,24 +262,24 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid 
-                + " cannot have it's OID changed until all " 
-                + "syntaxes using that syntaxChecker have been deleted.", 
+            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oldOid
+                + " cannot have it's OID changed until all " + "syntaxes using that syntaxChecker have been deleted.",
                 ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
-        
+
         String newOid = ( String ) newRdn.getValue();
-        
+
         if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
         {
-            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.", 
+            throw new LdapNamingException( "Oid " + newOid + " for new schema syntaxChecker is not unique.",
                 ResultCodeEnum.OTHER );
         }
 
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager.getRegistries(), newSchemaName );
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
+            .getRegistries(), newSchemaName );
 
         if ( isSchemaEnabled( oldSchemaName ) )
         {
@@ -280,8 +293,7 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean cascade ) throws Exception
     {
         checkNewParent( newParentName );
         String oid = getOid( entry );
@@ -290,58 +302,59 @@
 
         if ( schemaManager.getLdapSyntaxRegistry().contains( oid ) )
         {
-            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oid 
-                + " cannot be moved to another schema until all " 
-                + "syntax using that syntaxChecker have been deleted.", 
-                ResultCodeEnum.UNWILLING_TO_PERFORM );
+            throw new LdapOperationNotSupportedException( "The syntaxChecker with OID " + oid
+                + " cannot be moved to another schema until all "
+                + "syntax using that syntaxChecker have been deleted.", ResultCodeEnum.UNWILLING_TO_PERFORM );
         }
 
-        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(), newSchemaName );
-        
+        SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterSyntaxChecker( oid );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( syntaxChecker );
         }
     }
-    
-    
+
+
     private void checkOidIsUniqueForSyntaxChecker( ServerEntry entry ) throws Exception
     {
         String oid = getOid( entry );
-        
+
         if ( schemaManager.getNormalizerRegistry().contains( oid ) )
         {
-            throw new LdapNamingException( "Oid " + oid + " for new schema SyntaxChecker is not unique.", 
+            throw new LdapNamingException( "Oid " + oid + " for new schema SyntaxChecker is not unique.",
                 ResultCodeEnum.OTHER );
         }
     }
 
-    
+
     private void checkNewParent( LdapDN newParent ) throws NamingException
     {
         if ( newParent.size() != 3 )
         {
-            throw new LdapInvalidNameException( 
-                "The parent dn of a syntaxChecker should be at most 3 name components in length.", 
+            throw new LdapInvalidNameException(
+                "The parent dn of a syntaxChecker should be at most 3 name components in length.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
+
         Rdn rdn = newParent.getRdn();
-        if ( ! schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals( SchemaConstants.OU_AT_OID ) )
+        if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
+            SchemaConstants.OU_AT_OID ) )
         {
-            throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should be an organizationalUnit.", 
+            throw new LdapInvalidNameException( "The parent entry of a syntaxChecker should be an organizationalUnit.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
-        
-        if ( ! ( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
+
+        if ( !( ( String ) rdn.getValue() ).equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
         {
-            throw new LdapInvalidNameException( 
-                "The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.", 
+            throw new LdapInvalidNameException(
+                "The parent entry of a normalizer should have a relative name of ou=syntaxCheckers.",
                 ResultCodeEnum.NAMING_VIOLATION );
         }
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887281 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204172820.956FB23889BF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204172820-956FB23889BF@eris-apache-org%3e</id>
<updated>2009-12-04T17:28:19Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 17:28:19 2009
New Revision: 887281

URL: http://svn.apache.org/viewvc?rev=887281&amp;view=rev
Log:
Loaded schema names must be case insensitive

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=887281&amp;r1=887280&amp;r2=887281&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Fri Dec  4 17:28:19 2009
@@ -415,7 +415,7 @@
      */
     public Schema getLoadedSchema( String schemaName )
     {
-        return loadedSchemas.get( schemaName );
+        return loadedSchemas.get( StringTools.toLowerCase( schemaName ) );
     }
 
 
@@ -427,7 +427,7 @@
      */
     public boolean isSchemaLoaded( String schemaName )
     {
-        return loadedSchemas.containsKey( schemaName );
+        return loadedSchemas.containsKey( StringTools.toLowerCase( schemaName ) );
     }
 
 
@@ -1302,7 +1302,7 @@
      */
     public void schemaLoaded( Schema schema )
     {
-        this.loadedSchemas.put( schema.getSchemaName(), schema );
+        this.loadedSchemas.put( StringTools.toLowerCase( schema.getSchemaName() ), schema
);
     }
 
 
@@ -1314,7 +1314,7 @@
      */
     public void schemaUnloaded( Schema schema )
     {
-        this.loadedSchemas.remove( schema.getSchemaName() );
+        this.loadedSchemas.remove( StringTools.toLowerCase( schema.getSchemaName() ) );
     }
 
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887261 - /directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204164755.41C7D23889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204164755-41C7D23889B3@eris-apache-org%3e</id>
<updated>2009-12-04T16:47:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 16:47:54 2009
New Revision: 887261

URL: http://svn.apache.org/viewvc?rev=887261&amp;view=rev
Log:
Schema names must be case insensitive

Modified:
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java?rev=887261&amp;r1=887260&amp;r2=887261&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
Fri Dec  4 16:47:54 2009
@@ -97,7 +97,7 @@
      */
     public Schema getSchema( String schemaName )
     {
-        return this.schemaMap.get( schemaName );
+        return this.schemaMap.get( StringTools.toLowerCase( schemaName ) );
     }
 
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887259 - /directory/apacheds/trunk/pom.xml</title>
<author><name>pamarcelot@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204164409.48C4023889BF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204164409-48C4023889BF@eris-apache-org%3e</id>
<updated>2009-12-04T16:44:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: pamarcelot
Date: Fri Dec  4 16:44:08 2009
New Revision: 887259

URL: http://svn.apache.org/viewvc?rev=887259&amp;view=rev
Log:
Moved to the latest version of Shared.

Modified:
    directory/apacheds/trunk/pom.xml

Modified: directory/apacheds/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/pom.xml?rev=887259&amp;r1=887258&amp;r2=887259&amp;view=diff
==============================================================================
--- directory/apacheds/trunk/pom.xml (original)
+++ directory/apacheds/trunk/pom.xml Fri Dec  4 16:44:08 2009
@@ -39,7 +39,7 @@
     &lt;distMgmtSiteUrl&gt;scpexe://people.apache.org/www/directory.apache.org/apacheds/gen-docs/${version}/&lt;/distMgmtSiteUrl&gt;
 
     &lt;!-- Set versions for depending projects --&gt;
-    &lt;org.apache.directory.shared.version&gt;0.9.16-SNAPSHOT&lt;/org.apache.directory.shared.version&gt;
+    &lt;org.apache.directory.shared.version&gt;0.9.17-SNAPSHOT&lt;/org.apache.directory.shared.version&gt;
     &lt;skin.version&gt;1.0.0&lt;/skin.version&gt;
   &lt;/properties&gt;
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887258 - /directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache.ldif</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204163827.6313223889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204163827-6313223889B3@eris-apache-org%3e</id>
<updated>2009-12-04T16:38:26Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 16:38:25 2009
New Revision: 887258

URL: http://svn.apache.org/viewvc?rev=887258&amp;view=rev
Log:
The 'apache' schema must depend from 'core' too

Modified:
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache.ldif

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache.ldif?rev=887258&amp;r1=887257&amp;r2=887258&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache.ldif
Fri Dec  4 16:38:25 2009
@@ -6,4 +6,5 @@
 objectclass: metaSchema
 objectclass: top
 m-dependencies: system
+m-dependencies: core
 creatorsname: uid=admin,ou=system




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887250 - in /directory/studio/trunk: ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/ ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/</title>
<author><name>pamarcelot@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204162010.2D4E623889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204162010-2D4E623889B3@eris-apache-org%3e</id>
<updated>2009-12-04T16:20:09Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: pamarcelot
Date: Fri Dec  4 16:20:09 2009
New Revision: 887250

URL: http://svn.apache.org/viewvc?rev=887250&amp;view=rev
Log:
Fix for DIRSTUDIO-601 (The 'Perform Search/Search Again' button in the Search Result Editor
does not work correctly).

The previous fix was breaking things, especially the Quick Search.
This new fix should not break anything.

Modified:
    directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java

Modified: directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java?rev=887250&amp;r1=887249&amp;r2=887250&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
(original)
+++ directory/studio/trunk/ldapbrowser-common/src/main/java/org/apache/directory/studio/ldapbrowser/common/actions/RefreshAction.java
Fri Dec  4 16:20:09 2009
@@ -176,9 +176,11 @@
         }
         if ( searchInput != null )
         {
-            searchInput.setSearchResults( null );
+            // the search input is usually a cloned search, lookup the real search from connection
+            ISearch search = searchInput.getBrowserConnection().getSearchManager().getSearch(
searchInput.getName() );
+            search.setSearchResults( null );
             new StudioBrowserJob( new SearchRunnable( new ISearch[]
-                { searchInput } ) ).execute();
+                { search } ) ).execute();
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=887250&amp;r1=887249&amp;r2=887250&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
Fri Dec  4 16:20:09 2009
@@ -162,10 +162,6 @@
             ISearch search = searches[pi];
             ISearch searchToPerform = searchesToPerform[pi];
             
-            // Making sure we have the original search objects and not clones
-            search = search.getBrowserConnection().getSearchManager().getSearch( search.getName()
);
-            searchToPerform = searchToPerform.getBrowserConnection().getSearchManager().getSearch(
searchToPerform.getName() );
-
             monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__search_task,
new String[]
                 { search.getName() } ) );
             monitor.worked( 1 );




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887222 - /directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java</title>
<author><name>pamarcelot@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204151011.7BE0623889B3@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204151011-7BE0623889B3@eris-apache-org%3e</id>
<updated>2009-12-04T15:10:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: pamarcelot
Date: Fri Dec  4 15:10:10 2009
New Revision: 887222

URL: http://svn.apache.org/viewvc?rev=887222&amp;view=rev
Log:
Fix for DIRSTUDIO-601 (The 'Perform Search/Search Again' button in the Search Result Editor
does not work correctly).

Modified:
    directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java

Modified: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?rev=887222&amp;r1=887221&amp;r2=887222&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
(original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java
Fri Dec  4 15:10:10 2009
@@ -161,6 +161,10 @@
         {
             ISearch search = searches[pi];
             ISearch searchToPerform = searchesToPerform[pi];
+            
+            // Making sure we have the original search objects and not clones
+            search = search.getBrowserConnection().getSearchManager().getSearch( search.getName()
);
+            searchToPerform = searchToPerform.getBrowserConnection().getSearchManager().getSearch(
searchToPerform.getName() );
 
             monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__search_task,
new String[]
                 { search.getName() } ) );




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887208 - in /directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl: GreaterEqTest.java LessEqTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204142931.3752C23889DA@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204142931-3752C23889DA@eris-apache-org%3e</id>
<updated>2009-12-04T14:29:30Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 14:29:29 2009
New Revision: 887208

URL: http://svn.apache.org/viewvc?rev=887208&amp;view=rev
Log:
Fixed tests by injecting all the schemaObject in the SchemaManager

Modified:
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
    directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java?rev=887208&amp;r1=887207&amp;r2=887208&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/GreaterEqTest.java
Fri Dec  4 14:29:29 2009
@@ -46,6 +46,7 @@
 import org.apache.directory.shared.ldap.filter.GreaterEqNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
@@ -73,7 +74,6 @@
 {
     public static final Logger LOG = LoggerFactory.getLogger( GreaterEqTest.class );
 
-
     File wkdir;
     Store&lt;ServerEntry&gt; store;
     static SchemaManager schemaManager = null;
@@ -83,7 +83,7 @@
     public static void setup() throws Exception
     {
         // setup the standard registries
-    	String workingDirectory = System.getProperty( "workingDirectory" );
+        String workingDirectory = System.getProperty( "workingDirectory" );
 
         if ( workingDirectory == null )
         {
@@ -104,9 +104,9 @@
         {
             fail( "Schema load failed : " + ExceptionUtils.printErrors( schemaManager.getErrors()
) );
         }
-        
+
         loaded = schemaManager.loadWithDeps( loader.getSchema( "collective" ) );
-        
+
         if ( !loaded )
         {
             fail( "Schema load failed : " + ExceptionUtils.printErrors( schemaManager.getErrors()
) );
@@ -173,8 +173,14 @@
 
         // ---------- test bad get() ----------
 
-        try { cursor.get(); fail(); }
-        catch( InvalidCursorPositionException e ) {}
+        try
+        {
+            cursor.get();
+            fail();
+        }
+        catch ( InvalidCursorPositionException e )
+        {
+        }
 
         // ---------- test beforeFirst() ----------
 
@@ -301,7 +307,7 @@
         // ---------- test before() ----------
 
         cursor = new GreaterEqCursor( store, evaluator );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         indexEntry.setValue( "5" );
 
         assertFalse( cursor.available() );
@@ -324,7 +330,7 @@
         assertTrue( cursor.isClosed() );
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "7" );
         cursor.before( indexEntry );
         assertFalse( cursor.available() );
@@ -334,7 +340,7 @@
         cursor.close();
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "3" );
         cursor.before( indexEntry );
         assertFalse( cursor.available() );
@@ -346,7 +352,7 @@
         // ---------- test after() ----------
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "4" );
 
         assertFalse( cursor.available() );
@@ -369,7 +375,7 @@
         assertTrue( cursor.isClosed() );
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "7" );
         cursor.after( indexEntry );
         assertFalse( cursor.available() );
@@ -379,7 +385,7 @@
         cursor.close();
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "3" );
         cursor.after( indexEntry );
         assertFalse( cursor.available() );
@@ -404,8 +410,14 @@
 
         // ---------- test bad get() ----------
 
-        try { cursor.get(); fail(); }
-        catch( InvalidCursorPositionException e ) {}
+        try
+        {
+            cursor.get();
+            fail();
+        }
+        catch ( InvalidCursorPositionException e )
+        {
+        }
 
         // ---------- test beforeFirst() ----------
 
@@ -527,18 +539,30 @@
         // ---------- test before() ----------
 
         cursor = new GreaterEqCursor( store, evaluator );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         indexEntry.setValue( "2" );
-        try { cursor.before( indexEntry ); fail( "Should never get here." );}
-        catch ( UnsupportedOperationException e ) {}
+        try
+        {
+            cursor.before( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+        }
 
         // ---------- test after() ----------
 
         cursor = new GreaterEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "2" );
-        try { cursor.after( indexEntry ); fail( "Should never get here." );}
-        catch ( UnsupportedOperationException e ) {}
+        try
+        {
+            cursor.after( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+        }
     }
 
 
@@ -546,14 +570,13 @@
     // Evaluator Test Cases
     // -----------------------------------------------------------------------
 
-
     @Test
     public void testEvaluatorIndexed() throws Exception
     {
         AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.POSTALCODE_AT_OID
);
         GreaterEqNode node = new GreaterEqNode( SchemaConstants.POSTALCODE_AT_OID, new ServerStringValue(
at, "3" ) );
         GreaterEqEvaluator evaluator = new GreaterEqEvaluator( node, store, schemaManager
);
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.POSTALCODE_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -562,31 +585,31 @@
         indexEntry.setId( 1L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 4L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 5L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 6L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 7L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 8L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 9L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 10L );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
@@ -598,7 +621,7 @@
         AttributeType at = schemaManager.lookupAttributeTypeRegistry( SchemaConstants.STREET_AT_OID
);
         GreaterEqNode node = new GreaterEqNode( SchemaConstants.STREET_AT_OID, new ServerStringValue(
at, "2" ) );
         GreaterEqEvaluator evaluator = new GreaterEqEvaluator( node, store, schemaManager
);
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.STREET_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -613,7 +636,7 @@
         attrs.add( "sn", "doe" );
         attrs.add( "entryCSN", new CsnFactory( 1 ).newInstance().toString() );
         attrs.add( "entryUUID", SchemaUtils.uuidToBytes( UUID.randomUUID() ) );
-        store.add(  attrs );
+        store.add( attrs );
 
         indexEntry.setId( 12L );
         assertTrue( evaluator.evaluate( indexEntry ) );
@@ -627,7 +650,7 @@
         GreaterEqNode node = new GreaterEqNode( SchemaConstants.C_POSTALCODE_AT_OID, new
ServerStringValue( at, "2" ) );
 
         GreaterEqEvaluator evaluator = new GreaterEqEvaluator( node, store, schemaManager
);
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.C_POSTALCODE_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -645,7 +668,7 @@
         GreaterEqNode node = new GreaterEqNode( SchemaConstants.POSTOFFICEBOX_AT_OID, new
ServerStringValue( at, "3" ) );
 
         GreaterEqEvaluator evaluator = new GreaterEqEvaluator( node, store, schemaManager
);
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.POSTOFFICEBOX_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -654,54 +677,47 @@
         indexEntry.setId( 1L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 4L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 5L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 6L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 7L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 8L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 9L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 10L );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
 
-    @Test ( expected = IllegalStateException.class )
+    @Test(expected = IllegalStateException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
+        LdapSyntax syntax = new BogusSyntax( 1 );
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000"
);
         at.addName( "bogus" );
         at.setSchemaName( "other" );
-        at.setSyntax( new BogusSyntax( 1 ) );
-        
+        at.setSyntax( syntax );
+
+        schemaManager.add( syntax );
         schemaManager.add( at );
-        schemaManager.add( at.getSyntax() );
-        SyntaxCheckerDescription desc = new SyntaxCheckerDescription( at.getSyntax().getOid()
);
-        desc.setDescription( "bogus" );
-        desc.setFqcn( BogusSyntax.class.getName() );
-        List&lt;String&gt; names = new ArrayList&lt;String&gt;();
-        names.add( "bogus" );
-        desc.setNames( names );
-        desc.setObsolete( false );
-        //schemaManager.register( at.getSyntax().getSyntaxChecker() );
 
         GreaterEqNode node = new GreaterEqNode( at.getOid(), new ServerStringValue( at, "3"
) );
         new GreaterEqEvaluator( node, store, schemaManager );
@@ -715,15 +731,17 @@
         MatchingRule mr = new MatchingRule( "1.1" );
         mr.setSyntax( new BogusSyntax( 1 ) );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
-        
+
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".5000"
);
         at.addName( "bogus" );
         at.setSchemaName( "other" );
         at.setSyntax( new BogusSyntax( 2 ) );
         at.setOrdering( mr );
-            
-        schemaManager.add( at );
+
         schemaManager.add( at.getSyntax() );
+        schemaManager.add( mr );
+        schemaManager.add( at );
+
         SyntaxCheckerDescription desc = new SyntaxCheckerDescription( at.getSyntax().getOid()
);
         desc.setDescription( "bogus" );
         desc.setFqcn( BogusSyntax.class.getName() );

Modified: directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java?rev=887208&amp;r1=887207&amp;r2=887208&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
(original)
+++ directory/apacheds/branches/apacheds-schema/xdbm-search/src/test/java/org/apache/directory/server/xdbm/search/impl/LessEqTest.java
Fri Dec  4 14:29:29 2009
@@ -46,6 +46,7 @@
 import org.apache.directory.shared.ldap.filter.LessEqNode;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.schema.LdapSyntax;
 import org.apache.directory.shared.ldap.schema.MatchingRule;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SchemaUtils;
@@ -73,7 +74,6 @@
 {
     public static final Logger LOG = LoggerFactory.getLogger( LessEqTest.class );
 
-
     File wkdir;
     Store&lt;ServerEntry&gt; store;
     static SchemaManager schemaManager = null;
@@ -104,16 +104,16 @@
         {
             fail( "Schema load failed : " + ExceptionUtils.printErrors( schemaManager.getErrors()
) );
         }
-        
+
         loaded = schemaManager.loadWithDeps( loader.getSchema( "collective" ) );
-        
+
         if ( !loaded )
         {
             fail( "Schema load failed : " + ExceptionUtils.printErrors( schemaManager.getErrors()
) );
         }
     }
 
-    
+
     @Before
     public void createStore() throws Exception
     {
@@ -173,8 +173,14 @@
 
         // ---------- test bad get() ----------
 
-        try { cursor.get(); fail(); }
-        catch( InvalidCursorPositionException e ) {}
+        try
+        {
+            cursor.get();
+            fail();
+        }
+        catch ( InvalidCursorPositionException e )
+        {
+        }
 
         // ---------- test beforeFirst() ----------
 
@@ -321,7 +327,7 @@
         // ---------- test before() ----------
 
         cursor = new LessEqCursor( store, evaluator );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         indexEntry.setValue( "2" );
 
         assertFalse( cursor.available() );
@@ -344,7 +350,7 @@
         assertTrue( cursor.isClosed() );
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "7" );
         cursor.before( indexEntry );
         assertFalse( cursor.available() );
@@ -354,7 +360,7 @@
         cursor.close();
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "3" );
         cursor.before( indexEntry );
         assertFalse( cursor.available() );
@@ -366,7 +372,7 @@
         // ---------- test after() ----------
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "1" );
 
         assertFalse( cursor.available() );
@@ -389,7 +395,7 @@
         assertTrue( cursor.isClosed() );
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "7" );
         cursor.after( indexEntry );
         assertFalse( cursor.available() );
@@ -399,7 +405,7 @@
         cursor.close();
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "3" );
         cursor.after( indexEntry );
         assertFalse( cursor.available() );
@@ -424,8 +430,14 @@
 
         // ---------- test bad get() ----------
 
-        try { cursor.get(); fail(); }
-        catch( InvalidCursorPositionException e ) {}
+        try
+        {
+            cursor.get();
+            fail();
+        }
+        catch ( InvalidCursorPositionException e )
+        {
+        }
 
         // ---------- test beforeFirst() ----------
 
@@ -567,18 +579,30 @@
         // ---------- test before() ----------
 
         cursor = new LessEqCursor( store, evaluator );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         indexEntry.setValue( "2" );
-        try { cursor.before( indexEntry ); fail( "Should never get here." );}
-        catch ( UnsupportedOperationException e ) {}
+        try
+        {
+            cursor.before( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+        }
 
         // ---------- test after() ----------
 
         cursor = new LessEqCursor( store, evaluator );
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setValue( "2" );
-        try { cursor.after( indexEntry ); fail( "Should never get here." );}
-        catch ( UnsupportedOperationException e ) {}
+        try
+        {
+            cursor.after( indexEntry );
+            fail( "Should never get here." );
+        }
+        catch ( UnsupportedOperationException e )
+        {
+        }
     }
 
 
@@ -586,7 +610,6 @@
     // Evaluator Test Cases
     // -----------------------------------------------------------------------
 
-
     @Test
     public void testEvaluatorIndexed() throws Exception
     {
@@ -594,7 +617,7 @@
         LessEqNode node = new LessEqNode( SchemaConstants.POSTALCODE_AT_OID, new ServerStringValue(
at, "3" ) );
 
         LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.POSTALCODE_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -603,31 +626,31 @@
         indexEntry.setId( 1L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 4L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 5L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 6L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 7L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 8L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 9L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 10L );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
@@ -640,7 +663,7 @@
         LessEqNode node = new LessEqNode( SchemaConstants.STREET_AT_OID, new ServerStringValue(
at, "2" ) );
 
         LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.STREET_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -649,7 +672,7 @@
         LdapDN dn = new LdapDN( "cn=jane doe,o=good times co." );
         dn.normalize( schemaManager.getNormalizerMapping() );
         ServerEntry attrs = new DefaultServerEntry( schemaManager, dn );
-        attrs.add(  "objectClass", "person" );
+        attrs.add( "objectClass", "person" );
         attrs.add( "c-street", "1" );
         attrs.add( "cn", "jane doe" );
         attrs.add( "sn", "doe" );
@@ -669,7 +692,7 @@
         LessEqNode node = new LessEqNode( SchemaConstants.C_POSTALCODE_AT_OID, new ServerStringValue(
at, "2" ) );
 
         LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.C_POSTALCODE_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -687,7 +710,7 @@
         LessEqNode node = new LessEqNode( SchemaConstants.POSTOFFICEBOX_AT_OID, new ServerStringValue(
at, "3" ) );
 
         LessEqEvaluator evaluator = new LessEqEvaluator( node, store, schemaManager );
-        ForwardIndexEntry&lt;String,ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        ForwardIndexEntry&lt;String, ServerEntry&gt; indexEntry = new ForwardIndexEntry&lt;String,
ServerEntry&gt;();
         assertEquals( node, evaluator.getExpression() );
         assertEquals( SchemaConstants.POSTOFFICEBOX_AT_OID, evaluator.getAttributeType().getOid()
);
         assertNotNull( evaluator.getNormalizer() );
@@ -696,44 +719,46 @@
         indexEntry.setId( 1L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 4L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 5L );
         assertTrue( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 6L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 7L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 8L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 9L );
         assertFalse( evaluator.evaluate( indexEntry ) );
 
-        indexEntry = new ForwardIndexEntry&lt;String,ServerEntry&gt;();
+        indexEntry = new ForwardIndexEntry&lt;String, ServerEntry&gt;();
         indexEntry.setId( 10L );
         assertFalse( evaluator.evaluate( indexEntry ) );
     }
 
 
-    @Test ( expected = IllegalStateException.class )
+    @Test(expected = IllegalStateException.class)
     public void testEvaluatorAttributeNoMatchingRule() throws Exception
     {
+        LdapSyntax syntax = new BogusSyntax( 1 );
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".2000"
);
         at.addName( "bogus" );
         at.setSchemaName( "other" );
-        at.setSyntax( new BogusSyntax( 1 ) );
-        
+        at.setSyntax( syntax );
+
+        schemaManager.add( syntax );
         schemaManager.add( at );
 
         LessEqNode node = new LessEqNode( at.getOid(), new ServerStringValue( at, "3" ) );
@@ -749,15 +774,17 @@
         MatchingRule mr = new MatchingRule( "1.1" );
         mr.setSyntax( new BogusSyntax( 2 ) );
         mr.setLdapComparator( new StringComparator( "1.1" ) );
-        
+
         AttributeType at = new AttributeType( SchemaConstants.ATTRIBUTE_TYPES_AT_OID + ".3000"
);
         at.addName( "bogus" );
         at.setSchemaName( "other" );
-        at.setSyntax( new BogusSyntax(3) );
+        at.setSyntax( new BogusSyntax( 3 ) );
         at.setOrdering( mr );
 
-        schemaManager.add( at );
         schemaManager.add( at.getSyntax() );
+        schemaManager.add( mr );
+        schemaManager.add( at );
+
         SyntaxCheckerDescription desc = new SyntaxCheckerDescription( at.getSyntax().getOid()
);
         desc.setDescription( "bogus" );
         desc.setFqcn( BogusSyntax.class.getName() );




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887206 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204142844.31909238899B@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204142844-31909238899B@eris-apache-org%3e</id>
<updated>2009-12-04T14:28:43Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 14:28:43 2009
New Revision: 887206

URL: http://svn.apache.org/viewvc?rev=887206&amp;view=rev
Log:
The SchemaObject is now copied in the SchemaManager.add() method, otherwise the caller will
see it modified by the method. It was bad.

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=887206&amp;r1=887205&amp;r2=887206&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Fri Dec  4 14:28:43 2009
@@ -1191,10 +1191,13 @@
         // First, clear the errors
         errors.clear();
 
+        // Clone the schemaObject
+        SchemaObject copy = schemaObject.copy();
+
         if ( registries.isRelaxed() )
         {
             // Apply the addition right away
-            registries.add( errors, schemaObject );
+            registries.add( errors, copy );
 
             return errors.isEmpty();
         }
@@ -1202,13 +1205,13 @@
         {
             // Clone, apply, check, then apply again if ok
             // The new schemaObject's OID must not already exist
-            if ( !checkOidIsUnique( schemaObject ) )
+            if ( !checkOidIsUnique( copy ) )
             {
                 return false;
             }
 
             // Build the new AttributeType from the given entry
-            String schemaName = getSchemaName( schemaObject );
+            String schemaName = getSchemaName( copy );
 
             // At this point, the constructed AttributeType has not been checked against
the 
             // existing Registries. It may be broken (missing SUP, or such), it will be checked
@@ -1218,7 +1221,7 @@
             if ( schema == null )
             {
                 // The SchemaObject must be associated with an existing schema
-                String msg = "Cannot inject the SchemaObject " + schemaObject.getOid()
+                String msg = "Cannot inject the SchemaObject " + copy.getOid()
                     + " as it's not associated with a schema";
                 LOG.info( msg );
                 Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.OTHER
);
@@ -1226,13 +1229,13 @@
                 return false;
             }
 
-            if ( schema.isEnabled() &amp;&amp; schemaObject.isEnabled() )
+            if ( schema.isEnabled() &amp;&amp; copy.isEnabled() )
             {
                 // As we may break the registries, work on a cloned registries
                 Registries clonedRegistries = registries.clone();
 
                 // Inject the new SchemaObject in the cloned registries
-                clonedRegistries.add( errors, schemaObject );
+                clonedRegistries.add( errors, copy );
 
                 // Remove the cloned registries
                 clonedRegistries.clear();
@@ -1241,16 +1244,16 @@
                 if ( errors.isEmpty() )
                 {
                     // Apply the addition to the real registries
-                    registries.add( errors, schemaObject );
+                    registries.add( errors, copy );
 
-                    LOG.debug( "Added {} into the enabled schema {}", schemaObject.getName(),
schemaName );
+                    LOG.debug( "Added {} into the enabled schema {}", copy.getName(), schemaName
);
 
                     return true;
                 }
                 else
                 {
                     // We have some error : reject the addition and get out
-                    String msg = "Cannot add the SchemaObject " + schemaObject.getOid() +
" into the registries, "
+                    String msg = "Cannot add the SchemaObject " + copy.getOid() + " into
the registries, "
                         + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                     LOG.info( msg );
 
@@ -1261,9 +1264,9 @@
             {
                 // At least, we register the OID in the globalOidRegistry, and associates
it with the
                 // schema
-                registries.associateWithSchema( errors, schemaObject );
+                registries.associateWithSchema( errors, copy );
 
-                LOG.debug( "Added {} into the disabled schema {}", schemaObject.getName(),
schemaName );
+                LOG.debug( "Added {} into the disabled schema {}", copy.getName(), schemaName
);
                 return errors.isEmpty();
             }
         }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887189 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204133947.77AE02388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204133947-77AE02388962@eris-apache-org%3e</id>
<updated>2009-12-04T13:39:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 13:39:46 2009
New Revision: 887189

URL: http://svn.apache.org/viewvc?rev=887189&amp;view=rev
Log:
Injected the SchemaManager into the Normalizers

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java?rev=887189&amp;r1=887188&amp;r2=887189&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/loader/ldif/SchemaEntityFactory.java
Fri Dec  4 13:39:46 2009
@@ -72,28 +72,30 @@
  */
 public class SchemaEntityFactory implements EntityFactory
 {
-	/** Slf4j logger */
-	private final static Logger LOG = LoggerFactory.getLogger( SchemaEntityFactory.class );
+    /** Slf4j logger */
+    private final static Logger LOG = LoggerFactory.getLogger( SchemaEntityFactory.class
);
+
+    /** for fast debug checks */
+    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
-	/** for fast debug checks */
-	private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-	
     /** Used for looking up the setRegistries(Registries) method */
-    private final static Class&lt;?&gt;[] parameterTypes = new Class[] { Registries.class
};
-    
+    private final static Class&lt;?&gt;[] parameterTypes = new Class[]
+        { Registries.class };
+
     private static final List&lt;String&gt; EMPTY_LIST = new ArrayList&lt;String&gt;();
-    private static final String[] EMPTY_ARRAY = new String[] {};
-    
+    private static final String[] EMPTY_ARRAY = new String[]
+        {};
+
     /** A special ClassLoader that loads a class from the bytecode attribute */
     private final AttributeClassLoader classLoader;
-    
-    
+
+
     public SchemaEntityFactory() throws Exception
     {
         this.classLoader = new AttributeClassLoader();
     }
-    
-    
+
+
     /**
      * Get an OID from an entry. Handles the bad cases (null OID, 
      * not a valid OID, ...)
@@ -102,29 +104,28 @@
     {
         // The OID
         EntryAttribute mOid = entry.get( MetaSchemaConstants.M_OID_AT );
-        
+
         if ( mOid == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_OID_AT + " attribute, it's null";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_OID_AT
+                + " attribute, it's null";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
 
         String oid = mOid.getString();
-        
+
         if ( !OID.isOID( oid ) )
         {
-            String msg = "Comparator OID " + oid + " is not a valid OID "; 
+            String msg = "Comparator OID " + oid + " is not a valid OID ";
             LOG.warn( msg );
-            throw new LdapInvalidAttributeValueException( msg,
-                ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            throw new LdapInvalidAttributeValueException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX
);
         }
-        
+
         return oid;
     }
-    
-    
+
+
     /**
      * Get an OID from an entry. Handles the bad cases (null OID, 
      * not a valid OID, ...)
@@ -133,27 +134,26 @@
     {
         // The OID
         String oid = description.getOid();
-        
+
         if ( oid == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_OID_AT + " attribute, it's null";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_OID_AT
+                + " attribute, it's null";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
 
         if ( !OID.isOID( oid ) )
         {
-            String msg = "Comparator OID " + oid + " is not a valid OID "; 
+            String msg = "Comparator OID " + oid + " is not a valid OID ";
             LOG.warn( msg );
-            throw new LdapInvalidAttributeValueException( msg,
-                ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            throw new LdapInvalidAttributeValueException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX
);
         }
-        
+
         return oid;
     }
 
-    
+
     /**
      * Check that the Entry is not null
      */
@@ -167,7 +167,7 @@
         }
     }
 
-    
+
     /**
      * Check that the Description is not null
      */
@@ -181,7 +181,7 @@
         }
     }
 
-    
+
     /**
      * Get the schema from its name. Return the Other reference if there
      * is no schema name. Throws a NPE if the schema is not loaded.
@@ -194,17 +194,17 @@
         }
 
         Schema schema = registries.getLoadedSchema( schemaName );
-        
+
         if ( schema == null )
         {
             String msg = "The schema " + schemaName + " does not exists or is not loaded";
             LOG.error( msg );
         }
-        
+
         return schema;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -214,55 +214,55 @@
         String owner;
         String[] dependencies = EMPTY_ARRAY;
         boolean isDisabled = false;
-        
+
         if ( entry == null )
         {
             throw new NullPointerException( "entry cannot be null" );
         }
-        
+
         if ( entry.get( SchemaConstants.CN_AT ) == null )
         {
             throw new NullPointerException( "entry must have a valid cn attribute" );
         }
-        
+
         name = entry.get( SchemaConstants.CN_AT ).getString();
-        
+
         if ( entry.get( SchemaConstants.CREATORS_NAME_AT ) == null )
         {
-            throw new NullPointerException( "entry must have a valid " 
-                + SchemaConstants.CREATORS_NAME_AT + " attribute" );
+            throw new NullPointerException( "entry must have a valid " + SchemaConstants.CREATORS_NAME_AT
+                + " attribute" );
         }
-        
+
         owner = entry.get( SchemaConstants.CREATORS_NAME_AT ).getString();
-        
+
         if ( entry.get( MetaSchemaConstants.M_DISABLED_AT ) != null )
         {
             String value = entry.get( MetaSchemaConstants.M_DISABLED_AT ).getString();
             value = value.toUpperCase();
             isDisabled = value.equals( "TRUE" );
         }
-        
+
         if ( entry.get( MetaSchemaConstants.M_DEPENDENCIES_AT ) != null )
         {
             Set&lt;String&gt; depsSet = new HashSet&lt;String&gt;();
             EntryAttribute depsAttr = entry.get( MetaSchemaConstants.M_DEPENDENCIES_AT );
-            
-            for ( Value&lt;?&gt; value:depsAttr )
+
+            for ( Value&lt;?&gt; value : depsAttr )
             {
                 depsSet.add( value.getString() );
             }
 
             dependencies = depsSet.toArray( EMPTY_ARRAY );
         }
-        
+
         return new DefaultSchema( name, owner, dependencies, isDisabled );
     }
-    
-    
+
+
     /**
      * Class load a syntaxChecker instance
      */
-    private SyntaxChecker classLoadSyntaxChecker( SchemaManager schemaManager, String oid,
String className, 
+    private SyntaxChecker classLoadSyntaxChecker( SchemaManager schemaManager, String oid,
String className,
         EntryAttribute byteCode, Registries targetRegistries ) throws Exception
     {
         // Try to class load the syntaxChecker
@@ -280,28 +280,29 @@
             clazz = classLoader.loadClass( className );
             byteCodeStr = new String( Base64.encode( byteCode.getBytes() ) );
         }
-        
+
         // Create the syntaxChecker instance
         syntaxChecker = ( SyntaxChecker ) clazz.newInstance();
-        
+
         // Update the common fields
         syntaxChecker.setBytecode( byteCodeStr );
         syntaxChecker.setFqcn( className );
-        
+
         // Inject the new OID, as the loaded syntaxChecker might have its own
         syntaxChecker.setOid( oid );
 
         return syntaxChecker;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public SyntaxChecker getSyntaxChecker( SchemaManager schemaManager, Entry entry, Registries
targetRegistries, String schemaName ) throws Exception
+    public SyntaxChecker getSyntaxChecker( SchemaManager schemaManager, Entry entry, Registries
targetRegistries,
+        String schemaName ) throws Exception
     {
         checkEntry( entry, SchemaConstants.SYNTAX_CHECKER );
-        
+
         // The SyntaxChecker OID
         String oid = getOid( entry, SchemaConstants.SYNTAX_CHECKER );
 
@@ -309,84 +310,84 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested Normalizer
-            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + ",
as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + ",
as the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + "
into the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + "
into the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
 
         // The FQCN
         String className = getFqcn( entry, SchemaConstants.SYNTAX_CHECKER );
-        
+
         // The ByteCode
         EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );
-            
+
         // Class load the syntaxChecker
         SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, className,
byteCode, targetRegistries );
-        
+
         // Update the common fields
         setSchemaObjectProperties( syntaxChecker, entry, schema );
-        
+
         // return the resulting syntaxChecker
         return syntaxChecker;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public SyntaxChecker getSyntaxChecker( SchemaManager schemaManager, SyntaxCheckerDescription
syntaxCheckerDescription, 
-        Registries targetRegistries, String schemaName ) throws Exception
+    public SyntaxChecker getSyntaxChecker( SchemaManager schemaManager,
+        SyntaxCheckerDescription syntaxCheckerDescription, Registries targetRegistries, String
schemaName )
+        throws Exception
     {
         checkDescription( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );
-        
+
         // The Comparator OID
         String oid = getOid( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );
-        
+
         // Get the schema
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is not loaded. We can't create the requested SyntaxChecker
-            String msg = "Cannot add the SyntaxChecker " + syntaxCheckerDescription.getName()
+ ", as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the SyntaxChecker " + syntaxCheckerDescription.getName()
+                + ", as the associated schema (" + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         // The FQCN
         String fqcn = getFqcn( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER );
-        
+
         // get the byteCode
         EntryAttribute byteCode = getByteCode( syntaxCheckerDescription, SchemaConstants.SYNTAX_CHECKER
);
-        
+
         // Class load the SyntaxChecker
-        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, 
-            fqcn, byteCode, targetRegistries );
-        
+        SyntaxChecker syntaxChecker = classLoadSyntaxChecker( schemaManager, oid, fqcn, byteCode,
targetRegistries );
+
         // Update the common fields
         setSchemaObjectProperties( syntaxChecker, syntaxCheckerDescription, schema );
-        
+
         return syntaxChecker;
     }
-    
-    
+
+
     /**
      * Class load a comparator instances
      */
-    private LdapComparator&lt;?&gt; classLoadComparator( SchemaManager schemaManager, String
oid, String className, 
+    private LdapComparator&lt;?&gt; classLoadComparator( SchemaManager schemaManager, String
oid, String className,
         EntryAttribute byteCode, Registries targetRegistries ) throws Exception
     {
         // Try to class load the comparator
@@ -394,7 +395,7 @@
         Class&lt;?&gt; clazz = null;
         String byteCodeStr = StringTools.EMPTY;
 
-        if ( byteCode == null ) 
+        if ( byteCode == null )
         {
             clazz = Class.forName( className );
         }
@@ -404,136 +405,134 @@
             clazz = classLoader.loadClass( className );
             byteCodeStr = new String( Base64.encode( byteCode.getBytes() ) );
         }
-        
+
         // Create the comparator instance. Either we have a no argument constructor,
         // or we have one which takes an OID. Lets try the one with an OID argument first
         try
         {
-            Constructor&lt;?&gt; constructor = clazz.getConstructor( new Class[]{String.class}
);
-            comparator = ( LdapComparator&lt;?&gt; )constructor.newInstance( new Object[]{
oid } );
+            Constructor&lt;?&gt; constructor = clazz.getConstructor( new Class[]
+                { String.class } );
+            comparator = ( LdapComparator&lt;?&gt; ) constructor.newInstance( new Object[]
+                { oid } );
         }
         catch ( NoSuchMethodException nsme )
         {
             // Ok, let's try with the constructor without argument
             Constructor&lt;?&gt; constructor = clazz.getConstructor();
-            comparator = ( LdapComparator&lt;?&gt; )clazz.newInstance();
+            comparator = ( LdapComparator&lt;?&gt; ) clazz.newInstance();
         }
 
         // Update the loadable fields
         comparator.setBytecode( byteCodeStr );
         comparator.setFqcn( className );
-        
-        // Inject the SchemaManager for the comparator who need it
+
+        // Inject the SchemaManager for the comparator who needs it
         comparator.setSchemaManager( schemaManager );
-        
-        // Inject the new OID, as the loaded comparator might have its own
-        //comparator.setOid( oid );
-        
+
         return comparator;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public LdapComparator&lt;?&gt; getLdapComparator( SchemaManager schemaManager, 
-        LdapComparatorDescription comparatorDescription, 
-        Registries targetRegistries, String schemaName ) throws Exception
+    public LdapComparator&lt;?&gt; getLdapComparator( SchemaManager schemaManager,
+        LdapComparatorDescription comparatorDescription, Registries targetRegistries, String
schemaName )
+        throws Exception
     {
         checkDescription( comparatorDescription, SchemaConstants.COMPARATOR );
-        
+
         // The Comparator OID
         String oid = getOid( comparatorDescription, SchemaConstants.COMPARATOR );
-        
+
         // Get the schema
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is not loaded. We can't create the requested Comparator
-            String msg = "Cannot add the Comparator " + comparatorDescription.getName() +
", as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the Comparator " + comparatorDescription.getName()
+                + ", as the associated schema (" + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
 
         // The FQCN
         String fqcn = getFqcn( comparatorDescription, SchemaConstants.COMPARATOR );
-        
+
         // get the byteCode
         EntryAttribute byteCode = getByteCode( comparatorDescription, SchemaConstants.COMPARATOR
);
-        
+
         // Class load the comparator
-        LdapComparator&lt;?&gt; comparator = classLoadComparator( schemaManager, oid, 
-            fqcn, byteCode, targetRegistries );
-        
+        LdapComparator&lt;?&gt; comparator = classLoadComparator( schemaManager, oid, fqcn,
byteCode, targetRegistries );
+
         // Update the common fields
         setSchemaObjectProperties( comparator, comparatorDescription, schema );
-        
+
         return comparator;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public LdapComparator&lt;?&gt; getLdapComparator( SchemaManager schemaManager, 
-        Entry entry, Registries targetRegistries, String schemaName ) throws Exception
+    public LdapComparator&lt;?&gt; getLdapComparator( SchemaManager schemaManager, Entry
entry, Registries targetRegistries,
+        String schemaName ) throws Exception
     {
         checkEntry( entry, SchemaConstants.COMPARATOR );
-        
+
         // The Comparator OID
         String oid = getOid( entry, SchemaConstants.COMPARATOR );
-        
+
         // Get the schema
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested Comparator
-            String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + ", as
the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + ", as
the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
-        
+
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + " into
the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the Comparator " + entry.getDn().getUpName() + " into
the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
 
         // The FQCN
         String fqcn = getFqcn( entry, SchemaConstants.COMPARATOR );
-        
+
         // The ByteCode
         EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );
-            
+
         // Class load the comparator
         LdapComparator&lt;?&gt; comparator = classLoadComparator( schemaManager, oid, fqcn,
byteCode, targetRegistries );
-        
+
         // Update the common fields
         setSchemaObjectProperties( comparator, entry, schema );
-        
+
         // return the resulting comparator
         return comparator;
     }
-    
-    
+
+
     /**
      * Class load a normalizer instances
      */
-    private Normalizer classLoadNormalizer( SchemaManager schemaManager, String oid, String
className, 
+    private Normalizer classLoadNormalizer( SchemaManager schemaManager, String oid, String
className,
         EntryAttribute byteCode, Registries targetRegistries ) throws Exception
     {
         // Try to class load the normalizer
         Class&lt;?&gt; clazz = null;
         Normalizer normalizer = null;
         String byteCodeStr = StringTools.EMPTY;
-        
+
         if ( byteCode == null )
         {
             clazz = Class.forName( className );
@@ -551,62 +550,64 @@
         // Update the common fields
         normalizer.setBytecode( byteCodeStr );
         normalizer.setFqcn( className );
-        
+
         // Inject the new OID, as the loaded normalizer might have its own
         normalizer.setOid( oid );
-        
+
+        // Inject the SchemaManager for the normalizer who needs it
+        normalizer.setSchemaManager( schemaManager );
+
         return normalizer;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public Normalizer getNormalizer( SchemaManager schemaManager, 
-        NormalizerDescription normalizerDescription, 
+    public Normalizer getNormalizer( SchemaManager schemaManager, NormalizerDescription normalizerDescription,
         Registries targetRegistries, String schemaName ) throws Exception
     {
         checkDescription( normalizerDescription, SchemaConstants.NORMALIZER );
-        
+
         // The Comparator OID
         String oid = getOid( normalizerDescription, SchemaConstants.NORMALIZER );
-        
+
         // Get the schema
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is not loaded. We can't create the requested Normalizer
-            String msg = "Cannot add the Normalizer " + normalizerDescription.getName() +
", as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the Normalizer " + normalizerDescription.getName()
+                + ", as the associated schema (" + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         // The FQCN
         String fqcn = getFqcn( normalizerDescription, SchemaConstants.NORMALIZER );
-        
+
         // get the byteCode
         EntryAttribute byteCode = getByteCode( normalizerDescription, SchemaConstants.NORMALIZER
);
 
         // Class load the normalizer
         Normalizer normalizer = classLoadNormalizer( schemaManager, oid, fqcn, byteCode,
targetRegistries );
-        
+
         // Update the common fields
         setSchemaObjectProperties( normalizer, normalizerDescription, schema );
-        
+
         return normalizer;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public Normalizer getNormalizer( SchemaManager schemaManager, Entry entry, 
-        Registries targetRegistries, String schemaName ) throws Exception
+    public Normalizer getNormalizer( SchemaManager schemaManager, Entry entry, Registries
targetRegistries,
+        String schemaName ) throws Exception
     {
         checkEntry( entry, SchemaConstants.NORMALIZER );
-        
+
         // The Normalizer OID
         String oid = getOid( entry, SchemaConstants.NORMALIZER );
 
@@ -614,40 +615,40 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested Normalizer
-            String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + ", as
the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + ", as
the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + " into
the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the Normalizer " + entry.getDn().getUpName() + " into
the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
-        
+
         // The FQCN
         String className = getFqcn( entry, SchemaConstants.NORMALIZER );
-        
+
         // The ByteCode
         EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );
-            
+
         // Class load the Normalizer
         Normalizer normalizer = classLoadNormalizer( schemaManager, oid, className, byteCode,
targetRegistries );
-        
+
         // Update the common fields
         setSchemaObjectProperties( normalizer, entry, schema );
-        
+
         // return the resulting Normalizer
         return normalizer;
     }
-    
-    
+
+
     /**
      * Uses reflection to see if a setRegistries( Registries ) method exists on the
      * object's class.  If so then the registries are dependency injected into the 
@@ -658,27 +659,28 @@
     private void injectRegistries( Object obj, Registries targetRegistries ) throws Exception
     {
         Method method = null;
-        
+
         try
         {
-        	method = obj.getClass().getMethod( "setRegistries", parameterTypes );
+            method = obj.getClass().getMethod( "setRegistries", parameterTypes );
         }
         catch ( NoSuchMethodException e )
         {
-        	if ( IS_DEBUG )
-        	{
-        		LOG.debug( obj.getClass() + " has no setRegistries() method." );
-        	}
-        	
-        	return;
+            if ( IS_DEBUG )
+            {
+                LOG.debug( obj.getClass() + " has no setRegistries() method." );
+            }
+
+            return;
         }
-        
+
         if ( method == null )
         {
             return;
         }
-        
-        Object[] args = new Object[] { targetRegistries };
+
+        Object[] args = new Object[]
+            { targetRegistries };
         method.invoke( obj, args );
     }
 
@@ -686,7 +688,8 @@
     /**
      * {@inheritDoc}
      */
-    public LdapSyntax getSyntax( SchemaManager schemaManager, Entry entry, Registries targetRegistries,
String schemaName ) throws NamingException
+    public LdapSyntax getSyntax( SchemaManager schemaManager, Entry entry, Registries targetRegistries,
+        String schemaName ) throws NamingException
     {
         checkEntry( entry, SchemaConstants.SYNTAX );
 
@@ -697,29 +700,29 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested Syntax
-            String msg = "Cannot add the Syntax " + entry.getDn().getUpName() + ", as the
associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the Syntax " + entry.getDn().getUpName() + ", as the
associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
 
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + "
into the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the SyntaxChecker " + entry.getDn().getUpName() + "
into the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
 
         // Create the new LdapSyntax instance
         LdapSyntax syntax = new LdapSyntax( oid );
-        
+
         // The isHumanReadable field
         EntryAttribute mHumanReadable = entry.get( MetaSchemaConstants.X_HUMAN_READABLE_AT
);
-        
+
         if ( mHumanReadable != null )
         {
             String val = mHumanReadable.getString();
@@ -728,16 +731,16 @@
 
         // Common properties
         setSchemaObjectProperties( syntax, entry, schema );
-        
+
         return syntax;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
-    public MatchingRule getMatchingRule( SchemaManager schemaManager, Entry entry, 
-        Registries targetRegistries, String schemaName ) throws NamingException
+    public MatchingRule getMatchingRule( SchemaManager schemaManager, Entry entry, Registries
targetRegistries,
+        String schemaName ) throws NamingException
     {
         checkEntry( entry, SchemaConstants.MATCHING_RULE );
 
@@ -748,19 +751,19 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested MatchingRule
-            String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + ",
as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + ",
as the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
-        
+
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + " into
the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the MatchingRule " + entry.getDn().getUpName() + " into
the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
@@ -769,7 +772,7 @@
 
         // The syntax field
         EntryAttribute mSyntax = entry.get( MetaSchemaConstants.M_SYNTAX_AT );
-        
+
         if ( mSyntax != null )
         {
             matchingRule.setSyntaxOid( mSyntax.getString() );
@@ -780,11 +783,11 @@
 
         // Common properties
         setSchemaObjectProperties( matchingRule, entry, schema );
-        
+
         return matchingRule;
     }
-    
-    
+
+
     /**
      * Create a list of string from a multivalued attribute's values
      */
@@ -794,23 +797,23 @@
         {
             return EMPTY_LIST;
         }
-        
+
         List&lt;String&gt; strings = new ArrayList&lt;String&gt;( attr.size() );
-        
-        for ( Value&lt;?&gt; value:attr )
+
+        for ( Value&lt;?&gt; value : attr )
         {
             strings.add( value.getString() );
         }
-        
+
         return strings;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public ObjectClass getObjectClass( SchemaManager schemaManager, Entry entry, 
-        Registries targetRegistries, String schemaName ) throws Exception
+    public ObjectClass getObjectClass( SchemaManager schemaManager, Entry entry, Registries
targetRegistries,
+        String schemaName ) throws Exception
     {
         checkEntry( entry, SchemaConstants.OBJECT_CLASS );
 
@@ -821,74 +824,74 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded. We can't create the requested ObjectClass
-            String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + ", as
the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + ", as
the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
-        
+
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + " into
the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the ObjectClass " + entry.getDn().getUpName() + " into
the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
 
         // Create the ObjectClass instance
         ObjectClass oc = new ObjectClass( oid );
-        
+
         // The Sup field
         EntryAttribute mSuperiors = entry.get( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT
);
-        
+
         if ( mSuperiors != null )
         {
             oc.setSuperiorOids( getStrings( mSuperiors ) );
         }
-        
+
         // The May field
         EntryAttribute mMay = entry.get( MetaSchemaConstants.M_MAY_AT );
-            
+
         if ( mMay != null )
         {
             oc.setMayAttributeTypeOids( getStrings( mMay ) );
         }
-        
+
         // The Must field
         EntryAttribute mMust = entry.get( MetaSchemaConstants.M_MUST_AT );
-        
+
         if ( mMust != null )
         {
             oc.setMustAttributeTypeOids( getStrings( mMust ) );
         }
-        
+
         // The objectClassType field
         EntryAttribute mTypeObjectClass = entry.get( MetaSchemaConstants.M_TYPE_OBJECT_CLASS_AT
);
-            
+
         if ( mTypeObjectClass != null )
         {
             String type = mTypeObjectClass.getString();
             oc.setType( ObjectClassTypeEnum.getClassType( type ) );
         }
-        
+
         // Common properties
         setSchemaObjectProperties( oc, entry, schema );
-        
+
         return oc;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public AttributeType getAttributeType( SchemaManager schemaManager, Entry entry, 
-        Registries targetRegistries, String schemaName ) throws NamingException
+    public AttributeType getAttributeType( SchemaManager schemaManager, Entry entry, Registries
targetRegistries,
+        String schemaName ) throws NamingException
     {
         checkEntry( entry, SchemaConstants.ATTRIBUTE_TYPE );
-        
+
         // The AttributeType OID
         String oid = getOid( entry, SchemaConstants.ATTRIBUTE_TYPE );
 
@@ -896,117 +899,116 @@
         if ( !schemaManager.isSchemaLoaded( schemaName ) )
         {
             // The schema is not loaded, this is an error
-            String msg = "Cannot add the AttributeType " + entry.getDn().getUpName() + ",
as the associated schema (" +
-                schemaName + " is not loaded";
+            String msg = "Cannot add the AttributeType " + entry.getDn().getUpName() + ",
as the associated schema ("
+                + schemaName + " is not loaded";
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         Schema schema = getSchema( schemaName, targetRegistries );
-        
+
         if ( schema == null )
         {
             // The schema is disabled. We still have to update the backend
-            String msg = "Cannot add the AttributeType " + entry.getDn().getUpName() + "
into the registries, "+
-                "as the associated schema (" + schemaName + ") is disabled";
+            String msg = "Cannot add the AttributeType " + entry.getDn().getUpName() + "
into the registries, "
+                + "as the associated schema (" + schemaName + ") is disabled";
             LOG.info( msg );
             schema = schemaManager.getLoadedSchema( schemaName );
         }
 
         // Create the new AttributeType
         AttributeType attributeType = new AttributeType( oid );
-        
+
         // Syntax
         EntryAttribute mSyntax = entry.get( MetaSchemaConstants.M_SYNTAX_AT );
-        
+
         if ( mSyntax != null )
         {
             attributeType.setSyntaxOid( mSyntax.getString() );
         }
-        
+
         // Syntax Length
         EntryAttribute mSyntaxLength = entry.get( MetaSchemaConstants.M_LENGTH_AT );
-        
+
         if ( mSyntaxLength != null )
         {
             attributeType.setSyntaxLength( Integer.parseInt( mSyntaxLength.getString() )
);
         }
 
-        
         // Equality
         EntryAttribute mEquality = entry.get( MetaSchemaConstants.M_EQUALITY_AT );
-        
+
         if ( mEquality != null )
         {
-        	attributeType.setEqualityOid( mEquality.getString() );
+            attributeType.setEqualityOid( mEquality.getString() );
         }
-        
+
         // Ordering
-        EntryAttribute mOrdering = entry.get( MetaSchemaConstants.M_ORDERING_AT ); 
-            
+        EntryAttribute mOrdering = entry.get( MetaSchemaConstants.M_ORDERING_AT );
+
         if ( mOrdering != null )
         {
             attributeType.setOrderingOid( mOrdering.getString() );
         }
-        
+
         // Substr
         EntryAttribute mSubstr = entry.get( MetaSchemaConstants.M_SUBSTR_AT );
-        
+
         if ( mSubstr != null )
         {
             attributeType.setSubstringOid( mSubstr.getString() );
         }
-        
+
         EntryAttribute mSupAttributeType = entry.get( MetaSchemaConstants.M_SUP_ATTRIBUTE_TYPE_AT
);
-        
+
         // Sup
         if ( mSupAttributeType != null )
         {
-        	attributeType.setSuperiorOid( mSupAttributeType.getString() );
+            attributeType.setSuperiorOid( mSupAttributeType.getString() );
         }
-        
+
         // isCollective
         EntryAttribute mCollective = entry.get( MetaSchemaConstants.M_COLLECTIVE_AT );
-        
+
         if ( mCollective != null )
         {
             String val = mCollective.getString();
             attributeType.setCollective( val.equalsIgnoreCase( "TRUE" ) );
         }
-        
+
         // isSingleValued
         EntryAttribute mSingleValued = entry.get( MetaSchemaConstants.M_SINGLE_VALUE_AT );
-        
+
         if ( mSingleValued != null )
         {
             String val = mSingleValued.getString();
             attributeType.setSingleValued( val.equalsIgnoreCase( "TRUE" ) );
         }
-        
+
         // isReadOnly
         EntryAttribute mNoUserModification = entry.get( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT
);
-        
+
         if ( mNoUserModification != null )
         {
             String val = mNoUserModification.getString();
-            attributeType.setUserModifiable( ! val.equalsIgnoreCase( "TRUE" ) );
+            attributeType.setUserModifiable( !val.equalsIgnoreCase( "TRUE" ) );
         }
-        
+
         // Usage
         EntryAttribute mUsage = entry.get( MetaSchemaConstants.M_USAGE_AT );
-        
+
         if ( mUsage != null )
         {
             attributeType.setUsage( UsageEnum.getUsage( mUsage.getString() ) );
         }
-        
+
         // Common properties
         setSchemaObjectProperties( attributeType, entry, schema );
-        
+
         return attributeType;
     }
-    
-    
+
+
     /**
      * Process the FQCN attribute
      */
@@ -1014,19 +1016,18 @@
     {
         // The FQCN
         EntryAttribute mFqcn = entry.get( MetaSchemaConstants.M_FQCN_AT );
-        
+
         if ( mFqcn == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_FQCN_AT + " attribute";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_FQCN_AT
+ " attribute";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
-        
+
         return mFqcn.getString();
     }
-    
-    
+
+
     /**
      * Process the FQCN attribute
      */
@@ -1034,37 +1035,35 @@
     {
         // The FQCN
         String mFqcn = description.getFqcn();
-        
+
         if ( mFqcn == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_FQCN_AT + " attribute";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_FQCN_AT
+ " attribute";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
-        
+
         return mFqcn;
     }
-    
-    
+
+
     /**
      * Process the ByteCode attribute
      */
     private EntryAttribute getByteCode( Entry entry, String objectType ) throws NamingException
     {
         EntryAttribute byteCode = entry.get( MetaSchemaConstants.M_BYTECODE_AT );
-        
+
         if ( byteCode == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_BYTECODE_AT + " attribute";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_BYTECODE_AT
+ " attribute";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
-        
+
         return byteCode;
     }
-    
+
 
     /**
      * Process the ByteCode attribute
@@ -1072,21 +1071,20 @@
     private EntryAttribute getByteCode( LoadableSchemaObject description, String objectType
) throws NamingException
     {
         String byteCodeString = description.getBytecode();
-        
+
         if ( byteCodeString == null )
         {
-            String msg = objectType + " entry must have a valid " 
-                + MetaSchemaConstants.M_BYTECODE_AT + " attribute";
+            String msg = objectType + " entry must have a valid " + MetaSchemaConstants.M_BYTECODE_AT
+ " attribute";
             LOG.warn( msg );
             throw new NullPointerException( msg );
         }
 
         byte[] bytecode = Base64.decode( byteCodeString.toCharArray() );
         EntryAttribute attr = new DefaultClientAttribute( MetaSchemaConstants.M_BYTECODE_AT,
bytecode );
-        
+
         return attr;
     }
-    
+
 
     /**
      * Process the common attributes to all SchemaObjects :
@@ -1099,55 +1097,56 @@
      *  - isReadOnly
      *  - isEnabled
      */
-    private void setSchemaObjectProperties( SchemaObject schemaObject, Entry entry, Schema
schema ) throws NamingException
+    private void setSchemaObjectProperties( SchemaObject schemaObject, Entry entry, Schema
schema )
+        throws NamingException
     {
         // The isObsolete field
         EntryAttribute mObsolete = entry.get( MetaSchemaConstants.M_OBSOLETE_AT );
-        
+
         if ( mObsolete != null )
         {
             String val = mObsolete.getString();
             schemaObject.setObsolete( val.equalsIgnoreCase( "TRUE" ) );
         }
-        
+
         // The description field
         EntryAttribute mDescription = entry.get( MetaSchemaConstants.M_DESCRIPTION_AT );
-        
+
         if ( mDescription != null )
         {
-            schemaObject.setDescription( mDescription.getString() ); 
+            schemaObject.setDescription( mDescription.getString() );
         }
 
         // The names field
         EntryAttribute names = entry.get( MetaSchemaConstants.M_NAME_AT );
-        
+
         if ( names != null )
         {
             List&lt;String&gt; values = new ArrayList&lt;String&gt;();
-            
-            for ( Value&lt;?&gt; name:names )
+
+            for ( Value&lt;?&gt; name : names )
             {
                 values.add( name.getString() );
             }
-            
+
             schemaObject.setNames( values );
         }
-        
+
         // The isEnabled field
         EntryAttribute mDisabled = entry.get( MetaSchemaConstants.M_DISABLED_AT );
-        
+
         // If the SchemaObject has an explicit m-disabled attribute, then use it.
         // Otherwise, inherit it from the schema
         if ( mDisabled != null )
         {
             String val = mDisabled.getString();
-            schemaObject.setEnabled( ! val.equalsIgnoreCase( "TRUE" ) );
+            schemaObject.setEnabled( !val.equalsIgnoreCase( "TRUE" ) );
         }
         else
         {
             schemaObject.setEnabled( schema != null &amp;&amp; schema.isEnabled() );
         }
-        
+
         // The isReadOnly field
         EntryAttribute mIsReadOnly = entry.get( MetaSchemaConstants.M_NO_USER_MODIFICATION_AT
);
 
@@ -1156,7 +1155,7 @@
             String val = mIsReadOnly.getString();
             schemaObject.setReadOnly( val.equalsIgnoreCase( "TRUE" ) );
         }
-        
+
         // The specification field
         /*
          * TODO : create the M_SPECIFICATION_AT
@@ -1167,10 +1166,10 @@
             so.setSpecification( mSpecification.getString() ); 
         }
         */
-        
+
         // The schemaName field
         schemaObject.setSchemaName( schema.getSchemaName() );
-        
+
         // The extensions field
         /*
          * TODO create the M_EXTENSION_AT AT
@@ -1202,21 +1201,22 @@
      *  - isReadOnly
      *  - isEnabled
      */
-    private void setSchemaObjectProperties( SchemaObject schemaObject, SchemaObject description,
Schema schema ) throws NamingException
+    private void setSchemaObjectProperties( SchemaObject schemaObject, SchemaObject description,
Schema schema )
+        throws NamingException
     {
         // The isObsolete field
         schemaObject.setObsolete( description.isObsolete() );
-        
+
         // The description field
         schemaObject.setDescription( description.getDescription() );
 
         // The names field
         schemaObject.setNames( description.getNames() );
-        
+
         // The isEnabled field. Has the description does not hold a 
         // Disable field, we will inherit from the schema enable field
         schemaObject.setEnabled( schema.isEnabled() );
-        
+
         // The isReadOnly field. We don't have this data in the description,
         // so set it to false
         // TODO : should it be a X-READONLY extension ?
@@ -1224,10 +1224,10 @@
 
         // The specification field
         schemaObject.setSpecification( description.getSpecification() );
-        
+
         // The schemaName field
         schemaObject.setSchemaName( schema.getSchemaName() );
-        
+
         // The extensions field
         schemaObject.setExtensions( description.getExtensions() );
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887183 - /directory/studio/trunk/pom.xml</title>
<author><name>pamarcelot@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204132850.04C0F23889DA@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204132850-04C0F23889DA@eris-apache-org%3e</id>
<updated>2009-12-04T13:28:40Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: pamarcelot
Date: Fri Dec  4 13:28:31 2009
New Revision: 887183

URL: http://svn.apache.org/viewvc?rev=887183&amp;view=rev
Log:
Trying to please Continuum with a SNAPSHOT version instead of a released version.

Modified:
    directory/studio/trunk/pom.xml

Modified: directory/studio/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/pom.xml?rev=887183&amp;r1=887182&amp;r2=887183&amp;view=diff
==============================================================================
--- directory/studio/trunk/pom.xml (original)
+++ directory/studio/trunk/pom.xml Fri Dec  4 13:28:31 2009
@@ -66,7 +66,7 @@
     &lt;studio.dist.url&gt;${pom.distributionManagement.repository.url}&lt;/studio.dist.url&gt;
     &lt;distMgmtSiteUrl&gt;scpexe://people.apache.org/www/directory.apache.org/studio/gen-docs/${version}&lt;/distMgmtSiteUrl&gt;
     
-    &lt;apacheds.launcher.version&gt;1.5.0&lt;/apacheds.launcher.version&gt;
+    &lt;apacheds.launcher.version&gt;1.5.0-SNAPSHOT&lt;/apacheds.launcher.version&gt;
 
     &lt;!-- Set versions for depending projects --&gt;
     &lt;org.apache.directory.shared.version&gt;0.9.16&lt;/org.apache.directory.shared.version&gt;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887176 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204124747.B468123889DA@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204124747-B468123889DA@eris-apache-org%3e</id>
<updated>2009-12-04T12:47:47Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 12:47:46 2009
New Revision: 887176

URL: http://svn.apache.org/viewvc?rev=887176&amp;view=rev
Log:
Fixed loadWirgDeps meyhod : the errors list wasn't cleared

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=887176&amp;r1=887175&amp;r2=887176&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Fri Dec  4 12:47:46 2009
@@ -751,6 +751,12 @@
     {
         boolean loaded = false;
 
+        // Reset the errors if not null
+        if ( errors != null )
+        {
+            errors.clear();
+        }
+
         // Work on a cloned and relaxed registries
         Registries clonedRegistries = cloneRegistries();
         clonedRegistries.setRelaxed();
@@ -781,7 +787,7 @@
                 }
 
                 // Build the cross references
-                registries.buildReferences();
+                errors = registries.buildReferences();
                 registries.setStrict();
 
                 loaded = true;




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887167 - in /directory/studio/trunk: ./ aciitemeditor/ apacheds-configuration-feature/ apacheds-configuration-help/ apacheds-configuration-help/src/main/docbook/ apacheds-configuration/ apacheds-feature/ apacheds-help/ apacheds-help/src/ma...</title>
<author><name>pamarcelot@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204121152.6137E23889DA@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204121152-6137E23889DA@eris-apache-org%3e</id>
<updated>2009-12-04T12:11:50Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: pamarcelot
Date: Fri Dec  4 12:11:49 2009
New Revision: 887167

URL: http://svn.apache.org/viewvc?rev=887167&amp;view=rev
Log:
Removed specific version properties (replaced by ${pom.version} taken from the parent pom) (except for the apacheds-launcher library project)

Modified:
    directory/studio/trunk/aciitemeditor/pom.xml
    directory/studio/trunk/apacheds-configuration-feature/feature.xml
    directory/studio/trunk/apacheds-configuration-feature/pom.xml
    directory/studio/trunk/apacheds-configuration-help/pom.xml
    directory/studio/trunk/apacheds-configuration-help/src/main/docbook/0_index.xml
    directory/studio/trunk/apacheds-configuration/pom.xml
    directory/studio/trunk/apacheds-feature/feature.xml
    directory/studio/trunk/apacheds-feature/pom.xml
    directory/studio/trunk/apacheds-help/pom.xml
    directory/studio/trunk/apacheds-help/src/main/docbook/0_index.xml
    directory/studio/trunk/apacheds-launcher/pom.xml
    directory/studio/trunk/apacheds/pom.xml
    directory/studio/trunk/common-ui/pom.xml
    directory/studio/trunk/connection-core/pom.xml
    directory/studio/trunk/connection-ui/pom.xml
    directory/studio/trunk/jars/pom.xml
    directory/studio/trunk/ldapbrowser-common/pom.xml
    directory/studio/trunk/ldapbrowser-core/pom.xml
    directory/studio/trunk/ldapbrowser-feature/feature.xml
    directory/studio/trunk/ldapbrowser-feature/pom.xml
    directory/studio/trunk/ldapbrowser-help/pom.xml
    directory/studio/trunk/ldapbrowser-help/src/main/docbook/0_index.xml
    directory/studio/trunk/ldapbrowser-ui/pom.xml
    directory/studio/trunk/ldif-parser/pom.xml
    directory/studio/trunk/ldifeditor-feature/feature.xml
    directory/studio/trunk/ldifeditor-feature/pom.xml
    directory/studio/trunk/ldifeditor-help/pom.xml
    directory/studio/trunk/ldifeditor-help/src/main/docbook/0_index.xml
    directory/studio/trunk/ldifeditor/pom.xml
    directory/studio/trunk/pom.xml
    directory/studio/trunk/rcp-feature/feature.xml
    directory/studio/trunk/rcp-feature/pom.xml
    directory/studio/trunk/rcp-help/pom.xml
    directory/studio/trunk/rcp-help/src/main/docbook/0_index.xml
    directory/studio/trunk/rcp/pom.xml
    directory/studio/trunk/repository/pom.xml
    directory/studio/trunk/schemaeditor-feature/feature.xml
    directory/studio/trunk/schemaeditor-feature/pom.xml
    directory/studio/trunk/schemaeditor-help/pom.xml
    directory/studio/trunk/schemaeditor-help/src/main/docbook/0_index.xml
    directory/studio/trunk/schemaeditor/pom.xml
    directory/studio/trunk/test-integration-core/pom.xml
    directory/studio/trunk/test-integration-ui/pom.xml
    directory/studio/trunk/updatesite/pom.xml
    directory/studio/trunk/updatesite/src/main/resources/site--xml.html
    directory/studio/trunk/updatesite/src/main/resources/site.xml
    directory/studio/trunk/valueeditors/pom.xml

Modified: directory/studio/trunk/aciitemeditor/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/aciitemeditor/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/aciitemeditor/pom.xml (original)
+++ directory/studio/trunk/aciitemeditor/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;aciitemeditor&lt;/artifactId&gt;
-  &lt;version&gt;${aciitemeditor.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio ACI Item Editor&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/apacheds-configuration-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration-feature/feature.xml (original)
+++ directory/studio/trunk/apacheds-configuration-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -224,28 +224,28 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.apacheds.configuration"
          download-size="0"
          install-size="0"
-         version="${apacheds.configuration.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.jars"
          download-size="0"
          install-size="0"
-         version="${jars.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.apacheds.configuration.help"
          download-size="0"
          install-size="0"
-         version="${apacheds.configuration.help.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/apacheds-configuration-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration-feature/pom.xml (original)
+++ directory/studio/trunk/apacheds-configuration-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;apacheds.configuration.feature&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.configuration.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS Configuration Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/apacheds-configuration-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration-help/pom.xml (original)
+++ directory/studio/trunk/apacheds-configuration-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;apacheds.configuration.help&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.configuration.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS Configuration Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/apacheds-configuration-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/apacheds-configuration-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -61,7 +61,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio Apache DS Configuration&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/apacheds-configuration/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-configuration/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-configuration/pom.xml (original)
+++ directory/studio/trunk/apacheds-configuration/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;apacheds.configuration&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.configuration.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS Configuration&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/apacheds-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-feature/feature.xml (original)
+++ directory/studio/trunk/apacheds-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -224,35 +224,35 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.apacheds.configuration"
          download-size="0"
          install-size="0"
-         version="${apacheds.configuration.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.apacheds"
          download-size="0"
          install-size="0"
-         version="${apacheds.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.jars"
          download-size="0"
          install-size="0"
-         version="${jars.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.apacheds.help"
          download-size="0"
          install-size="0"
-         version="${apacheds.help.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/apacheds-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-feature/pom.xml (original)
+++ directory/studio/trunk/apacheds-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;apacheds.feature&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/apacheds-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-help/pom.xml (original)
+++ directory/studio/trunk/apacheds-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;apacheds.help&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/apacheds-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/apacheds-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -42,7 +42,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio Apache DS&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/apacheds-launcher/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds-launcher/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds-launcher/pom.xml (original)
+++ directory/studio/trunk/apacheds-launcher/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,7 @@
 	&lt;/parent&gt;
 
 	&lt;artifactId&gt;apacheds-launcher&lt;/artifactId&gt;
-	&lt;version&gt;${apacheds.launcher.version}&lt;/version&gt;
+    &lt;version&gt;${apacheds.launcher.version}&lt;/version&gt;
 	&lt;name&gt;Apache Directory Studio Apache DS Launcher&lt;/name&gt;
 	&lt;packaging&gt;jar&lt;/packaging&gt;
 
@@ -54,16 +54,6 @@
 					&lt;/projectnatures&gt;
 				&lt;/configuration&gt;
 			&lt;/plugin&gt;
-			&lt;!-- &lt;!&gt; &lt;!&gt; &lt;!&gt; WARNING &lt;!&gt; &lt;!&gt; &lt;!&gt; --&gt;
-			&lt;!-- The following plugin configuration needs to be removed before the next release. --&gt;
-			&lt;!-- It has only been added to please the continuum deployment. --&gt;
-			&lt;plugin&gt;
-				&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
-				&lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
-				&lt;configuration&gt;
-				    &lt;skip&gt;true&lt;/skip&gt;
-				&lt;/configuration&gt;
-			&lt;/plugin&gt;
 		&lt;/plugins&gt;
 	&lt;/build&gt;
 

Modified: directory/studio/trunk/apacheds/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/apacheds/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/apacheds/pom.xml (original)
+++ directory/studio/trunk/apacheds/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;apacheds&lt;/artifactId&gt;
-  &lt;version&gt;${apacheds.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Apache DS&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
@@ -721,7 +720,7 @@
                 &lt;artifactItem&gt;
                   &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
                   &lt;artifactId&gt;apacheds-launcher&lt;/artifactId&gt;
-                  &lt;version&gt;${apacheds.launcher.version}&lt;/version&gt;
+                  &lt;version&gt;1.5.0&lt;/version&gt;
                 &lt;/artifactItem&gt;
                 &lt;artifactItem&gt;
                   &lt;groupId&gt;org.apache.directory.server&lt;/groupId&gt;

Modified: directory/studio/trunk/common-ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/common-ui/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/common-ui/pom.xml (original)
+++ directory/studio/trunk/common-ui/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;common.ui&lt;/artifactId&gt;
-  &lt;version&gt;${common.ui.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Common UI&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/connection-core/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-core/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/connection-core/pom.xml (original)
+++ directory/studio/trunk/connection-core/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;connection.core&lt;/artifactId&gt;
-  &lt;version&gt;${connection.core.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Connection Core&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/connection-ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/connection-ui/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/connection-ui/pom.xml (original)
+++ directory/studio/trunk/connection-ui/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;connection.ui&lt;/artifactId&gt;
-  &lt;version&gt;${connection.ui.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Connection UI&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/jars/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/jars/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/jars/pom.xml (original)
+++ directory/studio/trunk/jars/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;jars&lt;/artifactId&gt;
-  &lt;version&gt;${jars.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Jars&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldapbrowser-common/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-common/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-common/pom.xml (original)
+++ directory/studio/trunk/ldapbrowser-common/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;ldapbrowser.common&lt;/artifactId&gt;
-  &lt;version&gt;${ldapbrowser.common.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDAP Browser Common&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldapbrowser-core/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/pom.xml (original)
+++ directory/studio/trunk/ldapbrowser-core/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;ldapbrowser.core&lt;/artifactId&gt;
-  &lt;version&gt;${ldapbrowser.core.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDAP Browser Core&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldapbrowser-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-feature/feature.xml (original)
+++ directory/studio/trunk/ldapbrowser-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -236,84 +236,84 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.core"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.core.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.ui"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.help"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.help.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.jars"
          download-size="0"
          install-size="0"
-         version="${jars.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.common"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.common.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.valueeditors"
          download-size="0"
          install-size="0"
-         version="${valueeditors.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifeditor"
          download-size="0"
          install-size="0"
-         version="${ldifeditor.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifparser"
          download-size="0"
          install-size="0"
-         version="${ldifparser.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.aciitemeditor"
          download-size="0"
          install-size="0"
-         version="${aciitemeditor.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.core"
          download-size="0"
          install-size="0"
-         version="${connection.core.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.ui"
          download-size="0"
          install-size="0"
-         version="${connection.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/ldapbrowser-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-feature/pom.xml (original)
+++ directory/studio/trunk/ldapbrowser-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;ldapbrowser.feature&lt;/artifactId&gt;
-  &lt;version&gt;${ldapbrowser.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDAP Browser Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldapbrowser-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-help/pom.xml (original)
+++ directory/studio/trunk/ldapbrowser-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;ldapbrowser.help&lt;/artifactId&gt;
-  &lt;version&gt;${ldapbrowser.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDAP Browser Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/ldapbrowser-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/ldapbrowser-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -103,7 +103,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio LDAP Browser&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/ldapbrowser-ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/pom.xml (original)
+++ directory/studio/trunk/ldapbrowser-ui/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;ldapbrowser.ui&lt;/artifactId&gt;
-  &lt;version&gt;${ldapbrowser.ui.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDAP Browser UI&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldif-parser/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldif-parser/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldif-parser/pom.xml (original)
+++ directory/studio/trunk/ldif-parser/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;ldifparser&lt;/artifactId&gt;
-  &lt;version&gt;${ldifparser.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDIF Parser&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldifeditor-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor-feature/feature.xml (original)
+++ directory/studio/trunk/ldifeditor-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -223,75 +223,75 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.aciitemeditor"
          download-size="0"
          install-size="0"
-         version="${aciitemeditor.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.core"
          download-size="0"
          install-size="0"
-         version="${connection.core.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.ui"
          download-size="0"
          install-size="0"
-         version="${connection.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.jars"
          download-size="0"
          install-size="0"
-         version="${jars.version}"/&gt;
+         version="${pom.version}"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.core"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.core.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifeditor"
          download-size="0"
          install-size="0"
-         version="${ldifeditor.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifparser"
          download-size="0"
          install-size="0"
-         version="${ldifparser.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.valueeditors"
          download-size="0"
          install-size="0"
-         version="${valueeditors.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldapbrowser.common"
          download-size="0"
          install-size="0"
-         version="${ldapbrowser.common.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifeditor.help"
          download-size="0"
          install-size="0"
-         version="${ldifeditor.help.version}"/&gt;
+         version="${pom.version}"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/ldifeditor-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor-feature/pom.xml (original)
+++ directory/studio/trunk/ldifeditor-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;ldifeditor.feature&lt;/artifactId&gt;
-  &lt;version&gt;${ldifeditor.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDIF Editor Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/ldifeditor-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor-help/pom.xml (original)
+++ directory/studio/trunk/ldifeditor-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;ldifeditor.help&lt;/artifactId&gt;
-  &lt;version&gt;${ldifeditor.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDIF Editor Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/ldifeditor-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/ldifeditor-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -33,7 +33,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio LDIF Editor&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/ldifeditor/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldifeditor/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/ldifeditor/pom.xml (original)
+++ directory/studio/trunk/ldifeditor/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;ldifeditor&lt;/artifactId&gt;
-  &lt;version&gt;${ldifeditor.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio LDIF Editor&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/pom.xml (original)
+++ directory/studio/trunk/pom.xml Fri Dec  4 12:11:49 2009
@@ -65,39 +65,8 @@
     --&gt;
     &lt;studio.dist.url&gt;${pom.distributionManagement.repository.url}&lt;/studio.dist.url&gt;
     &lt;distMgmtSiteUrl&gt;scpexe://people.apache.org/www/directory.apache.org/studio/gen-docs/${version}&lt;/distMgmtSiteUrl&gt;
-    &lt;!-- Set versions for subprojects --&gt;
-    &lt;aciitemeditor.version&gt;1.5.2-SNAPSHOT&lt;/aciitemeditor.version&gt;
-    &lt;apacheds.launcher.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.launcher.version&gt;
-    &lt;apacheds.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.version&gt;
-    &lt;apacheds.feature.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.feature.version&gt;
-    &lt;apacheds.help.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.help.version&gt;
-    &lt;apacheds.configuration.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.configuration.version&gt;
-    &lt;apacheds.configuration.feature.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.configuration.feature.version&gt;
-    &lt;apacheds.configuration.help.version&gt;1.5.2-SNAPSHOT&lt;/apacheds.configuration.help.version&gt;
-    &lt;common.ui.version&gt;1.5.2-SNAPSHOT&lt;/common.ui.version&gt;
-    &lt;connection.core.version&gt;1.5.2-SNAPSHOT&lt;/connection.core.version&gt;
-    &lt;connection.ui.version&gt;1.5.2-SNAPSHOT&lt;/connection.ui.version&gt;
-    &lt;jars.version&gt;1.5.2-SNAPSHOT&lt;/jars.version&gt;
-    &lt;ldapbrowser.common.version&gt;1.5.2-SNAPSHOT&lt;/ldapbrowser.common.version&gt;
-    &lt;ldapbrowser.core.version&gt;1.5.2-SNAPSHOT&lt;/ldapbrowser.core.version&gt;
-    &lt;ldapbrowser.feature.version&gt;1.5.2-SNAPSHOT&lt;/ldapbrowser.feature.version&gt;
-    &lt;ldapbrowser.help.version&gt;1.5.2-SNAPSHOT&lt;/ldapbrowser.help.version&gt;
-    &lt;ldapbrowser.ui.version&gt;1.5.2-SNAPSHOT&lt;/ldapbrowser.ui.version&gt;
-    &lt;ldifeditor.version&gt;1.5.2-SNAPSHOT&lt;/ldifeditor.version&gt;
-    &lt;ldifeditor.feature.version&gt;1.5.2-SNAPSHOT&lt;/ldifeditor.feature.version&gt;
-    &lt;ldifeditor.help.version&gt;1.5.2-SNAPSHOT&lt;/ldifeditor.help.version&gt;
-    &lt;ldifparser.version&gt;1.5.2-SNAPSHOT&lt;/ldifparser.version&gt;
-    &lt;rcp.version&gt;1.5.2-SNAPSHOT&lt;/rcp.version&gt;
-    &lt;rcp.feature.version&gt;1.5.2-SNAPSHOT&lt;/rcp.feature.version&gt;
-    &lt;rcp.help.version&gt;1.5.2-SNAPSHOT&lt;/rcp.help.version&gt;
-    &lt;repository.version&gt;1.5.2-SNAPSHOT&lt;/repository.version&gt;
-    &lt;schemaeditor.version&gt;1.5.2-SNAPSHOT&lt;/schemaeditor.version&gt;
-    &lt;schemaeditor.feature.version&gt;1.5.2-SNAPSHOT&lt;/schemaeditor.feature.version&gt;
-    &lt;schemaeditor.help.version&gt;1.5.2-SNAPSHOT&lt;/schemaeditor.help.version&gt;
-    &lt;test.integration.core.version&gt;1.5.2-SNAPSHOT&lt;/test.integration.core.version&gt;
-    &lt;test.integration.ui.version&gt;1.5.2-SNAPSHOT&lt;/test.integration.ui.version&gt;
-    &lt;updatesite.version&gt;1.5.1-SNAPSHOT&lt;/updatesite.version&gt;
-    &lt;valueeditors.version&gt;1.5.2-SNAPSHOT&lt;/valueeditors.version&gt;
+    
+    &lt;apacheds.launcher.version&gt;1.5.0&lt;/apacheds.launcher.version&gt;
 
     &lt;!-- Set versions for depending projects --&gt;
     &lt;org.apache.directory.shared.version&gt;0.9.16&lt;/org.apache.directory.shared.version&gt;
@@ -197,157 +166,157 @@
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;aciitemeditor&lt;/artifactId&gt;
-        &lt;version&gt;${aciitemeditor.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds.feature&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds.help&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds-launcher&lt;/artifactId&gt;
-        &lt;version&gt;1.5.2-SNAPSHOT&lt;/version&gt;
+        &lt;version&gt;${apacheds.launcher.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds.configuration&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.configuration.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds.configuration.feature&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.configuration.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;apacheds.configuration.help&lt;/artifactId&gt;
-        &lt;version&gt;${apacheds.configuration.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;common.ui&lt;/artifactId&gt;
-        &lt;version&gt;${common.ui.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;connection.core&lt;/artifactId&gt;
-        &lt;version&gt;${connection.core.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;connection.ui&lt;/artifactId&gt;
-        &lt;version&gt;${connection.ui.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;jars&lt;/artifactId&gt;
-        &lt;version&gt;${jars.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldapbrowser.common&lt;/artifactId&gt;
-        &lt;version&gt;${ldapbrowser.common.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldapbrowser.core&lt;/artifactId&gt;
-        &lt;version&gt;${ldapbrowser.core.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldapbrowser.feature&lt;/artifactId&gt;
-        &lt;version&gt;${ldapbrowser.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldapbrowser.help&lt;/artifactId&gt;
-        &lt;version&gt;${ldapbrowser.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldapbrowser.ui&lt;/artifactId&gt;
-        &lt;version&gt;${ldapbrowser.ui.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldifeditor&lt;/artifactId&gt;
-        &lt;version&gt;${ldifeditor.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldifeditor.feature&lt;/artifactId&gt;
-        &lt;version&gt;${ldifeditor.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldifeditor.help&lt;/artifactId&gt;
-        &lt;version&gt;${ldifeditor.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;ldifparser&lt;/artifactId&gt;
-        &lt;version&gt;${ldifparser.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;rcp&lt;/artifactId&gt;
-        &lt;version&gt;${rcp.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;rcp.feature&lt;/artifactId&gt;
-        &lt;version&gt;${rcp.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;rcp.help&lt;/artifactId&gt;
-        &lt;version&gt;${rcp.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;schemaeditor&lt;/artifactId&gt;
-        &lt;version&gt;${schemaeditor.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;schemaeditor.feature&lt;/artifactId&gt;
-        &lt;version&gt;${schemaeditor.feature.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;schemaeditor.help&lt;/artifactId&gt;
-        &lt;version&gt;${schemaeditor.help.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;test.integration.core&lt;/artifactId&gt;
-        &lt;version&gt;${test.integration.core.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;test.integration.ui&lt;/artifactId&gt;
-        &lt;version&gt;${test.integration.ui.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;updatesite&lt;/artifactId&gt;
-        &lt;version&gt;${updatesite.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       &lt;dependency&gt;
         &lt;groupId&gt;org.apache.directory.studio&lt;/groupId&gt;
         &lt;artifactId&gt;valueeditors&lt;/artifactId&gt;
-        &lt;version&gt;${valueeditors.version}&lt;/version&gt;
+        &lt;version&gt;${pom.version}&lt;/version&gt;
       &lt;/dependency&gt;
       
       &lt;!-- Maven --&gt;

Modified: directory/studio/trunk/rcp-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/rcp-feature/feature.xml (original)
+++ directory/studio/trunk/rcp-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -228,21 +228,21 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.rcp"
          download-size="0"
          install-size="0"
-         version="${rcp.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.rcp.help"
          download-size="0"
          install-size="0"
-         version="${rcp.help.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/rcp-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/rcp-feature/pom.xml (original)
+++ directory/studio/trunk/rcp-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;rcp.feature&lt;/artifactId&gt;
-  &lt;version&gt;${rcp.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio RCP Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/rcp-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/rcp-help/pom.xml (original)
+++ directory/studio/trunk/rcp-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;rcp.help&lt;/artifactId&gt;
-  &lt;version&gt;${rcp.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio RCP Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/rcp-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/rcp-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/rcp-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -45,7 +45,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/rcp/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/rcp/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/rcp/pom.xml (original)
+++ directory/studio/trunk/rcp/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;rcp&lt;/artifactId&gt;
-  &lt;version&gt;${rcp.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio RCP&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/repository/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/repository/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/repository/pom.xml (original)
+++ directory/studio/trunk/repository/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;repository&lt;/artifactId&gt;
-  &lt;version&gt;${repository.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Repository&lt;/name&gt;
   &lt;packaging&gt;pom&lt;/packaging&gt;
   

Modified: directory/studio/trunk/schemaeditor-feature/feature.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor-feature/feature.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor-feature/feature.xml (original)
+++ directory/studio/trunk/schemaeditor-feature/feature.xml Fri Dec  4 12:11:49 2009
@@ -224,49 +224,49 @@
          id="org.apache.directory.studio.common.ui"
          download-size="0"
          install-size="0"
-         version="${common.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.schemaeditor"
          download-size="0"
          install-size="0"
-         version="${schemaeditor.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.schemaeditor.help"
          download-size="0"
          install-size="0"
-         version="${schemaeditor.help.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.jars"
          download-size="0"
          install-size="0"
-         version="${jars.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.core"
          download-size="0"
          install-size="0"
-         version="${connection.core.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.connection.ui"
          download-size="0"
          install-size="0"
-         version="${connection.ui.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
    &lt;plugin
          id="org.apache.directory.studio.ldifparser"
          download-size="0"
          install-size="0"
-         version="${ldifparser.version}"
+         version="${pom.version}"
          unpack="false"/&gt;
 
 &lt;/feature&gt;

Modified: directory/studio/trunk/schemaeditor-feature/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor-feature/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor-feature/pom.xml (original)
+++ directory/studio/trunk/schemaeditor-feature/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;schemaeditor.feature&lt;/artifactId&gt;
-  &lt;version&gt;${schemaeditor.feature.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Schema Editor Feature&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/schemaeditor-help/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor-help/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor-help/pom.xml (original)
+++ directory/studio/trunk/schemaeditor-help/pom.xml Fri Dec  4 12:11:49 2009
@@ -28,16 +28,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;schemaeditor.help&lt;/artifactId&gt;
-  &lt;version&gt;${schemaeditor.help.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Schema Editor Help&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 
   &lt;description /&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-  &lt;/properties&gt;
-
   &lt;build&gt;
     &lt;plugins&gt;
       &lt;plugin&gt;

Modified: directory/studio/trunk/schemaeditor-help/src/main/docbook/0_index.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor-help/src/main/docbook/0_index.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor-help/src/main/docbook/0_index.xml (original)
+++ directory/studio/trunk/schemaeditor-help/src/main/docbook/0_index.xml Fri Dec  4 12:11:49 2009
@@ -60,7 +60,7 @@
 	&lt;bookinfo&gt;
 		&lt;title&gt;Apache Directory Studio Schema Editor&lt;/title&gt;
 		&lt;subtitle&gt;User's Guide&lt;/subtitle&gt;
-		&lt;releaseinfo&gt;Version ${current_pom_version}&lt;/releaseinfo&gt;
+		&lt;releaseinfo&gt;Version ${pom.version}&lt;/releaseinfo&gt;
 		&lt;copyright&gt;
 			&lt;year&gt;2006 - 2009&lt;/year&gt;
 			&lt;holder&gt;Apache Software Foundation&lt;/holder&gt;

Modified: directory/studio/trunk/schemaeditor/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/pom.xml (original)
+++ directory/studio/trunk/schemaeditor/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;schemaeditor&lt;/artifactId&gt;
-  &lt;version&gt;${schemaeditor.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Schema Editor&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/test-integration-core/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-core/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/test-integration-core/pom.xml (original)
+++ directory/studio/trunk/test-integration-core/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;test.integration.core&lt;/artifactId&gt;
-  &lt;version&gt;${test.integration.core.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Core Integration Tests&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/test-integration-ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/pom.xml (original)
+++ directory/studio/trunk/test-integration-ui/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;test.integration.ui&lt;/artifactId&gt;
-  &lt;version&gt;${test.integration.ui.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio UI Integration Tests&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 

Modified: directory/studio/trunk/updatesite/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/updatesite/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/updatesite/pom.xml (original)
+++ directory/studio/trunk/updatesite/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,17 +27,11 @@
   &lt;/parent&gt;
 
   &lt;artifactId&gt;updatesite&lt;/artifactId&gt;
-  &lt;version&gt;${updatesite.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Update Site&lt;/name&gt;
   &lt;packaging&gt;pom&lt;/packaging&gt;
 
   &lt;description&gt;&lt;/description&gt;
 
-  &lt;properties&gt;
-    &lt;current_pom_version&gt;${pom.version}&lt;/current_pom_version&gt;
-    &lt;local-repo&gt;${project.basedir}/../repository&lt;/local-repo&gt;
-  &lt;/properties&gt;
-
   &lt;profiles&gt;
     &lt;profile&gt;
       &lt;id&gt;CI&lt;/id&gt;

Modified: directory/studio/trunk/updatesite/src/main/resources/site--xml.html
URL: http://svn.apache.org/viewvc/directory/studio/trunk/updatesite/src/main/resources/site--xml.html?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/updatesite/src/main/resources/site--xml.html (original)
+++ directory/studio/trunk/updatesite/src/main/resources/site--xml.html Fri Dec  4 12:11:49 2009
@@ -22,98 +22,98 @@
       The Apache Directory Studio update site.
    &lt;/description&gt;
    &lt;feature 
-   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.rcp.feature_${rcp.feature.version}.jar" 
-   		id="org.apache.directory.studio.rcp.feature" version="${rcp.feature.version}"
+   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.rcp.feature_${pom.version}.jar" 
+   		id="org.apache.directory.studio.rcp.feature" version="${pom.version}"
    		os="linux,macosx,win32" ws="carbon,gtk,win32" arch="ppc,x86,x86_64"&gt;
       &lt;category name="Apache Directory Studio RCP"/&gt;
    &lt;/feature&gt;
    &lt;feature 
-   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.ldapbrowser.feature_${ldapbrowser.feature.version}.jar" 
-   		id="org.apache.directory.studio.ldapbrowser.feature" version="${ldapbrowser.feature.version}"&gt;
+   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.ldapbrowser.feature_${pom.version}.jar" 
+   		id="org.apache.directory.studio.ldapbrowser.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio LDAP Browser"/&gt;
    &lt;/feature&gt;
    &lt;feature 
-   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.schemaeditor.feature_${schemaeditor.feature.version}.jar" 
-   		id="org.apache.directory.studio.schemaeditor.feature" version="${schemaeditor.feature.version}"&gt;
+   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.schemaeditor.feature_${pom.version}.jar" 
+   		id="org.apache.directory.studio.schemaeditor.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Schema Editor"/&gt;
    &lt;/feature&gt;
    &lt;feature 
-   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.apacheds.configuration.feature_${apacheds.configuration.feature.version}.jar" 
-   		id="org.apache.directory.studio.apacheds.configuration.feature" version="${apacheds.configuration.feature.version}"&gt;
+   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.apacheds.configuration.feature_${pom.version}.jar" 
+   		id="org.apache.directory.studio.apacheds.configuration.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Apache DS"/&gt;
    &lt;/feature&gt;
    &lt;feature 
-   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.apacheds.feature_${apacheds.feature.version}.jar" 
-   		id="org.apache.directory.studio.apacheds.feature" version="${apacheds.feature.version}"&gt;
+   		url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.apacheds.feature_${pom.version}.jar" 
+   		id="org.apache.directory.studio.apacheds.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Apache DS"/&gt;
    &lt;/feature&gt;
-   &lt;feature url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.ldifeditor.feature_${ldifeditor.feature.version}.jar"
-       id="org.apache.directory.studio.ldifeditor.feature" version="${ldifeditor.feature.version}"&gt;
+   &lt;feature url="[preferred]/directory/studio/update/1.x/features/org.apache.directory.studio.ldifeditor.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.ldifeditor.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio LDIF Editor"/&gt;
    &lt;/feature&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.aciitemeditor_${aciitemeditor.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.aciitemeditor_${aciitemeditor.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.aciitemeditor_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.aciitemeditor_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.apacheds.configuration.help_${apacheds.configuration.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.configuration.help_${apacheds.configuration.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.apacheds.configuration.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.configuration.help_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.apacheds.configuration_${apacheds.configuration.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.configuration_${apacheds.configuration.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.apacheds.configuration_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.configuration_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.apacheds_${apacheds.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds_${apacheds.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.apacheds_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.apacheds.help_${apacheds.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.help_${apacheds.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.apacheds.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.apacheds.help_${pom.version}.jar"/&gt;
    &lt;archive
-   		path="plugins/org.apache.directory.studio.common.ui_${common.ui.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.common.ui_${common.ui.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.common.ui_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.common.ui_${pom.version}.jar"/&gt;
    &lt;archive
-   		path="plugins/org.apache.directory.studio.connection.core_${connection.core.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.connection.core_${connection.core.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.connection.core_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.connection.core_${pom.version}.jar"/&gt;
    &lt;archive
-   		path="plugins/org.apache.directory.studio.connection.ui_${connection.ui.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.connection.ui_${connection.ui.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.connection.ui_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.connection.ui_${pom.version}.jar"/&gt;
    &lt;archive
-   		path="plugins/org.apache.directory.studio.ldapbrowser.common_${ldapbrowser.common.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.common_${ldapbrowser.common.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldapbrowser.common_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.common_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldapbrowser.core_${ldapbrowser.core.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.core_${ldapbrowser.core.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldapbrowser.core_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.core_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldapbrowser.help_${ldapbrowser.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.help_${ldapbrowser.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldapbrowser.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.help_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldapbrowser.ui_${ldapbrowser.ui.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.ui_${ldapbrowser.ui.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldapbrowser.ui_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldapbrowser.ui_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.rcp.help_${rcp.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.rcp.help_${rcp.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.rcp.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.rcp.help_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.jars_${jars.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.jars_${jars.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.jars_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.jars_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldifeditor_${ldifeditor.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifeditor_${ldifeditor.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldifeditor_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifeditor_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldifeditor.help_${ldifeditor.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifeditor.help_${ldifeditor.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldifeditor.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifeditor.help_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.ldifparser_${ldifparser.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifparser_${ldifparser.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.ldifparser_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.ldifparser_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.schemaeditor.help_${schemaeditor.help.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.schemaeditor.help_${schemaeditor.help.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.schemaeditor.help_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.schemaeditor.help_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.schemaeditor_${schemaeditor.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.schemaeditor_${schemaeditor.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.schemaeditor_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.schemaeditor_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.valueeditors_${valueeditors.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.valueeditors_${valueeditors.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.valueeditors_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.valueeditors_${pom.version}.jar"/&gt;
    &lt;archive 
-   		path="plugins/org.apache.directory.studio.rcp_${rcp.version}.jar" 
-   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.rcp_${rcp.version}.jar"/&gt;
+   		path="plugins/org.apache.directory.studio.rcp_${pom.version}.jar" 
+   		url="[preferred]/directory/studio/update/1.x/plugins/org.apache.directory.studio.rcp_${pom.version}.jar"/&gt;
    &lt;category-def name="Apache Directory Studio RCP" label="Apache Directory Studio RCP"&gt;
       &lt;description&gt;
          The Apache Directory Studio RCP category contains all features related to the RCP Application.

Modified: directory/studio/trunk/updatesite/src/main/resources/site.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/updatesite/src/main/resources/site.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/updatesite/src/main/resources/site.xml (original)
+++ directory/studio/trunk/updatesite/src/main/resources/site.xml Fri Dec  4 12:11:49 2009
@@ -4,30 +4,30 @@
       The Apache Directory Studio update site.
    &lt;/description&gt;
    &lt;feature
-       url="features/org.apache.directory.studio.rcp.feature_${rcp.feature.version}.jar"
-       id="org.apache.directory.studio.rcp.feature" version="${rcp.feature.version}"
+       url="features/org.apache.directory.studio.rcp.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.rcp.feature" version="${pom.version}"
        os="linux,macosx,win32" ws="carbon,gtk,win32" arch="ppc,x86,x86_64"&gt;
       &lt;category name="Apache Directory Studio RCP"/&gt;
    &lt;/feature&gt;
    &lt;feature
-       url="features/org.apache.directory.studio.ldapbrowser.feature_${ldapbrowser.feature.version}.jar"
-       id="org.apache.directory.studio.ldapbrowser.feature" version="${ldapbrowser.feature.version}"&gt;
+       url="features/org.apache.directory.studio.ldapbrowser.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.ldapbrowser.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio LDAP Browser"/&gt;
    &lt;/feature&gt;
-   &lt;feature url="features/org.apache.directory.studio.schemaeditor.feature_${schemaeditor.feature.version}.jar"
-       id="org.apache.directory.studio.schemaeditor.feature" version="${schemaeditor.feature.version}"&gt;
+   &lt;feature url="features/org.apache.directory.studio.schemaeditor.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.schemaeditor.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Schema Editor"/&gt;
    &lt;/feature&gt;
-   &lt;feature url="features/org.apache.directory.studio.apacheds.configuration.feature_${apacheds.configuration.feature.version}.jar"
-       id="org.apache.directory.studio.apacheds.configuration.feature" version="${apacheds.configuration.feature.version}"&gt;
+   &lt;feature url="features/org.apache.directory.studio.apacheds.configuration.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.apacheds.configuration.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Apache DS"/&gt;
    &lt;/feature&gt;
-   &lt;feature url="features/org.apache.directory.studio.apacheds.feature_${apacheds.feature.version}.jar"
-       id="org.apache.directory.studio.apacheds.feature" version="${apacheds.feature.version}"&gt;
+   &lt;feature url="features/org.apache.directory.studio.apacheds.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.apacheds.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio Apache DS"/&gt;
    &lt;/feature&gt;
-   &lt;feature url="features/org.apache.directory.studio.ldifeditor.feature_${ldifeditor.feature.version}.jar"
-       id="org.apache.directory.studio.ldifeditor.feature" version="${ldifeditor.feature.version}"&gt;
+   &lt;feature url="features/org.apache.directory.studio.ldifeditor.feature_${pom.version}.jar"
+       id="org.apache.directory.studio.ldifeditor.feature" version="${pom.version}"&gt;
       &lt;category name="Apache Directory Studio LDIF Editor"/&gt;
    &lt;/feature&gt;
    &lt;category-def name="Apache Directory Studio RCP" label="Apache Directory Studio RCP"&gt;

Modified: directory/studio/trunk/valueeditors/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/pom.xml?rev=887167&amp;r1=887166&amp;r2=887167&amp;view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/pom.xml (original)
+++ directory/studio/trunk/valueeditors/pom.xml Fri Dec  4 12:11:49 2009
@@ -27,7 +27,6 @@
   &lt;/parent&gt;
   
   &lt;artifactId&gt;valueeditors&lt;/artifactId&gt;
-  &lt;version&gt;${valueeditors.version}&lt;/version&gt;
   &lt;name&gt;Apache Directory Studio Value Editors&lt;/name&gt;
   &lt;packaging&gt;jar&lt;/packaging&gt;
 




</pre>
</div>
</content>
</entry>
<entry>
<title>[continuum] BUILD FAILURE: Directory - Apache Directory Studio - clean deploy</title>
<author><name>&quot;Continuum@vmbuild.apache.org&quot; &lt;continuum@apache.org&gt;</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c14441491.11259925180978.JavaMail.continuum@vmbuild.apache.org%3e"/>
<id>urn:uuid:%3c14441491-11259925180978-JavaMail-continuum@vmbuild-apache-org%3e</id>
<updated>2009-12-04T11:12:59Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Online report : http://vmbuild.apache.org/continuum/buildResult.action?buildId=252256&amp;projectId=1591

Build statistics:
  State: Failed
  Previous State: Ok
  Started at: Fri 4 Dec 2009 03:07:51 -0800
  Finished at: Fri 4 Dec 2009 03:12:20 -0800
  Total time: 4m 28s
  Build Trigger: Schedule
  Build Number: 105
  Exit code: 1
  Building machine hostname: vmbuild.apache.org
  Operating system : Linux(unknown)
  Java Home version : 
          java version "1.5.0_12"
          Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_12-b04)
          Java HotSpot(TM) Client VM (build 1.5.0_12-b04, mixed mode, sharing)
        
  Builder version :
          Maven version: 2.0.9
          Java version: 1.5.0_12
          OS name: "linux" version: "2.6.24-23-server" arch: "i386" Family: "unix"
    
****************************************************************************
SCM Changes:
****************************************************************************
Changed: pamarcelot @ Wed 2 Dec 2009 05:49:12 -0800
Comment: Added the 'common.ui' plugin to the list of copied dependencies in the 'plugins'
folder.
Files changed:
  /directory/studio/trunk/updatesite/pom.xml ( 886142 )

Changed: pamarcelot @ Wed 2 Dec 2009 06:13:19 -0800
Comment: Fixed the build after the release. Brought back the version tags to every project.
Files changed:
  /directory/studio/trunk/aciitemeditor/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-configuration/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-configuration-feature/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-configuration-help/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-feature/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-help/pom.xml ( 886152 )
  /directory/studio/trunk/apacheds-launcher/pom.xml ( 886152 )
  /directory/studio/trunk/common-ui/pom.xml ( 886152 )
  /directory/studio/trunk/connection-core/pom.xml ( 886152 )
  /directory/studio/trunk/connection-ui/pom.xml ( 886152 )
  /directory/studio/trunk/help-pom.xml ( 886152 )
  /directory/studio/trunk/jars/pom.xml ( 886152 )
  /directory/studio/trunk/ldapbrowser-common/pom.xml ( 886152 )
  /directory/studio/trunk/ldapbrowser-core/pom.xml ( 886152 )
  /directory/studio/trunk/ldapbrowser-feature/pom.xml ( 886152 )
  /directory/studio/trunk/ldapbrowser-help/pom.xml ( 886152 )
  /directory/studio/trunk/ldapbrowser-ui/pom.xml ( 886152 )
  /directory/studio/trunk/ldif-parser/pom.xml ( 886152 )
  /directory/studio/trunk/ldifeditor/pom.xml ( 886152 )
  /directory/studio/trunk/ldifeditor-feature/pom.xml ( 886152 )
  /directory/studio/trunk/ldifeditor-help/pom.xml ( 886152 )
  /directory/studio/trunk/pom.xml ( 886152 )
  /directory/studio/trunk/rcp/pom.xml ( 886152 )
  /directory/studio/trunk/rcp-feature/pom.xml ( 886152 )
  /directory/studio/trunk/rcp-help/pom.xml ( 886152 )
  /directory/studio/trunk/repository/pom.xml ( 886152 )
  /directory/studio/trunk/schemaeditor/pom.xml ( 886152 )
  /directory/studio/trunk/schemaeditor-feature/pom.xml ( 886152 )
  /directory/studio/trunk/schemaeditor-help/pom.xml ( 886152 )
  /directory/studio/trunk/studio/pom.xml ( 886152 )
  /directory/studio/trunk/test-integration-core/pom.xml ( 886152 )
  /directory/studio/trunk/test-integration-ui/pom.xml ( 886152 )
  /directory/studio/trunk/updatesite/pom.xml ( 886152 )
  /directory/studio/trunk/valueeditors/pom.xml ( 886152 )

****************************************************************************
Dependencies Changes:
****************************************************************************
No dependencies changed


****************************************************************************
Build Definition:
****************************************************************************
POM filename: pom.xml
Goals: clean deploy   
Arguments: --batch-mode -Dintegration
Build Fresh: false
Always Build: false
Default Build Definition: true
Schedule: DEFAULT_SCHEDULE
Profile Name: Maven 2.0.9, Java 5, Large Memory
Description: clean deploy

****************************************************************************
Test Summary:
****************************************************************************
Tests: 101
Failures: 0
Errors: 0
Success Rate: 100
Total time: 1.1069999






</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887155 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204110046.BA82F23889DF@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204110046-BA82F23889DF@eris-apache-org%3e</id>
<updated>2009-12-04T11:00:46Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 11:00:46 2009
New Revision: 887155

URL: http://svn.apache.org/viewvc?rev=887155&amp;view=rev
Log:
Modified the initialization to speedup the tests

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887155&amp;r1=887154&amp;r2=887155&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 11:00:46 2009
@@ -32,16 +32,13 @@
 import javax.naming.directory.NoSuchAttributeException;
 
 import org.apache.commons.io.FileUtils;
-import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoaderTest;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
-import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
-import org.apache.directory.shared.schema.loader.ldif.SchemaEntityFactory;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -58,12 +55,15 @@
     // A directory in which the ldif files will be stored
     private static String workingDirectory;
 
+    // The schema repository
+    private static File schemaRepository;
+
+
     // A LDIF loader
-    private static LdifSchemaLoader ldifLoader;
+    //private static LdifSchemaLoader ldifLoader;
 
     // A SchemaObject factory
-    private static SchemaEntityFactory factory;
-
+    //private static SchemaEntityFactory factory;
 
     @BeforeClass
     public static void setup() throws Exception
@@ -72,19 +72,18 @@
 
         if ( workingDirectory == null )
         {
-            String path = LdifSchemaLoaderTest.class.getResource( "" ).getPath();
+            String path = SchemaManagerTest.class.getResource( "" ).getPath();
             int targetPos = path.indexOf( "target" );
             workingDirectory = path.substring( 0, targetPos + 6 );
         }
 
+        schemaRepository = new File( workingDirectory, "schema" );
+
         // Cleanup the target directory
-        FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
+        FileUtils.deleteDirectory( schemaRepository );
 
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
         extractor.extractOrCopy();
-
-        ldifLoader = new LdifSchemaLoader( new File( workingDirectory, "schema" ) );
-        factory = new SchemaEntityFactory();
     }
 
 
@@ -92,13 +91,13 @@
     public static void cleanup() throws IOException
     {
         // Cleanup the target directory
-        FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
+        FileUtils.deleteDirectory( schemaRepository );
     }
 
 
     private SchemaManager loadSystem() throws Exception
     {
-        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
+        LdifSchemaLoader loader = new LdifSchemaLoader( schemaRepository );
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
 
         String schemaName = "system";




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887142 - in /directory/shared/branches/shared-schema: ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204101019.260F923889B6@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204101019-260F923889B6@eris-apache-org%3e</id>
<updated>2009-12-04T10:10:18Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 10:10:18 2009
New Revision: 887142

URL: http://svn.apache.org/viewvc?rev=887142&amp;view=rev
Log:
o The size() method for OidRegistryis now public
o Added some more check in the AT tests

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887142&amp;r1=887141&amp;r2=887142&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 10:10:18 2009
@@ -129,6 +129,11 @@
 
 
     //=========================================================================
+    // For each test, we will check many different things.
+    // If the test is successful, we want to know if the SchemaObject
+    // Registry has grown : its size must be one bigger. If the SchemaObject
+    // is not loadable, then the GlobalOidRegistry must also have grwon.
+    //=========================================================================
     // AttributeType addition tests
     //-------------------------------------------------------------------------
     // First, not defined superior
@@ -140,6 +145,8 @@
     public void testAddAttributeTypeNoSupNoSyntaxNoSuperior() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -156,6 +163,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -166,6 +175,8 @@
     public void testAddAttributeTypeNoSupCollectiveUser() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -179,6 +190,8 @@
         assertTrue( schemaManager.add( attributeType ) );
 
         assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -189,6 +202,8 @@
     public void testAddAttributeTypeNoSupCollectiveOperational() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -208,6 +223,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -218,6 +235,8 @@
     public void testAddAttributeTypeNoSupNoUserModificationUserAplication() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -237,6 +256,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -247,6 +268,8 @@
     public void testAddAttributeTypeNoSupNoUserModificationOpAttr() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -260,6 +283,8 @@
         assertTrue( schemaManager.add( attributeType ) );
 
         assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -270,6 +295,8 @@
     public void testAddAttributeTypeNoSupInvalidEqualityMR() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "0.0" );
@@ -288,6 +315,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -298,6 +327,8 @@
     public void testAddAttributeTypeNoSupInvalidOrderingMR() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -316,6 +347,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -326,6 +359,8 @@
     public void testAddAttributeTypeNoSupInvalidSubstringMR() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -344,6 +379,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -354,6 +391,8 @@
     public void testAddAttributeTypeNoSupValidMR() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -366,6 +405,8 @@
         assertTrue( schemaManager.add( attributeType ) );
 
         assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -376,6 +417,8 @@
     public void testAddAttributeTypeAlreadyExist() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "2.5.18.4" );
         attributeType.setEqualityOid( "2.5.13.1" );
@@ -397,6 +440,8 @@
         // Check that it hasen't changed
         AttributeType original = schemaManager.lookupAttributeTypeRegistry( "2.5.18.4" );
         assertEquals( "distinguishedNameMatch", original.getEqualityOid() );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -411,6 +456,8 @@
     public void testAddAttributeTypeSupNoSyntaxNoSuperior() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -426,6 +473,8 @@
 
         assertEquals( "1.3.6.1.4.1.1466.115.121.1.12", result.getSyntaxOid() );
         assertEquals( "2.5.13.1", result.getEqualityOid() );
+        assertEquals( atrSize + 1, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize + 1, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -436,6 +485,8 @@
     public void testAddAttributeTypeSupDifferentUsage() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -454,6 +505,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -464,6 +517,8 @@
     public void testAddAttributeTypeSupWithOwnSup() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -482,6 +537,8 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 
 
@@ -492,6 +549,8 @@
     public void testAddAttributeTypeSupBadSup() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
+        int atrSize = schemaManager.getAttributeTypeRegistry().size();
+        int goidSize = schemaManager.getOidRegistry().size();
 
         AttributeType attributeType = new AttributeType( "1.1.0" );
         attributeType.setEqualityOid( null );
@@ -510,5 +569,7 @@
         assertTrue( error instanceof LdapSchemaViolationException );
 
         assertFalse( isATPresent( schemaManager, "1.1.0" ) );
+        assertEquals( atrSize, schemaManager.getAttributeTypeRegistry().size() );
+        assertEquals( goidSize, schemaManager.getOidRegistry().size() );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java?rev=887142&amp;r1=887141&amp;r2=887142&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
Fri Dec  4 10:10:18 2009
@@ -268,7 +268,7 @@
     /**
      * @return The number of stored OIDs
      */
-    protected int size()
+    public int size()
     {
         return byOid.size();
     }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887015 - /directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204003245.3421323888FD@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204003245-3421323888FD@eris-apache-org%3e</id>
<updated>2009-12-04T00:32:45Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 00:32:44 2009
New Revision: 887015

URL: http://svn.apache.org/viewvc?rev=887015&amp;view=rev
Log:
Fixed a nasty bug in the binary values serialization, when the normalized value was different
from the UP value : we got a OOM error as the length of the normalized value was wrongly encoded
as a char, not an int.

Modified:
    directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java

Modified: directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java?rev=887015&amp;r1=887014&amp;r2=887015&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-entry/src/main/java/org/apache/directory/server/core/entry/ServerBinaryValue.java
Fri Dec  4 00:32:44 2009
@@ -54,7 +54,7 @@
 {
     /** Used for serialization */
     private static final long serialVersionUID = 2L;
-    
+
     /** logger for reporting errors that might not be handled properly upstream */
     private static final Logger LOG = LoggerFactory.getLogger( ServerBinaryValue.class );
 
@@ -74,11 +74,11 @@
      */
     protected String logAssert( String message )
     {
-        LOG.error(  message );
+        LOG.error( message );
         return message;
     }
 
-    
+
     /**
      *  Check the attributeType member. It should not be null, 
      *  and it should contains a syntax.
@@ -89,7 +89,7 @@
         {
             return "The AttributeType parameter should not be null";
         }
-        
+
         if ( attributeType.getSyntax() == null )
         {
             return "There is no Syntax associated with this attributeType";
@@ -98,7 +98,7 @@
         return null;
     }
 
-    
+
     // -----------------------------------------------------------------------
     // Constructors
     // -----------------------------------------------------------------------
@@ -110,7 +110,7 @@
     public ServerBinaryValue( AttributeType attributeType )
     {
         super();
-        
+
         if ( attributeType == null )
         {
             throw new IllegalArgumentException( "The AttributeType parameter should not be
null" );
@@ -151,7 +151,7 @@
      * @param wrapped the value to wrap which can be null
      * @param normalizedValue the normalized value
      */
-    /** No protection */ 
+    /** No protection */
     ServerBinaryValue( AttributeType attributeType, byte[] wrapped, byte[] normalizedValue,
boolean same, boolean valid )
     {
         super( wrapped );
@@ -159,7 +159,7 @@
         this.attributeType = attributeType;
         this.normalizedValue = normalizedValue;
         this.valid = valid;
-        this.same = same;
+        this.same = same;
         //this.oid = attributeType.getOid();
     }
 
@@ -174,11 +174,11 @@
             // Bypass the normalization if it has already been done. 
             return;
         }
-        
+
         if ( wrapped != null )
         {
             Normalizer normalizer = getNormalizer();
-    
+
             if ( normalizer == null )
             {
                 normalizedValue = wrapped;
@@ -200,7 +200,7 @@
         }
     }
 
-    
+
     /**
      * Gets the normalized (canonical) representation for the wrapped string.
      * If the wrapped String is null, null is returned, otherwise the normalized
@@ -246,7 +246,7 @@
      *
      * @return gets the normalized value
      */
-    public byte[] getNormalizedValue() 
+    public byte[] getNormalizedValue()
     {
         if ( isNull() )
         {
@@ -302,7 +302,7 @@
 
         if ( normalizedValue != null )
         {
-            byte[] copy = new byte[ normalizedValue.length ];
+            byte[] copy = new byte[normalizedValue.length];
             System.arraycopy( normalizedValue, 0, copy, 0, normalizedValue.length );
             return copy;
         }
@@ -330,10 +330,10 @@
         }
 
         valid = attributeType.getSyntax().getSyntaxChecker().isValidSyntax( getReference()
);
-        
+
         return valid;
     }
-    
+
 
     /**
      *
@@ -356,7 +356,7 @@
         }
         else
         {
-            if ( ( value == null ) || value.isNull() ) 
+            if ( ( value == null ) || value.isNull() )
             {
                 return 1;
             }
@@ -369,28 +369,29 @@
             try
             {
                 Comparator&lt;? super byte[]&gt; comparator = getLdapComparator();
-                
+
                 if ( comparator != null )
                 {
-                    return comparator.compare( getNormalizedValueReference(), binaryValue.getNormalizedValueReference()
);
+                    return comparator
+                        .compare( getNormalizedValueReference(), binaryValue.getNormalizedValueReference()
);
                 }
                 else
                 {
-                    return new ByteArrayComparator( null ).compare( getNormalizedValueReference(),

-                        binaryValue.getNormalizedValueReference() );
+                    return new ByteArrayComparator( null ).compare( getNormalizedValueReference(),
binaryValue
+                        .getNormalizedValueReference() );
                 }
             }
             catch ( NamingException e )
             {
-                String msg = "Failed to compare normalized values for " + Arrays.toString(
getReference() )
-                        + " and " + value;
+                String msg = "Failed to compare normalized values for " + Arrays.toString(
getReference() ) + " and "
+                    + value;
                 LOG.error( msg, e );
                 throw new IllegalStateException( msg, e );
             }
         }
 
-        String message = "I don't really know how to compare anything other " +
-        "than ServerBinaryValues at this point in time.";
+        String message = "I don't really know how to compare anything other "
+            + "than ServerBinaryValues at this point in time.";
         LOG.error( message );
         throw new NotImplementedException( message );
     }
@@ -463,18 +464,18 @@
             return true;
         }
 
-        if ( ! ( obj instanceof ServerBinaryValue ) )
+        if ( !( obj instanceof ServerBinaryValue ) )
         {
             return false;
         }
 
         ServerBinaryValue other = ( ServerBinaryValue ) obj;
-        
+
         if ( !attributeType.equals( other.attributeType ) )
         {
             return false;
         }
-        
+
         if ( isNull() )
         {
             return other.isNull();
@@ -578,21 +579,21 @@
 
         return mr.getLdapComparator();
     }
-    
-    
+
+
     /**
      * @return a copy of the current value
      */
     public ServerBinaryValue clone()
     {
-        ServerBinaryValue clone = (ServerBinaryValue)super.clone();
-        
+        ServerBinaryValue clone = ( ServerBinaryValue ) super.clone();
+
         if ( normalizedValue != null )
         {
-            clone.normalizedValue = new byte[ normalizedValue.length ];
+            clone.normalizedValue = new byte[normalizedValue.length];
             System.arraycopy( normalizedValue, 0, clone.normalizedValue, 0, normalizedValue.length
);
         }
-        
+
         return clone;
     }
 
@@ -602,13 +603,13 @@
      * 
      * We can't use this method for a ServerBinaryValue, as we have to feed the value
      * with an AttributeType object
-     */ 
+     */
     public void writeExternal( ObjectOutput out ) throws IOException
     {
         throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue"
);
     }
-    
-    
+
+
     /**
      * We will write the value and the normalized value, only
      * if the normalized value is different.
@@ -633,18 +634,18 @@
         {
             // write a the wrapped length
             out.writeInt( wrapped.length );
-            
+
             // Write the data if not empty
             if ( wrapped.length &gt; 0 )
             {
                 // The data
                 out.write( wrapped );
-                
+
                 // Normalize the data
                 try
                 {
                     normalize();
-                    
+
                     if ( !normalized )
                     {
                         // We may not have a normalizer. Just get out
@@ -655,7 +656,7 @@
                     {
                         // Write a flag indicating that the data has been normalized
                         out.writeBoolean( true );
-                        
+
                         if ( Arrays.equals( getReference(), normalizedValue ) )
                         {
                             // Write the 'same = true' flag
@@ -665,10 +666,10 @@
                         {
                             // Write the 'same = false' flag
                             out.writeBoolean( false );
-                            
+
                             // Write the normalized value length
-                            out.write( normalizedValue.length );
-                            
+                            out.writeInt( normalizedValue.length );
+
                             if ( normalizedValue.length &gt; 0 )
                             {
                                 // Write the normalized value if not empty
@@ -693,7 +694,7 @@
         }
     }
 
-    
+
     /**
      * @see Externalizable#readExternal(ObjectInput)
      * 
@@ -704,7 +705,7 @@
     {
         throw new IllegalStateException( "Cannot use standard serialization for a ServerStringValue"
);
     }
-    
+
 
     /**
      * 
@@ -718,7 +719,7 @@
     {
         // The UP value length
         int wrappedLength = in.readInt();
-        
+
         if ( wrappedLength == -1 )
         {
             // If the value is null, the length will be set to -1
@@ -727,35 +728,35 @@
         }
         else if ( wrappedLength == 0 )
         {
-             wrapped = StringTools.EMPTY_BYTES;
-             same = true;
-             normalized = true;
-             normalizedValue = wrapped;
+            wrapped = StringTools.EMPTY_BYTES;
+            same = true;
+            normalized = true;
+            normalizedValue = wrapped;
         }
         else
         {
             wrapped = new byte[wrappedLength];
-            
+
             // Read the data
             in.readFully( wrapped );
-            
+
             // Check if we have a normalized value
             normalized = in.readBoolean();
-            
+
             if ( normalized )
             {
                 // Read the 'same' flag
                 same = in.readBoolean();
-                
+
                 if ( !same )
                 {
                     // Read the normalizedvalue length
                     int normalizedLength = in.readInt();
-                
+
                     if ( normalizedLength &gt; 0 )
                     {
                         normalizedValue = new byte[normalizedLength];
-                        
+
                         // Read the normalized value
                         in.read( normalizedValue, 0, normalizedLength );
                     }
@@ -772,4 +773,4 @@
             }
         }
     }
-}
+}




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r887004 - in /directory/shared/branches/shared-schema: ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091204000244.8E5A923889E4@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091204000244-8E5A923889E4@eris-apache-org%3e</id>
<updated>2009-12-04T00:02:44Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Fri Dec  4 00:02:43 2009
New Revision: 887004

URL: http://svn.apache.org/viewvc?rev=887004&amp;view=rev
Log:
o Fixed the Registries clone() method, the schema content was not being cloned
o Added some tests

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=887004&amp;r1=887003&amp;r2=887004&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Fri Dec  4 00:02:43 2009
@@ -22,13 +22,15 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
 import java.util.List;
 
+import javax.naming.NamingException;
+import javax.naming.directory.NoSuchAttributeException;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoaderTest;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
@@ -107,6 +109,25 @@
     }
 
 
+    private boolean isATPresent( SchemaManager schemaManager, String oid )
+    {
+        try
+        {
+            AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid
);
+
+            return attributeType != null;
+        }
+        catch ( NoSuchAttributeException nsae )
+        {
+            return false;
+        }
+        catch ( NamingException ne )
+        {
+            return false;
+        }
+    }
+
+
     //=========================================================================
     // AttributeType addition tests
     //-------------------------------------------------------------------------
@@ -133,6 +154,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -155,7 +178,7 @@
         // It should not fail
         assertTrue( schemaManager.add( attributeType ) );
 
-        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -183,6 +206,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -210,6 +235,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -232,7 +259,7 @@
         // It should not fail
         assertTrue( schemaManager.add( attributeType ) );
 
-        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -259,6 +286,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -285,6 +314,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -311,6 +342,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -332,7 +365,38 @@
         // It should not fail
         assertTrue( schemaManager.add( attributeType ) );
 
-        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
+        assertTrue( isATPresent( schemaManager, "1.1.0" ) );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which already exist
+     */
+    @Test
+    public void testAddAttributeTypeAlreadyExist() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "2.5.18.4" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( "2.5.13.1" );
+        attributeType.setSubstringOid( "2.5.13.1" );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
+        // The AT must be there
+        assertTrue( isATPresent( schemaManager, "2.5.18.4" ) );
+
+        // Check that it hasen't changed
+        AttributeType original = schemaManager.lookupAttributeTypeRegistry( "2.5.18.4" );
+        assertEquals( "distinguishedNameMatch", original.getEqualityOid() );
     }
 
 
@@ -388,6 +452,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -414,6 +480,8 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 
 
@@ -440,5 +508,7 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+
+        assertFalse( isATPresent( schemaManager, "1.1.0" ) );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=887004&amp;r1=887003&amp;r2=887004&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Fri Dec  4 00:02:43 2009
@@ -2325,6 +2325,16 @@
         // Now, check the registries. We don't care about errors
         clone.checkRefInteg();
 
+        clone.schemaObjects = new HashMap&lt;String, Set&lt;SchemaObjectWrapper&gt;&gt;();
+
+        // Last, not least, clone the SchemaObjects Map. It will be empty
+        for ( String schemaName : schemaObjects.keySet() )
+        {
+            Set&lt;SchemaObjectWrapper&gt; objects = new HashSet&lt;SchemaObjectWrapper&gt;();
+
+            clone.schemaObjects.put( schemaName, objects );
+        }
+
         return clone;
     }
 




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886868 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203180755.97E0A2388962@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203180755-97E0A2388962@eris-apache-org%3e</id>
<updated>2009-12-03T18:07:55Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 18:07:55 2009
New Revision: 886868

URL: http://svn.apache.org/viewvc?rev=886868&amp;view=rev
Log:
Added an extra test for AT to check that the superior is existing

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886868&amp;r1=886867&amp;r2=886868&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Thu Dec  3 18:07:55 2009
@@ -415,4 +415,30 @@
 
         assertTrue( error instanceof LdapSchemaViolationException );
     }
+
+
+    /**
+     * Try to inject an AttributeType with a bad superior
+     */
+    @Test
+    public void testAddAttributeTypeSupBadSup() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "0.0" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886866 - in /directory/shared/branches/shared-schema: ldap-schema-loader/src/test/java/org/apache/directory/server/schema/ ldap/src/main/java/org/apache/directory/shared/ldap/schema/ ldap/src/main/java/org/apache/directory/shared/ldap/sche...</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203180135.F423123889E5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203180135-F423123889E5@eris-apache-org%3e</id>
<updated>2009-12-03T18:01:35Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 18:01:34 2009
New Revision: 886866

URL: http://svn.apache.org/viewvc?rev=886866&amp;view=rev
Log:
o Implemented all the tests for a AT addition into the schemaMnager
o Fixed some bad handling of the cycle detection
o Fixed some other issues

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886866&amp;r1=886865&amp;r2=886866&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java (original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java Thu Dec  3 18:01:34 2009
@@ -22,6 +22,7 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 
 import java.io.File;
@@ -106,14 +107,16 @@
     }
 
 
-    //-------------------------------------------------------------------------
+    //=========================================================================
     // AttributeType addition tests
     //-------------------------------------------------------------------------
+    // First, not defined superior
+    //-------------------------------------------------------------------------
     /**
      * Try to inject an AttributeType without any superior nor Syntax : it's invalid
      */
     @Test
-    public void testAddAttributeTypeNoSyntaxNoSuperior() throws Exception
+    public void testAddAttributeTypeNoSupNoSyntaxNoSuperior() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
 
@@ -121,7 +124,6 @@
         attributeType.setEqualityOid( "2.5.13.1" );
         attributeType.setOrderingOid( null );
         attributeType.setSubstringOid( null );
-        attributeType.setSuperior( ( String ) null );
 
         // It should fail
         assertFalse( schemaManager.add( attributeType ) );
@@ -138,7 +140,7 @@
      * Try to inject an AttributeType which is Collective, and userApplication AT
      */
     @Test
-    public void testAddAttributeTypeCollectiveUser() throws Exception
+    public void testAddAttributeTypeNoSupCollectiveUser() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
 
@@ -151,7 +153,9 @@
         attributeType.setCollective( true );
 
         // It should not fail
-        schemaManager.add( attributeType );
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
     }
 
 
@@ -159,7 +163,7 @@
      * Try to inject an AttributeType which is Collective, but an operational AT
      */
     @Test
-    public void testAddAttributeTypeCollectiveOperational() throws Exception
+    public void testAddAttributeTypeNoSupCollectiveOperational() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
 
@@ -172,6 +176,210 @@
         attributeType.setCollective( true );
 
         // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is a NO-USER-MODIFICATION and userApplication
+     */
+    @Test
+    public void testAddAttributeTypeNoSupNoUserModificationUserAplication() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+        attributeType.setUserModifiable( false );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is a NO-USER-MODIFICATION and is operational
+     */
+    @Test
+    public void testAddAttributeTypeNoSupNoUserModificationOpAttr() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+        attributeType.setUserModifiable( false );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid EQUALITY MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidEqualityMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "0.0" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid ORDERING MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidOrderingMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( "0.0" );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with an invalid SUBSTR MR
+     */
+    @Test
+    public void testAddAttributeTypeNoSupInvalidSubstringMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( "0.0" );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with valid MRs
+     */
+    @Test
+    public void testAddAttributeTypeNoSupValidMR() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( "2.5.13.1" );
+        attributeType.setSubstringOid( "2.5.13.1" );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        assertNotNull( schemaManager.lookupAttributeTypeRegistry( "1.1.0" ) );
+    }
+
+
+    //-------------------------------------------------------------------------
+    // Then, with a superior
+    //-------------------------------------------------------------------------
+    /**
+     * Try to inject an AttributeType with a superior and no Syntax : it should
+     * take its superior' syntax and MR
+     */
+    @Test
+    public void testAddAttributeTypeSupNoSyntaxNoSuperior() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "2.5.18.4" );
+        attributeType.setUsage( UsageEnum.DIRECTORY_OPERATION );
+
+        // It should not fail
+        assertTrue( schemaManager.add( attributeType ) );
+
+        AttributeType result = schemaManager.lookupAttributeTypeRegistry( "1.1.0" );
+
+        assertEquals( "1.3.6.1.4.1.1466.115.121.1.12", result.getSyntaxOid() );
+        assertEquals( "2.5.13.1", result.getEqualityOid() );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with a superior and different USAGE
+     */
+    @Test
+    public void testAddAttributeTypeSupDifferentUsage() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "2.5.18.4" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
         // It should fail
         assertFalse( schemaManager.add( attributeType ) );
 
@@ -180,6 +388,31 @@
         Throwable error = errors.get( 0 );
 
         assertTrue( error instanceof LdapSchemaViolationException );
+    }
+
+
+    /**
+     * Try to inject an AttributeType with itself as a superior
+     */
+    @Test
+    public void testAddAttributeTypeSupWithOwnSup() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
 
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( null );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperiorOid( "1.1.0" );
+        attributeType.setUsage( UsageEnum.DISTRIBUTED_OPERATION );
+
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java?rev=886866&amp;r1=886865&amp;r2=886866&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/AttributeType.java Thu Dec  3 18:01:34 2009
@@ -147,37 +147,37 @@
 
     /** The serialVersionUID */
     public static final long serialVersionUID = 1L;
-    
+
     /** The syntax OID associated with this AttributeType */
     private String syntaxOid;
-    
+
     /** The syntax associated with the syntaxID */
     private LdapSyntax syntax;
-    
+
     /** The equality OID associated with this AttributeType */
     private String equalityOid;
 
     /** The equality MatchingRule associated with the equalityID */
     private MatchingRule equality;
-    
+
     /** The substring OID associated with this AttributeType */
     private String substringOid;
 
     /** The substring MatchingRule associated with the substringID */
     private MatchingRule substring;
-    
+
     /** The ordering OID associated with this AttributeType */
     private String orderingOid;
-    
+
     /** The ordering MatchingRule associated with the orderingID */
     private MatchingRule ordering;
-    
+
     /** The superior AttributeType OID */
     private String superiorOid;
-    
+
     /** The superior AttributeType */
     private AttributeType superior;
-    
+
     /** whether or not this type is single valued */
     private boolean isSingleValued = false;
 
@@ -192,7 +192,8 @@
 
     /** the length of this attribute in bytes */
     private int syntaxLength = 0;
-    
+
+
     /**
      * Creates a AttributeType object using a unique OID.
      * 
@@ -202,16 +203,16 @@
     {
         super( SchemaObjectType.ATTRIBUTE_TYPE, oid );
     }
-    
-    
+
+
     /**
      * Build the Superior AttributeType reference for an AttributeType
      */
-    private void buildSuperior(List&lt;Throwable&gt; errors, Registries registries )
+    private boolean buildSuperior( List&lt;Throwable&gt; errors, Registries registries )
     {
         AttributeType superior = null;
         AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();
-        
+
         if ( superiorOid != null )
         {
             // This AT has a superior
@@ -222,32 +223,29 @@
             catch ( Exception e )
             {
                 // Not allowed.
-                String msg = "Cannot find the SUPERIOR object " + superiorOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find the SUPERIOR object " + superiorOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
-                
+
                 // Get out now
-                return;
+                return false;
             }
-            
+
             if ( superior != null )
             {
                 this.superior = superior;
-                
+
                 // Recursively update the superior if not already done. We don't recurse
                 // if the superior's superior is not null, as it means it has already been
                 // handled.
-                if ( //( ( registries.getUsing( superior ) == null ) || registries.getUsing( superior ).isEmpty() ) &amp;&amp; 
-                     ( superior.getSuperior() == null ) )
+                if ( superior.getSuperior() == null )
                 {
                     registries.buildReference( errors, superior );
                 }
-                
+
                 // Update the descendant MAP
                 try
                 {
@@ -257,28 +255,30 @@
                 {
                     errors.add( ne );
                     LOG.info( ne.getMessage() );
+                    return false;
                 }
-                
+
                 // Check for cycles now
                 Set&lt;String&gt; superiors = new HashSet&lt;String&gt;();
                 superiors.add( oid );
                 AttributeType tmp = superior;
-                
+                boolean isOk = true;
+
                 while ( tmp != null )
                 {
                     if ( superiors.contains( tmp.getOid() ) )
                     {
                         // There is a cycle : bad bad bad !
                         // Not allowed.
-                        String msg = "A cycle has been detected in the superior hierarchyOid" + 
-                            " while building cross-references for the " + getName() + 
-                            " AttributeType.";
+                        String msg = "A cycle has been detected in the superior hierarchyOid"
+                            + " while building cross-references for the " + getName() + " AttributeType.";
 
-                        Throwable error = new LdapSchemaViolationException( 
-                            msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                        Throwable error = new LdapSchemaViolationException( msg,
+                            ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                         errors.add( error );
                         LOG.info( msg );
-                        
+                        isOk = false;
+
                         break;
                     }
                     else
@@ -287,35 +287,33 @@
                         tmp = tmp.getSuperior();
                     }
                 }
-                
+
                 superiors.clear();
-                
-                return;
+
+                return isOk;
             }
             else
             {
                 // Not allowed.
-                String msg = "Cannot find the SUPERIOR object " + superiorOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find the SUPERIOR object " + superiorOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
-                
+
                 // Get out now
-                return;
+                return false;
             }
         }
         else
         {
             // No superior, just return
-            return;
+            return true;
         }
     }
 
-    
+
     /**
      * Build the SYNTAX reference for an AttributeType
      */
@@ -324,7 +322,7 @@
         if ( syntaxOid != null )
         {
             LdapSyntax syntax = null;
-            
+
             try
             {
                 syntax = registries.getLdapSyntaxRegistry().lookup( syntaxOid );
@@ -332,17 +330,15 @@
             catch ( NamingException ne )
             {
                 // Not allowed.
-                String msg = "Cannot find a Syntax object " + syntaxOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find a Syntax object " + syntaxOid + " while building cross-references for the "
+                    + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
             }
-            
+
             if ( syntax != null )
             {
                 // Update the Syntax reference
@@ -351,12 +347,10 @@
             else
             {
                 // Not allowed.
-                String msg = "Cannot find a Syntax object " + syntaxOid + 
-                " while building cross-references for the " + getName() + 
-                " AttributeType.";
+                String msg = "Cannot find a Syntax object " + syntaxOid + " while building cross-references for the "
+                    + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
@@ -368,23 +362,23 @@
             if ( superior != null )
             {
                 this.syntax = superior.getSyntax();
+                this.syntaxOid = this.syntax.getOid();
             }
             else
             {
                 // Not allowed.
-                String msg = "The AttributeType " + getName() + " must have " +
-                    "a syntax OID or a superior, it does not have any.";
-    
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                String msg = "The AttributeType " + getName() + " must have "
+                    + "a syntax OID or a superior, it does not have any.";
+
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
             }
         }
     }
-    
-    
+
+
     /**
      * Build the EQUALITY MR reference for an AttributeType
      */
@@ -394,7 +388,7 @@
         if ( equalityOid != null )
         {
             MatchingRule equality = null;
-            
+
             try
             {
                 equality = registries.getMatchingRuleRegistry().lookup( equalityOid );
@@ -402,17 +396,15 @@
             catch ( NamingException ne )
             {
                 // Not allowed.
-                String msg = "Cannot find an Equality MatchingRule object for " + equalityOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find an Equality MatchingRule object for " + equalityOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
             }
-            
+
             if ( equality != null )
             {
                 this.equality = equality;
@@ -420,12 +412,10 @@
             else
             {
                 // Not allowed.
-                String msg = "Cannot find an EQUALITY MatchingRule instance for " + equalityOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find an EQUALITY MatchingRule instance for " + equalityOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
             }
@@ -436,11 +426,12 @@
             if ( ( superior != null ) &amp;&amp; ( superior.getEquality() != null ) )
             {
                 this.equality = superior.getEquality();
+                this.equalityOid = this.equality.getOid();
             }
         }
     }
-    
-    
+
+
     /**
      * Build the ORDERING MR reference for an AttributeType
      */
@@ -449,7 +440,7 @@
         if ( orderingOid != null )
         {
             MatchingRule ordering = null;
-            
+
             try
             {
                 ordering = registries.getMatchingRuleRegistry().lookup( orderingOid );
@@ -457,17 +448,15 @@
             catch ( NamingException ne )
             {
                 // Not allowed.
-                String msg = "Cannot find a Ordering MatchingRule object for " + orderingOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find a Ordering MatchingRule object for " + orderingOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
             }
-            
+
             if ( ordering != null )
             {
                 this.ordering = ordering;
@@ -475,12 +464,10 @@
             else
             {
                 // Not allowed.
-                String msg = "Cannot find an ORDERING MatchingRule instance for " + orderingOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find an ORDERING MatchingRule instance for " + orderingOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
             }
@@ -491,11 +478,12 @@
             if ( ( superior != null ) &amp;&amp; ( superior.getOrdering() != null ) )
             {
                 this.ordering = superior.getOrdering();
+                this.orderingOid = this.ordering.getOid();
             }
         }
     }
 
-    
+
     /**
      * Build the SUBSTR MR reference for an AttributeType
      */
@@ -505,7 +493,7 @@
         if ( substringOid != null )
         {
             MatchingRule substring = null;
-            
+
             try
             {
                 substring = registries.getMatchingRuleRegistry().lookup( substringOid );
@@ -513,17 +501,15 @@
             catch ( NamingException ne )
             {
                 // Not allowed.
-                String msg = "Cannot find a SUBSTR MatchingRule object for " + substringOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find a SUBSTR MatchingRule object for " + substringOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
             }
-            
+
             if ( substring != null )
             {
                 this.substring = substring;
@@ -531,12 +517,10 @@
             else
             {
                 // Not allowed.
-                String msg = "Cannot find a SUBSTR MatchingRule instance for " + substringOid + 
-                    " while building cross-references for the " + getName() + 
-                    " AttributeType.";
+                String msg = "Cannot find a SUBSTR MatchingRule instance for " + substringOid
+                    + " while building cross-references for the " + getName() + " AttributeType.";
 
-                Throwable error = new LdapSchemaViolationException( 
-                    msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
                 errors.add( error );
                 LOG.info( msg );
                 return;
@@ -548,11 +532,12 @@
             if ( ( superior != null ) &amp;&amp; ( superior.getSubstring() != null ) )
             {
                 this.substring = superior.getSubstring();
+                this.substringOid = this.substring.getOid();
             }
         }
     }
 
-    
+
     /**
      * Check the constraints for the Usage field.
      */
@@ -562,30 +547,28 @@
         if ( ( superior != null ) &amp;&amp; ( usage != superior.getUsage() ) )
         {
             // This is an error
-            String msg = "The attributeType " + getName() + " must have the same USAGE than its superior"; 
+            String msg = "The attributeType " + getName() + " must have the same USAGE than its superior";
 
-            Throwable error = new LdapSchemaViolationException( 
-                msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
             LOG.info( msg );
             return;
         }
-        
+
         // Now, check that the AttributeType's USAGE does not conflict
         if ( !isUserModifiable() &amp;&amp; ( usage == UsageEnum.USER_APPLICATIONS ) )
         {
             // Cannot have a not user modifiable AT which is not an operational AT
-            String msg = "The attributeType " + getName() + " is a USER-APPLICATION attribute, " +
-                "it must be USER-MODIFIABLE"; 
-            
-            Throwable error = new LdapSchemaViolationException( 
-                msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            String msg = "The attributeType " + getName() + " is a USER-APPLICATION attribute, "
+                + "it must be USER-MODIFIABLE";
+
+            Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
             LOG.info( msg );
         }
     }
-    
-    
+
+
     /**
      * Check the constraints for the Collective field.
      */
@@ -603,17 +586,16 @@
         if ( isCollective() &amp;&amp; ( usage != UsageEnum.USER_APPLICATIONS ) )
         {
             // An AttributeType which is collective must be a USER attributeType
-            String msg = "The attributeType " + getName() + " is a COLLECTIVE AttributeType, " +
-                ", it must be a USER-APPLICATION attributeType too.";
-            
-            Throwable error = new LdapSchemaViolationException( 
-                msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
+            String msg = "The attributeType " + getName() + " is a COLLECTIVE AttributeType, "
+                + ", it must be a USER-APPLICATION attributeType too.";
+
+            Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX );
             errors.add( error );
             LOG.info( msg );
         }
     }
-    
-    
+
+
     /**
      * Inject the registries into this Object, updating the references to
      * other SchemaObject.
@@ -629,31 +611,35 @@
         if ( registries != null )
         {
             AttributeTypeRegistry attributeTypeRegistry = registries.getAttributeTypeRegistry();
-            
+
             // The superior
-            buildSuperior( errors, registries );
-            
+            if ( !buildSuperior( errors, registries ) )
+            {
+                // We have had errors, let's stop here as we need a correct superior to continue
+                return;
+            }
+
             // The Syntax
             buildSyntax( errors, registries );
-            
+
             // The EQUALITY matching rule
             buildEquality( errors, registries );
-            
+
             // The ORDERING matching rule
             buildOrdering( errors, registries );
-            
+
             // The SUBSTR matching rule
             buildSubstring( errors, registries );
-            
+
             // Check the USAGE
             checkUsage( errors, registries );
-            
+
             // Check the COLLECTIVE element
             checkCollective( errors, registries );
-            
+
             // Inject the attributeType into the oid/normalizer map
             attributeTypeRegistry.addMappingFor( this );
-    
+
             // Register this AttributeType into the Descendant map
             attributeTypeRegistry.registerDescendants( this, superior );
 
@@ -665,32 +651,32 @@
              */
             if ( equality != null )
             {
-               registries. addReference( this, equality );
+                registries.addReference( this, equality );
             }
-            
+
             if ( ordering != null )
             {
                 registries.addReference( this, ordering );
             }
-            
+
             if ( substring != null )
             {
                 registries.addReference( this, substring );
             }
-            
+
             if ( syntax != null )
             {
                 registries.addReference( this, syntax );
             }
-            
+
             if ( superior != null )
             {
                 registries.addReference( this, superior );
             }
         }
     }
-    
-    
+
+
     /**
      * Gets whether or not this AttributeType is single-valued.
      * 
@@ -716,7 +702,7 @@
         }
     }
 
-    
+
     /**
      * Gets whether or not this AttributeType can be modified by a user.
      * 
@@ -727,7 +713,7 @@
         return canUserModify;
     }
 
-    
+
     /**
      * Tells if this AttributeType can be modified by a user or not
      *
@@ -740,7 +726,7 @@
             this.canUserModify = canUserModify;
         }
     }
-    
+
 
     /**
      * Gets whether or not this AttributeType is a collective attribute.
@@ -762,8 +748,8 @@
     {
         this.isCollective = collective;
     }
-    
-    
+
+
     /**
      * Sets the collective flag
      *
@@ -776,8 +762,8 @@
             this.isCollective = collective;
         }
     }
-    
-    
+
+
     /**
      * Determines the usage for this AttributeType.
      * 
@@ -806,8 +792,8 @@
             this.usage = usage;
         }
     }
-    
-    
+
+
     /**
      * Updates the AttributeType usage, one of :&lt;br&gt;
      * &lt;li&gt;USER_APPLICATIONS
@@ -822,7 +808,7 @@
     {
         this.usage = usage;
     }
-    
+
 
     /**
      * Gets a length limit for this AttributeType.
@@ -833,8 +819,8 @@
     {
         return syntaxLength;
     }
-    
-    
+
+
     /**
      * Sets the length limit of this AttributeType based on its associated
      * syntax.
@@ -848,8 +834,8 @@
             this.syntaxLength = length;
         }
     }
-    
-    
+
+
     /**
      * Gets the the superior AttributeType of this AttributeType.
      * 
@@ -860,7 +846,7 @@
         return superior;
     }
 
-    
+
     /**
      * Gets the OID of the superior AttributeType for this AttributeType.
      * 
@@ -871,7 +857,7 @@
         return superiorOid;
     }
 
-    
+
     /**
      * Gets the Name of the superior AttributeType for this AttributeType.
      * 
@@ -889,7 +875,7 @@
         }
     }
 
-    
+
     /**
      * Sets the superior AttributeType OID of this AttributeType
      *
@@ -902,7 +888,7 @@
             this.superiorOid = superiorOid;
         }
     }
-    
+
 
     /**
      * Sets the superior for this AttributeType
@@ -917,7 +903,7 @@
             this.superiorOid = superior.getOid();
         }
     }
-    
+
 
     /**
      * Sets the superior oid for this AttributeType
@@ -997,7 +983,7 @@
             this.syntaxOid = syntaxOid;
         }
     }
-    
+
 
     /**
      * Sets the Syntax for this AttributeType
@@ -1013,7 +999,7 @@
         }
     }
 
-    
+
     /**
      * Update the associated Syntax, even if the SchemaObject is readOnly
      *
@@ -1025,7 +1011,7 @@
         this.syntaxOid = syntax.getOid();
     }
 
-    
+
     /**
      * Gets the MatchingRule for this AttributeType used for equality matching.
      * 
@@ -1078,7 +1064,7 @@
             this.equalityOid = equalityOid;
         }
     }
-    
+
 
     /**
      * Sets the Equality MR for this AttributeType
@@ -1093,7 +1079,7 @@
             this.equalityOid = equality.getOid();
         }
     }
-    
+
 
     /**
      * Update the associated Equality MatchingRule, even if the SchemaObject is readOnly
@@ -1105,7 +1091,7 @@
         this.equality = equality;
         this.equalityOid = equality.getOid();
     }
-    
+
 
     /**
      * Gets the MatchingRule for this AttributeType used for Ordering matching.
@@ -1159,7 +1145,7 @@
             this.orderingOid = orderingOid;
         }
     }
-    
+
 
     /**
      * Sets the Ordering MR for this AttributeType
@@ -1175,7 +1161,7 @@
         }
     }
 
-    
+
     /**
      * Update the associated Ordering MatchingRule, even if the SchemaObject is readOnly
      *
@@ -1187,7 +1173,7 @@
         this.orderingOid = ordering.getOid();
     }
 
-    
+
     /**
      * Gets the MatchingRule for this AttributeType used for Substr matching.
      * 
@@ -1240,7 +1226,7 @@
             this.substringOid = substrOid;
         }
     }
-    
+
 
     /**
      * Sets the Substr MR for this AttributeType
@@ -1286,7 +1272,7 @@
         return isAncestorOrEqual( this, descendant );
     }
 
-    
+
     /**
      * Checks to see if this AttributeType is the descendant of another
      * attributeType.
@@ -1337,8 +1323,8 @@
     {
         return objectType + " " + DescriptionUtils.getDescription( this );
     }
-    
-    
+
+
     /**
      * Copy an AttributeType
      */
@@ -1348,25 +1334,25 @@
 
         // Copy the SchemaObject common data
         copy.copy( this );
-        
+
         // Copy the canUserModify flag
         copy.canUserModify = canUserModify;
-        
+
         // Copy the isCollective flag
         copy.isCollective = isCollective;
-        
+
         // Copy the isSingleValue flag
         copy.isSingleValued = isSingleValued;
-        
+
         // Copy the USAGE type
         copy.usage = usage;
-        
+
         // All the references to other Registries object are set to null,
         // all the OIDs are copied
         // The EQUALITY MR
         copy.equality = null;
         copy.equalityOid = equalityOid;
-        
+
         // The ORDERING MR
         copy.ordering = null;
         copy.orderingOid = orderingOid;
@@ -1378,16 +1364,16 @@
         // The SUP AT
         copy.superior = null;
         copy.superiorOid = superiorOid;
-        
+
         // The SYNTAX
         copy.syntax = null;
         copy.syntaxOid = syntaxOid;
         copy.syntaxLength = syntaxLength;
-        
+
         return copy;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -1395,7 +1381,7 @@
     {
         // Clear the common elements
         super.clear();
-        
+
         // Clear the references
         equality = null;
         ordering = null;
@@ -1403,8 +1389,8 @@
         superior = null;
         syntax = null;
     }
-    
-    
+
+
     /**
      * @see Object#equals(Object)
      */
@@ -1419,39 +1405,39 @@
         {
             return false;
         }
-        
-        AttributeType that = (AttributeType)o;
-        
+
+        AttributeType that = ( AttributeType ) o;
+
         // The COLLECTIVE
         if ( isCollective != that.isCollective )
         {
             return false;
         }
-        
+
         // The SINGLE_VALUE
         if ( isSingleValued != that.isSingleValued )
         {
             return false;
         }
-        
+
         // The NO_USER_MODIFICATION
         if ( canUserModify != that.canUserModify )
         {
             return false;
         }
-        
+
         // The USAGE
         if ( usage != that.usage )
         {
             return false;
         }
-        
+
         // The equality
         if ( !compareOid( equalityOid, that.equalityOid ) )
         {
             return false;
         }
-        
+
         if ( equality != null )
         {
             if ( !equality.equals( that.equality ) )
@@ -1466,7 +1452,7 @@
                 return false;
             }
         }
-        
+
         // The ordering
         if ( !compareOid( orderingOid, that.orderingOid ) )
         {
@@ -1487,13 +1473,13 @@
                 return false;
             }
         }
-        
+
         // The substring
         if ( !compareOid( substringOid, that.substringOid ) )
         {
             return false;
         }
-        
+
         if ( substring != null )
         {
             if ( !substring.equals( that.substring ) )
@@ -1514,7 +1500,7 @@
         {
             return false;
         }
-        
+
         if ( superior != null )
         {
             if ( !superior.equals( that.superior ) )
@@ -1529,24 +1515,24 @@
                 return false;
             }
         }
-        
+
         // The syntax
         if ( !compareOid( syntaxOid, that.syntaxOid ) )
         {
             return false;
         }
-        
+
         if ( syntaxLength != that.syntaxLength )
         {
             return false;
         }
-        
+
         if ( syntax == null )
         {
             return that.syntax == null;
         }
 
-        if ( syntax.equals(  that.syntax ) )
+        if ( syntax.equals( that.syntax ) )
         {
             return syntaxLength == that.syntaxLength;
         }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java?rev=886866&amp;r1=886865&amp;r2=886866&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/DefaultAttributeTypeRegistry.java Thu Dec  3 18:01:34 2009
@@ -46,22 +46,22 @@
  * @author &lt;a href="mailto:dev@directory.apache.org"&gt;Apache Directory Project&lt;/a&gt;
  * @version $Rev: 828111 $
  */
-public class DefaultAttributeTypeRegistry extends DefaultSchemaObjectRegistry&lt;AttributeType&gt; 
-    implements AttributeTypeRegistry
+public class DefaultAttributeTypeRegistry extends DefaultSchemaObjectRegistry&lt;AttributeType&gt; implements
+    AttributeTypeRegistry
 {
     /** static class logger */
     private static final Logger LOG = LoggerFactory.getLogger( DefaultAttributeTypeRegistry.class );
 
     /** Speedup for DEBUG mode */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
-    
+
     /** cached Oid/normalizer mapping */
     private transient Map&lt;String, OidNormalizer&gt; oidNormalizerMap;
-    
+
     /** maps OIDs to a Set of descendants for that OID */
-    private Map&lt;String,Set&lt;AttributeType&gt;&gt; oidToDescendantSet;
+    private Map&lt;String, Set&lt;AttributeType&gt;&gt; oidToDescendantSet;
+
 
-    
     /**
      * Creates a new default AttributeTypeRegistry instance.
      */
@@ -69,10 +69,10 @@
     {
         super( SchemaObjectType.ATTRIBUTE_TYPE, new OidRegistry() );
         oidNormalizerMap = new HashMap&lt;String, OidNormalizer&gt;();
-        oidToDescendantSet = new HashMap&lt;String,Set&lt;AttributeType&gt;&gt;();
+        oidToDescendantSet = new HashMap&lt;String, Set&lt;AttributeType&gt;&gt;();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -80,8 +80,8 @@
     {
         return Collections.unmodifiableMap( oidNormalizerMap );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -91,15 +91,15 @@
         {
             String oid = getOidByName( ancestorId );
             Set&lt;AttributeType&gt; descendants = oidToDescendantSet.get( oid );
-            return (descendants != null) &amp;&amp; !descendants.isEmpty();
+            return ( descendants != null ) &amp;&amp; !descendants.isEmpty();
         }
         catch ( NamingException ne )
         {
             throw new NoSuchAttributeException( ne.getMessage() );
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -110,12 +110,12 @@
         {
             String oid = getOidByName( ancestorId );
             Set&lt;AttributeType&gt; descendants = oidToDescendantSet.get( oid );
-            
+
             if ( descendants == null )
             {
                 return Collections.EMPTY_SET.iterator();
             }
-            
+
             return descendants.iterator();
         }
         catch ( NamingException ne )
@@ -123,20 +123,19 @@
             throw new NoSuchAttributeException( ne.getMessage() );
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public void registerDescendants( AttributeType attributeType, AttributeType ancestor ) 
-        throws NamingException
+    public void registerDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException
     {
         // add this attribute to descendant list of other attributes in superior chain
         if ( ancestor == null )
         {
             return;
         }
-        
+
         // Get the ancestor's descendant, if any
         Set&lt;AttributeType&gt; descendants = oidToDescendantSet.get( ancestor.getOid() );
 
@@ -146,10 +145,11 @@
             descendants = new HashSet&lt;AttributeType&gt;( 1 );
             oidToDescendantSet.put( ancestor.getOid(), descendants );
         }
-        
+
         // Add the current type as a descendant
         descendants.add( attributeType );
-        
+
+        /*
         try
         {
             // And recurse until we reach the top of the hierarchy
@@ -159,34 +159,34 @@
         {
             throw new NoSuchAttributeException( ne.getMessage() );
         }
+        */
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
-    public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) 
-        throws NamingException
+    public void unregisterDescendants( AttributeType attributeType, AttributeType ancestor ) throws NamingException
     {
         // add this attribute to descendant list of other attributes in superior chain
         if ( ancestor == null )
         {
             return;
         }
-        
+
         // Get the ancestor's descendant, if any
         Set&lt;AttributeType&gt; descendants = oidToDescendantSet.get( ancestor.getOid() );
 
         if ( descendants != null )
         {
             descendants.remove( attributeType );
-            
+
             if ( descendants.size() == 0 )
             {
                 oidToDescendantSet.remove( descendants );
             }
         }
-        
+
         try
         {
             // And recurse until we reach the top of the hierarchy
@@ -197,8 +197,8 @@
             throw new NoSuchAttributeException( ne.getMessage() );
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -207,17 +207,17 @@
         try
         {
             AttributeType removed = super.unregister( numericOid );
-    
+
             removeMappingFor( removed );
-            
+
             // Deleting an AT which might be used as a superior means we have
             // to recursively update the descendant map. We also have to remove
             // the at.oid -&gt; descendant relation
             oidToDescendantSet.remove( numericOid );
-            
+
             // Now recurse if needed
             unregisterDescendants( removed, removed.getSuperior() );
-            
+
             return removed;
         }
         catch ( NamingException ne )
@@ -226,7 +226,7 @@
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -238,7 +238,8 @@
 
         if ( equality == null )
         {
-            LOG.debug( "Attribute {} does not have an EQUALITY MatchingRule : using NoopNormalizer", attributeType.getName() );
+            LOG.debug( "Attribute {} does not have an EQUALITY MatchingRule : using NoopNormalizer", attributeType
+                .getName() );
             oidNormalizer = new OidNormalizer( oid, new NoOpNormalizer( attributeType.getOid() ) );
         }
         else
@@ -247,7 +248,7 @@
         }
 
         oidNormalizerMap.put( oid, oidNormalizer );
-        
+
         // Also inject the attributeType's short names in the map
         for ( String name : attributeType.getNames() )
         {
@@ -265,7 +266,7 @@
         {
             return;
         }
-        
+
         oidNormalizerMap.remove( attributeType.getOid() );
 
         // We also have to remove all the short names for this attribute
@@ -283,7 +284,7 @@
     {
         try
         {
-           return super.lookup( oid );
+            return super.lookup( oid );
         }
         catch ( NamingException ne )
         {
@@ -291,21 +292,21 @@
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public AttributeTypeRegistry copy()
     {
         DefaultAttributeTypeRegistry copy = new DefaultAttributeTypeRegistry();
-        
+
         // Copy the base data
         copy.copy( this );
-        
+
         return copy;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -313,21 +314,21 @@
     {
         // First clear the shared elements
         super.clear();
-        
+
         // clear the OidNormalizer map
         oidNormalizerMap.clear();
-        
+
         // and clear the descendant
         for ( String oid : oidToDescendantSet.keySet() )
         {
             Set&lt;AttributeType&gt; descendants = oidToDescendantSet.get( oid );
-            
+
             if ( descendants != null )
             {
                 descendants.clear();
             }
         }
-        
+
         oidToDescendantSet.clear();
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886841 - /directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203161825.0CC182388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203161825-0CC182388998@eris-apache-org%3e</id>
<updated>2009-12-03T16:18:22Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 16:18:16 2009
New Revision: 886841

URL: http://svn.apache.org/viewvc?rev=886841&amp;view=rev
Log:
Better error handling for schemaObject addition

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java?rev=886841&amp;r1=886840&amp;r2=886841&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/registries/synchronizers/AttributeTypeSynchronizer.java
Thu Dec  3 16:18:16 2009
@@ -52,6 +52,7 @@
     /** A logger for this class */
     private static final Logger LOG = LoggerFactory.getLogger( AttributeTypeSynchronizer.class
);
 
+
     /**
      * Creates a new instance of AttributeTypeSynchronizer.
      *
@@ -62,8 +63,8 @@
     {
         super( schemaManager );
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -72,48 +73,49 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=attributetypes,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.ATTRIBUTE_TYPE );
-        
+
         // The new schemaObject's OID must not already exist
         checkOidIsUnique( entry );
-        
+
         // Build the new AttributeType from the given entry
         String schemaName = getSchemaName( dn );
-        
-        AttributeType attributeType = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
-        
+
+        AttributeType attributeType = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
+            schemaName );
+
         // At this point, the constructed AttributeType has not been checked against the

         // existing Registries. It may be broken (missing SUP, or such), it will be checked
         // there, if the schema and the AttributeType are both enabled.
         Schema schema = schemaManager.getLoadedSchema( schemaName );
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         if ( schema.isEnabled() &amp;&amp; attributeType.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Inject the newly created AttributeType in the cloned registries
             clonedRegistries.add( errors, attributeType );
-            
+
             // Remove the cloned registries
             clonedRegistries.clear();
-            
+
             // If we didn't get any error, apply the addition to the real retistries
             if ( errors.isEmpty() )
             {
                 // Apply the addition to the real registries
                 schemaManager.getRegistries().add( errors, attributeType );
-                
+
                 LOG.debug( "Added {} into the enabled schema {}", dn.getUpName(), schemaName
);
             }
             else
             {
                 // We have some error : reject the addition and get out
-                String msg = "Cannot add the AttributeType " + entry.getDn().getUpName()
+ " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
+                String msg = "Cannot add the AttributeType " + entry.getDn().getUpName()
+ " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
             }
@@ -122,7 +124,15 @@
         {
             // At least, we register the OID in the globalOidRegistry, and associates it
with the
             // schema
-            schemaManager.getRegistries().associateWithSchema( attributeType );
+            schemaManager.getRegistries().associateWithSchema( errors, attributeType );
+
+            if ( !errors.isEmpty() )
+            {
+                String msg = "Cannot add the AttributeType " + entry.getDn().getUpName()
+ " into the registries, "
+                    + "we have got some errors :" + StringTools.listToString( errors );
+
+                throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+            }
 
             LOG.debug( "Added {} into the disabled schema {}", dn.getUpName(), schemaName
);
         }
@@ -132,31 +142,32 @@
     /**
      * {@inheritDoc}
      */
-    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean
cascade ) 
+    public boolean modify( ModifyOperationContext opContext, ServerEntry targetEntry, boolean
cascade )
         throws Exception
     {
         LdapDN name = opContext.getDn();
         ServerEntry entry = opContext.getEntry();
         String schemaName = getSchemaName( name );
         String oid = getOid( entry );
-        AttributeType at = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
schemaName );
-        
+        AttributeType at = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
+            schemaName );
+
         if ( isSchemaEnabled( schemaName ) )
         {
             if ( schemaManager.getAttributeTypeRegistry().contains( oid ) )
             {
                 schemaManager.unregisterAttributeType( oid );
             }
-            
+
             schemaManager.add( at );
-            
+
             return SCHEMA_MODIFIED;
         }
-        
+
         return SCHEMA_UNCHANGED;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -165,54 +176,54 @@
         LdapDN dn = entry.getDn();
         LdapDN parentDn = ( LdapDN ) dn.clone();
         parentDn.remove( parentDn.size() - 1 );
-        
+
         // The parent DN must be ou=attributetypes,cn=&lt;schemaName&gt;,ou=schema
         checkParent( parentDn, schemaManager, SchemaConstants.ATTRIBUTE_TYPE );
-        
+
         // Test that the Oid exists
-        AttributeType attributeType = (AttributeType)checkOidExists( entry );
-        
+        AttributeType attributeType = ( AttributeType ) checkOidExists( entry );
+
         // Get the SchemaName
         String schemaName = getSchemaName( entry.getDn() );
-        
+
         // Get the schema 
         Schema schema = schemaManager.getLoadedSchema( schemaName );
-        
+
         if ( schema.isEnabled() &amp;&amp; attributeType.isEnabled() )
         {
             // As we may break the registries, work on a cloned registries
             Registries clonedRegistries = schemaManager.getRegistries().clone();
-            
+
             // Relax the cloned registries
             clonedRegistries.setRelaxed();
-            
+
             // Remove this AttributeType from the Registries
             clonedRegistries.unregister( attributeType );
-            
+
             // Remove the AttributeType from the schema/SchemaObject Map
             clonedRegistries.dissociateFromSchema( attributeType );
 
             // Update the cross references for AT
             clonedRegistries.delCrossReferences( attributeType );
-            
+
             // Check the registries now
             List&lt;Throwable&gt; errors = clonedRegistries.checkRefInteg();
-            
+
             // If we didn't get any error, swap the registries
             if ( errors.size() == 0 )
             {
                 clonedRegistries.setStrict();
-                schemaManager.swapRegistries( clonedRegistries  );
+                schemaManager.swapRegistries( clonedRegistries );
             }
             else
             {
                 // We have some error : reject the deletion and get out
                 // Destroy the cloned registries
                 clonedRegistries.clear();
-                
+
                 // The schema is disabled. We still have to update the backend
-                String msg = "Cannot delete the AttributeType " + entry.getDn().getUpName()
+ " into the registries, "+
-                    "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
+                String msg = "Cannot delete the AttributeType " + entry.getDn().getUpName()
+ " into the registries, "
+                    + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                 LOG.info( msg );
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
             }
@@ -220,10 +231,10 @@
         else
         {
             unregisterOids( attributeType );
-            
+
             // Remove the AttributeType from the schema/SchemaObject Map
             schemaManager.getRegistries().dissociateFromSchema( attributeType );
-            
+
             LOG.debug( "Removed {} from the disabled schema {}", attributeType, schemaName
);
         }
     }
@@ -235,7 +246,8 @@
     public void rename( ServerEntry entry, Rdn newRdn, boolean cascade ) throws Exception
     {
         String schemaName = getSchemaName( entry.getDn() );
-        AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
schemaName );
+        AttributeType oldAt = factory
+            .getAttributeType( schemaManager, entry, schemaManager.getRegistries(), schemaName
);
 
         // Inject the new OID
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
@@ -248,20 +260,21 @@
         newDn.remove( newDn.size() - 1 );
         newDn.add( newRdn );
         targetEntry.setDn( newDn );
-        
-        AttributeType at = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
schemaName );
+
+        AttributeType at = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
+            schemaName );
 
         if ( isSchemaEnabled( schemaName ) )
         {
             // Check that the entry has no descendant
             if ( schemaManager.getAttributeTypeRegistry().hasDescendants( oldAt.getOid()
) )
             {
-                String msg = "Cannot rename " + entry.getDn().getUpName() + " to " + newDn
+ 
-                    " as the later has descendants' AttributeTypes";
-                
+                String msg = "Cannot rename " + entry.getDn().getUpName() + " to " + newDn
+                    + " as the later has descendants' AttributeTypes";
+
                 throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
             }
-            
+
             schemaManager.unregisterAttributeType( oldAt.getOid() );
             schemaManager.add( at );
         }
@@ -279,28 +292,29 @@
         checkParent( newParentName, schemaManager, SchemaConstants.ATTRIBUTE_TYPE );
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
-        AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
oldSchemaName );
+        AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
+            oldSchemaName );
         ServerEntry targetEntry = ( ServerEntry ) entry.clone();
         String newOid = ( String ) newRn.getValue();
         targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
         checkOidIsUnique( newOid );
-        AttributeType newAt = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
newSchemaName );
+        AttributeType newAt = factory.getAttributeType( schemaManager, targetEntry, schemaManager.getRegistries(),
+            newSchemaName );
 
-        
         if ( !isSchemaLoaded( oldSchemaName ) )
         {
             String msg = "Cannot move a schemaObject from a not loaded schema " + oldSchemaName;
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         if ( !isSchemaLoaded( newSchemaName ) )
         {
             String msg = "Cannot move a schemaObject to a not loaded schema " + newSchemaName;
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         deleteFromSchema( oldAt, oldSchemaName );
         addToSchema( newAt, newSchemaName );
 
@@ -324,32 +338,33 @@
     }
 
 
-    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) 
-        throws Exception
+    public void move( LdapDN oriChildName, LdapDN newParentName, ServerEntry entry, boolean
cascade ) throws Exception
     {
         checkParent( newParentName, schemaManager, SchemaConstants.ATTRIBUTE_TYPE );
         String oldSchemaName = getSchemaName( oriChildName );
         String newSchemaName = getSchemaName( newParentName );
-        AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
oldSchemaName );
-        AttributeType newAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
newSchemaName );
-        
+        AttributeType oldAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
+            oldSchemaName );
+        AttributeType newAt = factory.getAttributeType( schemaManager, entry, schemaManager.getRegistries(),
+            newSchemaName );
+
         if ( !isSchemaLoaded( oldSchemaName ) )
         {
             String msg = "Cannot move a schemaObject from a not loaded schema " + oldSchemaName;
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         if ( !isSchemaLoaded( newSchemaName ) )
         {
             String msg = "Cannot move a schemaObject to a not loaded schema " + newSchemaName;
             LOG.warn( msg );
             throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
         }
-        
+
         deleteFromSchema( oldAt, oldSchemaName );
         addToSchema( newAt, newSchemaName );
-        
+
         if ( isSchemaEnabled( oldSchemaName ) )
         {
             schemaManager.unregisterAttributeType( oldAt.getOid() );
@@ -358,7 +373,7 @@
         {
             unregisterOids( oldAt );
         }
-        
+
         if ( isSchemaEnabled( newSchemaName ) )
         {
             schemaManager.add( newAt );




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886840 - /directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203161733.9C6972388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203161733-9C6972388998@eris-apache-org%3e</id>
<updated>2009-12-03T16:17:31Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 16:17:24 2009
New Revision: 886840

URL: http://svn.apache.org/viewvc?rev=886840&amp;view=rev
Log:
some more method signature change

Modified:
    directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java

Modified: directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java?rev=886840&amp;r1=886839&amp;r2=886840&amp;view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
(original)
+++ directory/apacheds/branches/apacheds-schema/core-api/src/main/java/org/apache/directory/server/core/schema/PartitionSchemaLoader.java
Thu Dec  3 16:17:24 2009
@@ -67,10 +67,10 @@
 
     private final SchemaPartitionDao dao;
     private Partition partition;
-    
+
     /** The attributeType registry */
     private SchemaManager schemaManager;
-    
+
     private final AttributeType mOidAT;
     private final AttributeType mNameAT;
     private final AttributeType cnAT;
@@ -85,13 +85,13 @@
     private static Map&lt;String, LdapDN&gt; staticNormalizersDNs = new HashMap&lt;String,
LdapDN&gt;();
     private static Map&lt;String, LdapDN&gt; staticSyntaxCheckersDNs = new HashMap&lt;String,
LdapDN&gt;();
     private static Map&lt;String, LdapDN&gt; staticSyntaxesDNs = new HashMap&lt;String, LdapDN&gt;();
-    
-    
+
+
     public PartitionSchemaLoader( Partition partition, SchemaManager schemaManager ) throws
Exception
     {
         this.partition = partition;
         this.schemaManager = schemaManager;
-        
+
         dao = new SchemaPartitionDaoImpl( this.partition, schemaManager );
         mOidAT = schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_OID_AT
);
         mNameAT = schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_NAME_AT
);
@@ -99,7 +99,7 @@
         byteCodeAT = schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_BYTECODE_AT
);
         descAT = schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_DESCRIPTION_AT
);
         fqcnAT = schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_FQCN_AT
);
-        
+
         initStaticDNs( "system" );
         initStaticDNs( "core" );
         initStaticDNs( "apache" );
@@ -110,99 +110,75 @@
         initStaticDNs( "cosine" );
         initStaticDNs( "inetorgperson" );
     }
-    
-    
+
+
     private void initStaticDNs( String schemaName ) throws Exception
     {
-        
+
         // Initialize AttributeType Dns
-        LdapDN dn = new LdapDN( 
-            SchemaConstants.ATTRIBUTES_TYPE_PATH,
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        LdapDN dn = new LdapDN( SchemaConstants.ATTRIBUTES_TYPE_PATH, "cn=" + schemaName,
SchemaConstants.OU_SCHEMA );
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticAttributeTypeDNs.put( schemaName, dn );
 
         // Initialize ObjectClasses Dns
-        dn = new LdapDN( 
-            SchemaConstants.OBJECT_CLASSES_PATH, 
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.OBJECT_CLASSES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticObjectClassesDNs.put( schemaName, dn );
 
         // Initialize MatchingRules Dns
-        dn = new LdapDN( 
-            SchemaConstants.MATCHING_RULES_PATH, 
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.MATCHING_RULES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticMatchingRulesDNs.put( schemaName, dn );
 
         // Initialize Comparators Dns
-        dn = new LdapDN( 
-            SchemaConstants.COMPARATORS_PATH,
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.COMPARATORS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticComparatorsDNs.put( schemaName, dn );
-        
+
         // Initialize Normalizers Dns
-        dn = new LdapDN( 
-            SchemaConstants.NORMALIZERS_PATH,
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.NORMALIZERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticNormalizersDNs.put( schemaName, dn );
 
         // Initialize SyntaxCheckers Dns
-        dn = new LdapDN( 
-            SchemaConstants.SYNTAX_CHECKERS_PATH,
-            "cn=" + schemaName,
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.SYNTAX_CHECKERS_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticSyntaxCheckersDNs.put( schemaName, dn );
 
         // Initialize Syntaxes Dns
-        dn = new LdapDN( 
-            SchemaConstants.SYNTAXES_PATH,
-            "cn=" + schemaName, 
-            SchemaConstants.OU_SCHEMA );
-        
+        dn = new LdapDN( SchemaConstants.SYNTAXES_PATH, "cn=" + schemaName, SchemaConstants.OU_SCHEMA
);
+
         dn.normalize( schemaManager.getNormalizerMapping() );
         staticSyntaxesDNs.put( schemaName, dn );
 
     }
-    
-    
+
+
     /**
      * Helper class used to update the static DNs for each kind of Schema Object
      */
     private LdapDN updateDNs( Map&lt;String, LdapDN&gt; staticDNs, String path, Schema schema
) throws NamingException
     {
         LdapDN dn = staticDNs.get( schema.getSchemaName() );
-        
+
         if ( dn == null )
         {
-            dn = new LdapDN( 
-                path,
-                "cn=" + schema.getSchemaName(),
-                SchemaConstants.OU_SCHEMA );
-            
+            dn = new LdapDN( path, "cn=" + schema.getSchemaName(), SchemaConstants.OU_SCHEMA
);
+
             dn.normalize( schemaManager.getNormalizerMapping() );
             staticDNs.put( schema.getSchemaName(), dn );
         }
-        
+
         return dn;
     }
-    
-    
+
+
     /**
      * Lists the names of the schemas that depend on the schema name provided.
      * 
@@ -214,22 +190,22 @@
     {
         Set&lt;String&gt; dependees = new HashSet&lt;String&gt;();
         Set&lt;ServerEntry&gt; results = dao.listSchemaDependents( schemaName );
-        
+
         if ( results.isEmpty() )
         {
             return dependees;
         }
-        
-        for ( ServerEntry sr: results )
+
+        for ( ServerEntry sr : results )
         {
             EntryAttribute cn = sr.get( cnAT );
             dependees.add( cn.getString() );
         }
-        
+
         return dependees;
     }
 
-    
+
     /**
      * Lists the names of the enabled schemas that depend on the schema name 
      * provided.
@@ -242,41 +218,48 @@
     {
         Set&lt;String&gt; dependees = new HashSet&lt;String&gt;();
         Set&lt;ServerEntry&gt; results = dao.listEnabledSchemaDependents( schemaName );
-        
+
         if ( results.isEmpty() )
         {
             return dependees;
         }
-        
-        for ( ServerEntry sr: results )
+
+        for ( ServerEntry sr : results )
         {
             EntryAttribute cn = sr.get( cnAT );
             dependees.add( cn.getString() );
         }
-        
+
         return dependees;
     }
 
-    
-    public Map&lt;String,Schema&gt; getSchemas() throws Exception
+
+    public Map&lt;String, Schema&gt; getSchemas() throws Exception
     {
         return dao.getSchemas();
     }
 
-    
+
     public Set&lt;String&gt; getSchemaNames() throws Exception
     {
         return dao.getSchemaNames();
     }
-    
-    
-    public Schema getSchema( String schemaName ) throws Exception
+
+
+    public Schema getSchema( String schemaName )
     {
-        return dao.getSchema( schemaName );
+        try
+        {
+            return dao.getSchema( schemaName );
+        }
+        catch ( Exception e )
+        {
+            // TODO fixme
+            return null;
+        }
     }
 
 
-
     /**
      * {@inheritDoc}
      */
@@ -288,15 +271,15 @@
         {
             dao.enableSchema( schema.getSchemaName() );
         }
-        
+
         if ( targetRegistries.isSchemaLoaded( schema.getSchemaName() ) )
         {
             LOG.debug( "schema {} already seems to be loaded", schema.getSchemaName() );
             return;
         }
-        
+
         LOG.debug( "loading {} schema ...", schema.getSchemaName() );
-        
+
         loadComparators( schema );
         loadNormalizers( schema );
         loadSyntaxCheckers( schema );
@@ -307,18 +290,18 @@
         loadMatchingRuleUses( schema );
         loadDitContentRules( schema );
         loadNameForms( schema );
-        
+
         // 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 to confirm this ( or we must make the class for this and use deferred

         // resolution until everything is available?
-        
+
         loadDitStructureRules( schema );
-        
+
         notifyListenerOrRegistries( schema, targetRegistries );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -329,27 +312,27 @@
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticAttributeTypeDNs, SchemaConstants.ATTRIBUTES_TYPE_PATH,
schema );
-            
+
             // Check that we don't have an entry in the Dit for this schema
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 // No : get out, no AttributeType to load
                 return attributeTypeList;
             }
-            
+
             LOG.debug( "{} schema: loading attributeTypes", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             // Loop on all the AttributeTypes and add them to the list
             while ( list.next() )
             {
                 ServerEntry result = list.get();
-                
+
                 attributeTypeList.add( result );
             }
         }
-        
+
         return attributeTypeList;
     }
 
@@ -360,33 +343,33 @@
     public List&lt;Entry&gt; loadComparators( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; comparatorList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return comparatorList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticComparatorsDNs, SchemaConstants.COMPARATORS_PATH,
schema );
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return comparatorList;
             }
-            
+
             LOG.debug( "{} schema: loading comparators", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ClonedServerEntry entry = list.get();
-                
+
                 comparatorList.add( entry );
             }
         }
-        
+
         return comparatorList;
     }
 
@@ -397,7 +380,7 @@
     public List&lt;Entry&gt; loadDitContentRules( Schema... schemas ) throws Exception
     {
         LOG.error( "DitContentRule loading NYI" );
-        
+
         return null;
     }
 
@@ -408,7 +391,7 @@
     public List&lt;Entry&gt; loadDitStructureRules( Schema... schemas ) throws Exception
     {
         LOG.error( "DitStructureRule loading NYI" );
-        
+
         return null;
     }
 
@@ -419,36 +402,36 @@
     public List&lt;Entry&gt; loadMatchingRules( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; matchingRuleList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return matchingRuleList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticMatchingRulesDNs, SchemaConstants.MATCHING_RULES_PATH,
schema );
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return matchingRuleList;
             }
-            
+
             LOG.debug( "{} schema: loading matchingRules", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ServerEntry entry = list.get();
-    
+
                 matchingRuleList.add( entry );
             }
         }
-        
+
         return matchingRuleList;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -456,7 +439,7 @@
     public List&lt;Entry&gt; loadMatchingRuleUses( Schema... schemas ) throws Exception
     {
         LOG.error( "MatchingRuleUse loading NYI" );
-        
+
         return null;
     }
 
@@ -467,7 +450,7 @@
     public List&lt;Entry&gt; loadNameForms( Schema... schemas ) throws Exception
     {
         LOG.error( "NameForm loading NYI" );
-        
+
         return null;
     }
 
@@ -478,33 +461,33 @@
     public List&lt;Entry&gt; loadNormalizers( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; normalizerList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return normalizerList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticNormalizersDNs, SchemaConstants.NORMALIZERS_PATH,
schema );
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return normalizerList;
             }
-            
+
             LOG.debug( "{} schema: loading normalizers", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ClonedServerEntry entry = list.get();
-                
+
                 normalizerList.add( entry );
             }
         }
-        
+
         return normalizerList;
     }
 
@@ -515,33 +498,33 @@
     public List&lt;Entry&gt; loadObjectClasses( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; objectClassList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return objectClassList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticObjectClassesDNs, SchemaConstants.OBJECT_CLASSES_PATH,
schema );
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return objectClassList;
             }
-            
+
             LOG.debug( "{} schema: loading objectClasses", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ClonedServerEntry entry = list.get();
-                
+
                 objectClassList.add( entry );
             }
         }
-        
+
         return objectClassList;
     }
 
@@ -552,33 +535,33 @@
     public List&lt;Entry&gt; loadSyntaxes( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; syntaxList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return syntaxList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticSyntaxesDNs, SchemaConstants.SYNTAXES_PATH, schema
);
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return syntaxList;
             }
-            
+
             LOG.debug( "{} schema: loading syntaxes", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ServerEntry entry = list.get();
-                
+
                 syntaxList.add( entry );
             }
         }
-        
+
         return syntaxList;
     }
 
@@ -589,33 +572,33 @@
     public List&lt;Entry&gt; loadSyntaxCheckers( Schema... schemas ) throws Exception
     {
         List&lt;Entry&gt; syntaxCheckerList = new ArrayList&lt;Entry&gt;();
-        
+
         if ( schemas == null )
         {
             return syntaxCheckerList;
         }
-        
+
         for ( Schema schema : schemas )
         {
             LdapDN dn = updateDNs( staticSyntaxCheckersDNs, SchemaConstants.SYNTAX_CHECKERS_PATH,
schema );
-            
-            if ( ! partition.hasEntry( new EntryOperationContext( null, dn ) ) )
+
+            if ( !partition.hasEntry( new EntryOperationContext( null, dn ) ) )
             {
                 return syntaxCheckerList;
             }
-            
+
             LOG.debug( "{} schema: loading syntaxCsheckers", schema.getSchemaName() );
-            
+
             EntryFilteringCursor list = partition.list( new ListOperationContext( null, dn
) );
-            
+
             while ( list.next() )
             {
                 ServerEntry entry = list.get();
-                
+
                 syntaxCheckerList.add( entry );
             }
         }
-        
+
         return syntaxCheckerList;
     }
 
@@ -623,16 +606,16 @@
     private String getOid( ServerEntry entry ) throws Exception
     {
         EntryAttribute oid = entry.get( mOidAT );
-        
+
         if ( oid == null )
         {
             return null;
         }
-        
+
         return oid.getString();
     }
 
-    
+
     private NormalizerDescription getNormalizerDescription( String schemaName, ServerEntry
entry ) throws Exception
     {
         NormalizerDescription description = new NormalizerDescription( getOid( entry ) );
@@ -640,15 +623,15 @@
         values.add( schemaName );
         description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
         description.setFqcn( entry.get( fqcnAT ).getString() );
-        
+
         EntryAttribute desc = entry.get( descAT );
         if ( desc != null &amp;&amp; desc.size() &gt; 0 )
         {
             description.setDescription( desc.getString() );
         }
-        
+
         EntryAttribute bytecode = entry.get( byteCodeAT );
-        
+
         if ( bytecode != null &amp;&amp; bytecode.size() &gt; 0 )
         {
             byte[] bytes = bytecode.getBytes();
@@ -658,30 +641,31 @@
         return description;
     }
 
-    
+
     private ClonedServerEntry lookupPartition( LdapDN dn ) throws Exception
     {
         return partition.lookup( new LookupOperationContext( null, dn ) );
     }
-    
-    
-    private LdapComparatorDescription getLdapComparatorDescription( String schemaName, ServerEntry
entry ) throws Exception
+
+
+    private LdapComparatorDescription getLdapComparatorDescription( String schemaName, ServerEntry
entry )
+        throws Exception
     {
-    	LdapComparatorDescription description = new LdapComparatorDescription( getOid( entry
) );
+        LdapComparatorDescription description = new LdapComparatorDescription( getOid( entry
) );
         List&lt;String&gt; values = new ArrayList&lt;String&gt;();
         values.add( schemaName );
         description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
         description.setFqcn( entry.get( fqcnAT ).getString() );
-        
+
         EntryAttribute desc = entry.get( descAT );
-        
+
         if ( desc != null &amp;&amp; desc.size() &gt; 0 )
         {
             description.setDescription( desc.getString() );
         }
-        
+
         EntryAttribute bytecode = entry.get( byteCodeAT );
-        
+
         if ( bytecode != null &amp;&amp; bytecode.size() &gt; 0 )
         {
             byte[] bytes = bytecode.getBytes();
@@ -691,8 +675,8 @@
         return description;
     }
 
-    
-    private SyntaxCheckerDescription getSyntaxCheckerDescription( String schemaName, ServerEntry
entry ) 
+
+    private SyntaxCheckerDescription getSyntaxCheckerDescription( String schemaName, ServerEntry
entry )
         throws Exception
     {
         SyntaxCheckerDescription description = new SyntaxCheckerDescription( getOid( entry
) );
@@ -700,16 +684,16 @@
         values.add( schemaName );
         description.addExtension( MetaSchemaConstants.X_SCHEMA, values );
         description.setFqcn( entry.get( fqcnAT ).getString() );
-        
+
         EntryAttribute desc = entry.get( descAT );
-        
+
         if ( desc != null &amp;&amp; desc.size() &gt; 0 )
         {
             description.setDescription( desc.getString() );
         }
-        
+
         EntryAttribute bytecode = entry.get( byteCodeAT );
-        
+
         if ( bytecode != null &amp;&amp; bytecode.size() &gt; 0 )
         {
             byte[] bytes = bytecode.getBytes();




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886837 - in /directory/shared/branches/shared-schema: ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/ ldap-schema-loader/src/test/java/org/apache/directory/server/schema/ ldap/src/main/java/org/apache/directory/shared/...</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203161423.B36642388998@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203161423-B36642388998@eris-apache-org%3e</id>
<updated>2009-12-03T16:14:13Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 16:13:58 2009
New Revision: 886837

URL: http://svn.apache.org/viewvc?rev=886837&amp;view=rev
Log:
o Fixed the errors propagation
o Fixed the tests accordingly
o Modified some method signature

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
Thu Dec  3 16:13:58 2009
@@ -30,7 +30,6 @@
 import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
@@ -647,7 +646,7 @@
         {
             if ( registries.isDisabledAccepted() || ( schema.isEnabled() &amp;&amp; schemaObject.isEnabled()
) )
             {
-                registries.add( schemaObject );
+                registries.add( errors, schemaObject );
 
             }
             else
@@ -659,7 +658,7 @@
         {
             if ( schema.isEnabled() &amp;&amp; schemaObject.isEnabled() )
             {
-                registries.add( schemaObject );
+                registries.add( errors, schemaObject );
             }
             else
             {
@@ -763,7 +762,7 @@
         }
 
         // Build the cross references
-        List&lt;Throwable&gt; errors = clonedRegistries.buildReferences();
+        errors = clonedRegistries.buildReferences();
 
         if ( errors.isEmpty() )
         {
@@ -773,6 +772,7 @@
             if ( errors.isEmpty() )
             {
                 // We are golden : let's apply the schema in the real registries
+                registries.setRelaxed();
 
                 // Load the schemas
                 for ( Schema schema : schemas )
@@ -782,6 +782,7 @@
 
                 // Build the cross references
                 registries.buildReferences();
+                registries.setStrict();
 
                 loaded = true;
             }
@@ -1141,20 +1142,24 @@
     /**
      * Check that the given OID does not already exist in the globalOidRegistry.
      */
-    private void checkOidIsUnique( SchemaObject schemaObject ) throws NamingException
+    private boolean checkOidIsUnique( SchemaObject schemaObject )
     {
         if ( registries.getGlobalOidRegistry().hasOid( schemaObject.getOid() ) )
         {
-            throw new LdapSchemaViolationException( "Oid " + schemaObject.getOid()
+            Throwable error = new LdapSchemaViolationException( "Oid " + schemaObject.getOid()
                 + " for new schema entity is not unique.", ResultCodeEnum.OTHER );
+            errors.add( error );
+            return false;
         }
+
+        return true;
     }
 
 
     /**
      * Retrieve the schema name for a specific SchemaObject, or return "other" if none is
found.
      */
-    private String getSchemaName( SchemaObject schemaObject ) throws Exception
+    private String getSchemaName( SchemaObject schemaObject )
     {
         String schemaName = StringTools.toLowerCase( schemaObject.getSchemaName() );
 
@@ -1175,18 +1180,26 @@
     /**
      * {@inheritDoc}
      */
-    public void add( SchemaObject schemaObject ) throws Exception
+    public boolean add( SchemaObject schemaObject ) throws Exception
     {
+        // First, clear the errors
+        errors.clear();
+
         if ( registries.isRelaxed() )
         {
             // Apply the addition right away
-            registries.add( schemaObject );
+            registries.add( errors, schemaObject );
+
+            return errors.isEmpty();
         }
         else
         {
             // Clone, apply, check, then apply again if ok
             // The new schemaObject's OID must not already exist
-            checkOidIsUnique( schemaObject );
+            if ( !checkOidIsUnique( schemaObject ) )
+            {
+                return false;
+            }
 
             // Build the new AttributeType from the given entry
             String schemaName = getSchemaName( schemaObject );
@@ -1195,7 +1208,17 @@
             // existing Registries. It may be broken (missing SUP, or such), it will be checked
             // there, if the schema and the AttributeType are both enabled.
             Schema schema = getLoadedSchema( schemaName );
-            List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
+
+            if ( schema == null )
+            {
+                // The SchemaObject must be associated with an existing schema
+                String msg = "Cannot inject the SchemaObject " + schemaObject.getOid()
+                    + " as it's not associated with a schema";
+                LOG.info( msg );
+                Throwable error = new LdapSchemaViolationException( msg, ResultCodeEnum.OTHER
);
+                errors.add( error );
+                return false;
+            }
 
             if ( schema.isEnabled() &amp;&amp; schemaObject.isEnabled() )
             {
@@ -1215,6 +1238,8 @@
                     registries.add( errors, schemaObject );
 
                     LOG.debug( "Added {} into the enabled schema {}", schemaObject.getName(),
schemaName );
+
+                    return true;
                 }
                 else
                 {
@@ -1222,18 +1247,19 @@
                     String msg = "Cannot add the SchemaObject " + schemaObject.getOid() +
" into the registries, "
                         + "the resulting registries would be inconsistent :" + StringTools.listToString(
errors );
                     LOG.info( msg );
-                    throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+
+                    return false;
                 }
             }
             else
             {
                 // At least, we register the OID in the globalOidRegistry, and associates
it with the
                 // schema
-                registries.associateWithSchema( schemaObject );
+                registries.associateWithSchema( errors, schemaObject );
 
                 LOG.debug( "Added {} into the disabled schema {}", schemaObject.getName(),
schemaName );
+                return errors.isEmpty();
             }
-
         }
     }
 
@@ -1270,14 +1296,7 @@
      */
     public Schema getLoadedSchema( String schemaName )
     {
-        try
-        {
-            return schemaLoader.getSchema( schemaName );
-        }
-        catch ( Exception e )
-        {
-            return null;
-        }
+        return schemaLoader.getSchema( schemaName );
     }
 
 

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Thu Dec  3 16:13:58 2009
@@ -20,27 +20,21 @@
 package org.apache.directory.server.schema;
 
 
-import static org.junit.Assert.fail;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoaderTest;
-import org.apache.directory.shared.ldap.entry.Entry;
-import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.schema.LdapComparator;
-import org.apache.directory.shared.ldap.schema.LdapSyntax;
-import org.apache.directory.shared.ldap.schema.MatchingRule;
-import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
-import org.apache.directory.shared.ldap.schema.SyntaxChecker;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
 import org.apache.directory.shared.schema.loader.ldif.JarLdifSchemaLoader;
 import org.apache.directory.shared.schema.loader.ldif.LdifSchemaLoader;
@@ -99,110 +93,6 @@
     }
 
 
-    private void checkComparators( List&lt;Entry&gt; comparators, SchemaManager schemaManager,
Registries expectedRegistries )
-        throws Exception
-    {
-        for ( Entry entry : comparators )
-        {
-            LdapComparator&lt;?&gt; expectedComparator = factory.getLdapComparator( schemaManager,
entry, schemaManager
-                .getRegistries(), "system" );
-            LdapComparator&lt;?&gt; comparator = schemaManager.getComparatorRegistry().lookup(
expectedComparator.getOid() );
-
-            if ( !expectedComparator.equals( comparator ) )
-            {
-                fail();
-            }
-
-            expectedRegistries.add( expectedComparator );
-        }
-    }
-
-
-    private void checkNormalizers( List&lt;Entry&gt; normalizers, SchemaManager schemaManager,
Registries expectedRegistries )
-        throws Exception
-    {
-        for ( Entry entry : normalizers )
-        {
-            Normalizer expectedNormalizer = factory.getNormalizer( schemaManager, entry,
schemaManager.getRegistries(),
-                "system" );
-            Normalizer normalizer = schemaManager.getNormalizerRegistry().lookup( expectedNormalizer.getOid()
);
-
-            if ( !expectedNormalizer.equals( normalizer ) )
-            {
-                fail();
-            }
-
-            expectedRegistries.add( expectedNormalizer );
-        }
-    }
-
-
-    private void checkSyntaxCheckers( List&lt;Entry&gt; syntaxCheckers, SchemaManager schemaManager,
-        Registries expectedRegistries ) throws Exception
-    {
-        for ( Entry entry : syntaxCheckers )
-        {
-            SyntaxChecker expectedSyntaxChecker = factory.getSyntaxChecker( schemaManager,
entry, schemaManager
-                .getRegistries(), "system" );
-            SyntaxChecker syntaxChecker = schemaManager.getSyntaxCheckerRegistry().lookup(
-                expectedSyntaxChecker.getOid() );
-
-            if ( !expectedSyntaxChecker.equals( syntaxChecker ) )
-            {
-                fail();
-            }
-
-            expectedRegistries.add( expectedSyntaxChecker );
-        }
-    }
-
-
-    private void checkSyntaxes( List&lt;Entry&gt; syntaxes, SchemaManager schemaManager,
Registries expectedRegistries )
-        throws Exception
-    {
-        List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-
-        for ( Entry entry : syntaxes )
-        {
-            LdapSyntax expectedLdapSyntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
-                "system" );
-            LdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( expectedLdapSyntax.getOid()
);
-
-            expectedLdapSyntax.applyRegistries( errors, expectedRegistries );
-
-            if ( !expectedLdapSyntax.equals( syntax ) )
-            {
-                fail();
-            }
-
-            expectedRegistries.add( expectedLdapSyntax );
-        }
-    }
-
-
-    private void checkMatchingRules( List&lt;Entry&gt; matchingRules, SchemaManager schemaManager,
-        Registries expectedRegistries ) throws Exception
-    {
-        List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-
-        for ( Entry entry : matchingRules )
-        {
-            MatchingRule expectedMatchingRule = factory.getMatchingRule( schemaManager, entry,
schemaManager
-                .getRegistries(), "system" );
-            MatchingRule matchingRule = schemaManager.getMatchingRuleRegistry().lookup( expectedMatchingRule.getOid()
);
-
-            expectedMatchingRule.applyRegistries( errors, expectedRegistries );
-
-            if ( !expectedMatchingRule.equals( matchingRule ) )
-            {
-                fail();
-            }
-
-            expectedRegistries.add( expectedMatchingRule );
-        }
-    }
-
-
     private SchemaManager loadSystem() throws Exception
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
@@ -216,47 +106,13 @@
     }
 
 
-    /**
-     * We will load the System schema, and test that the schemaManager is consistent
-     */
-    @Test
-    public void testLoadSystem() throws Exception
-    {
-        JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
-        SchemaManager schemaManager = new DefaultSchemaManager( loader );
-
-        Registries expectedRegistries = new Registries( null );
-
-        String schemaName = "system";
-
-        schemaManager.loadWithDeps( schemaName );
-
-        // Test Comparators
-        checkComparators( ldifLoader.loadComparators( schemaName ), schemaManager, expectedRegistries
);
-
-        // Test Normalizers
-        checkNormalizers( ldifLoader.loadNormalizers( schemaName ), schemaManager, expectedRegistries
);
-
-        // Test SyntaxCheckers
-        checkSyntaxCheckers( ldifLoader.loadSyntaxCheckers( schemaName ), schemaManager,
expectedRegistries );
-
-        // Test LdapSyntax
-        checkSyntaxes( ldifLoader.loadSyntaxes( schemaName ), schemaManager, expectedRegistries
);
-
-        // Test MatchingRules
-        checkMatchingRules( ldifLoader.loadMatchingRules( schemaName ), schemaManager, expectedRegistries
);
-
-        // Test ATs
-    }
-
-
     //-------------------------------------------------------------------------
     // AttributeType addition tests
     //-------------------------------------------------------------------------
     /**
      * Try to inject an AttributeType without any superior nor Syntax : it's invalid
      */
-    @Test(expected = LdapOperationNotSupportedException.class)
+    @Test
     public void testAddAttributeTypeNoSyntaxNoSuperior() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
@@ -268,7 +124,13 @@
         attributeType.setSuperior( ( String ) null );
 
         // It should fail
-        schemaManager.add( attributeType );
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
     }
 
 
@@ -296,7 +158,7 @@
     /**
      * Try to inject an AttributeType which is Collective, but an operational AT
      */
-    @Test(expected = LdapOperationNotSupportedException.class)
+    @Test
     public void testAddAttributeTypeCollectiveOperational() throws Exception
     {
         SchemaManager schemaManager = loadSystem();
@@ -310,6 +172,14 @@
         attributeType.setCollective( true );
 
         // It should fail
-        schemaManager.add( attributeType );
+        // It should fail
+        assertFalse( schemaManager.add( attributeType ) );
+
+        List&lt;Throwable&gt; errors = schemaManager.getErrors();
+        assertEquals( 1, errors.size() );
+        Throwable error = errors.get( 0 );
+
+        assertTrue( error instanceof LdapSchemaViolationException );
+
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
Thu Dec  3 16:13:58 2009
@@ -553,12 +553,15 @@
     /**
      * Registers a new SchemaObject. The registries will be updated only if it's
      * consistent after this addition, if the SchemaManager is in Strict mode.
+     * If something went wrong during this operation, the 
+     * SchemaManager.getErrors() will give the list of generated errors.
      *
      * @param schemaObject the SchemaObject to register
+     * @return true if the addition has been made, false if there were some errors
      * @throws Exception if the SchemaObject is already registered or
      * the registration operation is not supported
      */
-    void add( SchemaObject schemaObject ) throws Exception;
+    boolean add( SchemaObject schemaObject ) throws Exception;
 
 
     /**

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
Thu Dec  3 16:13:58 2009
@@ -93,105 +93,9 @@
 
 
     /**
-     * Recursive method which loads schema's with their dependent schemas first
-     * and tracks what schemas it has seen so the recursion does not go out of
-     * control with dependency cycle detection.
-     *
-     * @param rootAncestor the triggering schema load request: the root ancestor of dependency
chain
-     * @param beenthere stack of schema names we have visited and have yet to load
-     * @param notLoaded hash of schemas keyed by name which have yet to be loaded
-     * @param schema the current schema we are attempting to load
-     * @param registries the set of registries to use while loading
-     * @param props to use while trying to resolve other schemas
-     * @throws Exception if there is a cycle detected and/or another
-     * failure results while loading, producing and or registering schema objects
-     *
-    protected final void loadDepsFirst( Schema rootAncestor, Stack&lt;String&gt; beenthere,
Map&lt;String, Schema&gt; notLoaded,
-                                        Schema schema, Registries registries ) throws Exception
-    {
-        if ( registries.isSchemaLoaded( schema.getSchemaName() ) )
-        {
-            LOG.warn( "{} schema has already been loaded" + schema.getSchemaName() );
-            return;
-        }
-        
-        beenthere.push( schema.getSchemaName() );
-        String[] deps = schema.getDependencies();
-
-        // if no deps then load this guy and return
-        if ( deps == null || deps.length == 0 )
-        {
-            if ( rootAncestor == schema )
-            {
-                load( schema, registries, false );
-            }
-            else
-            {
-                load( schema, registries, true );
-            }
-            
-            notLoaded.remove( schema.getSchemaName() );
-            beenthere.pop();
-            return;
-        }
-
-        /*
-         * We got deps and need to load them before this schema.  We go through
-         * all deps loading them with their deps first if they have not been
-         * loaded.
-         *
-        for ( String depName : deps )
-        {
-            // @todo if a dependency is not loaded it's not in this list
-            // @todo why is it not in this list?  Without being in this list
-            // @todo this for loop is absolutely useless - we will not load
-            // @todo any disabled dependencies at all.  I'm shocked that the
-            // @todo samba schema is actually loading when the nis dependency
-            // @todo is not loaded.
-
-            if ( !notLoaded.containsKey( depName ) )
-            {
-                continue;
-            }
-
-            Schema dep = notLoaded.get( depName );
-
-            // dep is not in the set of schema objects we need to try to resolve it
-            if ( dep == null )
-            {
-                // try to load dependency with the provided properties default
-                dep = getSchema( depName );
-            }
-
-            if ( beenthere.contains( dep.getSchemaName() ) )
-            {
-                // push again so we show the cycle in output
-                beenthere.push( dep.getSchemaName() );
-                throw new NamingException( "schema dependency cycle detected: " + beenthere
);
-            }
-
-            loadDepsFirst( rootAncestor, beenthere, notLoaded, dep, registries );
-        }
-
-        // We have loaded all our deps so we can load this schema
-        if ( rootAncestor == schema )
-        {
-            load( schema, registries, false );
-        }
-        else
-        {
-            load( schema, registries, true );
-        }
-        
-        notLoaded.remove( schema.getSchemaName() );
-        beenthere.pop();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
-    public Schema getSchema( String schemaName ) throws Exception
+    public Schema getSchema( String schemaName )
     {
         return this.schemaMap.get( schemaName );
     }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/OidRegistry.java
Thu Dec  3 16:13:58 2009
@@ -52,7 +52,8 @@
 
     /** Maps OID to a SchemaObject */
     private Map&lt;String, SchemaObject&gt; byOid = new HashMap&lt;String, SchemaObject&gt;();
-    
+
+
     /**
      * Tells if the given OID is present on this registry
      * 
@@ -76,7 +77,7 @@
     public String getPrimaryName( String oid ) throws NamingException
     {
         SchemaObject schemaObject = byOid.get( oid );
-        
+
         if ( schemaObject != null )
         {
             return schemaObject.getName();
@@ -100,7 +101,7 @@
     public SchemaObject getSchemaObject( String oid ) throws NamingException
     {
         SchemaObject schemaObject = byOid.get( oid );
-        
+
         if ( schemaObject != null )
         {
             return schemaObject;
@@ -138,12 +139,12 @@
         }
 
         List&lt;String&gt; names = schemaObject.getNames();
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "looked up names '{}' for OID '{}'", ArrayUtils.toString( names ),
oid );
         }
-        
+
         return names;
     }
 
@@ -181,21 +182,21 @@
         if ( schemaObject == null )
         {
             String message = "Cannot register a Null SchemaObject !";
-        
+
             LOG.debug( message );
             throw new NamingException( message );
         }
-        
+
         String oid = schemaObject.getOid();
-        
+
         if ( !OID.isOID( oid ) )
         {
             String message = "The given SchemaObject does not have a valid OID";
-            
+
             LOG.debug( message );
             throw new NamingException( message );
         }
-        
+
         /*
          * Update OID Map if it does not already exist
          */
@@ -215,8 +216,8 @@
             }
         }
     }
-    
-    
+
+
     /**
      * Store the given SchemaObject into the OidRegistry. Available only to 
      * the current package. A weak form (no check is done) of the register 
@@ -224,7 +225,7 @@
      *
      * @param schemaObject The SchemaObject to inject into the OidRegistry
      */
-    /* No qualifier */ void put( SchemaObject schemaObject )
+    /* No qualifier */void put( SchemaObject schemaObject )
     {
         byOid.put( schemaObject.getOid(), schemaObject );
     }
@@ -240,14 +241,14 @@
     {
         // Removes the &lt;OID, names&gt; from the byOID map
         SchemaObject removed = byOid.remove( oid );
-        
+
         if ( IS_DEBUG )
         {
             LOG.debug( "Unregisted SchemaObject '{}' with OID: {}", removed, oid );
         }
     }
-    
-    
+
+
     /**
      * Copy the OidRegistry, without the contained values
      * 
@@ -256,41 +257,41 @@
     public OidRegistry copy()
     {
         OidRegistry copy = new OidRegistry();
-        
+
         // Clone the map
-        copy.byOid = new HashMap&lt;String,SchemaObject&gt;();
-        
+        copy.byOid = new HashMap&lt;String, SchemaObject&gt;();
+
         return copy;
     }
-    
-    
+
+
     /**
      * @return The number of stored OIDs
      */
-    protected int size() 
+    protected int size()
     {
         return byOid.size();
     }
-    
-    
+
+
     public void clear()
     {
         // remove all the OID
         byOid.clear();
     }
-    
-    
+
+
     /**
      * @see Object#toString()
      */
     public String toString()
     {
         StringBuilder sb = new StringBuilder();
-        
+
         if ( byOid != null )
         {
             boolean isFirst = true;
-            
+
             for ( String oid : byOid.keySet() )
             {
                 if ( isFirst )
@@ -301,11 +302,11 @@
                 {
                     sb.append( ", " );
                 }
-                
+
                 sb.append( "&lt;" );
-                
+
                 SchemaObject schemaObject = byOid.get( oid );
-                
+
                 if ( schemaObject != null )
                 {
                     sb.append( schemaObject.getObjectType() );
@@ -314,11 +315,11 @@
                     sb.append( ", " );
                     sb.append( schemaObject.getName() );
                 }
-                
+
                 sb.append( "&gt;" );
             }
         }
-        
+
         return sb.toString();
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/Registries.java
Thu Dec  3 16:13:58 2009
@@ -1273,15 +1273,21 @@
         setRelaxed();
 
         // Register the SchemaObject in the registries
-        add( schemaObject );
+        register( errors, schemaObject );
+
+        // Associate the SchemaObject with its schema
+        associateWithSchema( errors, schemaObject );
 
         // Build the SchemaObject references
         buildReference( errors, schemaObject );
 
-        // Check the registries now
-        List&lt;Throwable&gt; checkErrors = checkRefInteg();
+        if ( errors.isEmpty() )
+        {
+            // Check the registries now
+            List&lt;Throwable&gt; checkErrors = checkRefInteg();
 
-        errors.addAll( checkErrors );
+            errors.addAll( checkErrors );
+        }
 
         // return the errors
         return errors;
@@ -1390,23 +1396,9 @@
 
 
     /**
-     * Applies the added SchemaObject to the given register. This method is common
-     * to all the addition operations (LDAP injection or schema loading).
-     */
-    public void add( SchemaObject schemaObject ) throws NamingException
-    {
-        // Register the SchemaObject in the registries
-        register( schemaObject );
-
-        // Associate the SchemaObject with its schema
-        associateWithSchema( schemaObject );
-    }
-
-
-    /**
      * Register the given SchemaObject into the associated Registry
      */
-    private void register( SchemaObject schemaObject ) throws NamingException
+    private void register( List&lt;Throwable&gt; errors, SchemaObject schemaObject ) throws
NamingException
     {
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
@@ -1477,7 +1469,7 @@
      * @param schemaObject The schemaObject to register
      * @throws NamingException If there is a problem
      */
-    public void associateWithSchema( SchemaObject schemaObject ) throws NamingException
+    public void associateWithSchema( List&lt;Throwable&gt; errors, SchemaObject schemaObject
) //throws NamingException
     {
         LOG.debug( "Registering {}:{}", schemaObject.getObjectType(), schemaObject.getOid()
);
 
@@ -1488,7 +1480,9 @@
             String msg = "Registering of " + schemaObject.getObjectType() + ":" + schemaObject.getOid()
                 + "failed, it's already present in the Registries";
             LOG.error( msg );
-            throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+            Throwable error = new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM
);
+            errors.add( error );
+            return;
         }
 
         // Get a normalized form of schema name
@@ -1521,7 +1515,15 @@
             // an instance of LoadableSchemaObject
             if ( !( schemaObject instanceof LoadableSchemaObject ) )
             {
-                globalOidRegistry.register( schemaObject );
+                try
+                {
+                    globalOidRegistry.register( schemaObject );
+                }
+                catch ( NamingException ne )
+                {
+                    errors.add( ne );
+                    return;
+                }
             }
 
             LOG.debug( "registered {} for OID {}", schemaObject.getName(), schemaObject.getOid()
);

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java?rev=886837&amp;r1=886836&amp;r2=886837&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
(original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
Thu Dec  3 16:13:58 2009
@@ -47,9 +47,8 @@
      * 
      * @param schemaName the name of the schema to load
      * @return the Schema object associated with the name
-     * @throws Exception if any problems while trying to find the associated Schema
      */
-    Schema getSchema( String schemaName ) throws Exception;
+    Schema getSchema( String schemaName );
 
 
     /**




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886662 - /directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203025005.31F7923889E1@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203025005-31F7923889E1@eris-apache-org%3e</id>
<updated>2009-12-03T02:49:57Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 02:49:32 2009
New Revision: 886662

URL: http://svn.apache.org/viewvc?rev=886662&amp;view=rev
Log:
Removed the SUP value when t breaks the inheritance (an AT cannot be an operational AT if
its superior is not operational)

Modified:
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.10.ldif
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.3.ldif
    directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.7.ldif

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.10.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.10.ldif?rev=886662&amp;r1=886661&amp;r2=886662&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.10.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.10.ldif
Thu Dec  3 02:49:32 2009
@@ -9,7 +9,6 @@
 m-collective: FALSE
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.10
 entrycsn: 20090818052731.845000Z#000000#000#000000
-m-supattributetype: distinguishedName
 m-nousermodification: TRUE
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
 objectclass: metaAttributeType

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.11.ldif?rev=886662&amp;r1=886661&amp;r2=886662&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.11.ldif
Thu Dec  3 02:49:32 2009
@@ -9,7 +9,6 @@
 m-collective: FALSE
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.11
 entrycsn: 20090818052729.367000Z#000000#000#000000
-m-supattributetype: distinguishedName
 m-nousermodification: TRUE
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
 objectclass: metaAttributeType

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.27.ldif?rev=886662&amp;r1=886661&amp;r2=886662&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.27.ldif
Thu Dec  3 02:49:32 2009
@@ -10,7 +10,6 @@
 m-collective: FALSE
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.27
 entrycsn: 20090818052729.833000Z#000000#000#000000
-m-supattributetype: distinguishedName
 m-nousermodification: TRUE
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
 objectclass: metaAttributeType

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.3.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.3.ldif?rev=886662&amp;r1=886661&amp;r2=886662&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.3.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.3.ldif
Thu Dec  3 02:49:32 2009
@@ -10,7 +10,6 @@
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.3
 entrycsn: 20090818052730.819000Z#000000#000#000000
 m-substr: caseIgnoreSubstringsMatch
-m-supattributetype: name
 m-nousermodification: TRUE
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.15
 objectclass: metaAttributeType

Modified: directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.7.ldif
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou%3Dschema/cn%3Dapache/ou%3Dattributetypes/m-oid%3D1.3.6.1.4.1.18060.0.4.1.2.7.ldif?rev=886662&amp;r1=886661&amp;r2=886662&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.7.ldif
(original)
+++ directory/shared/branches/shared-schema/ldap-schema/src/main/resources/schema/ou=schema/cn=apache/ou=attributetypes/m-oid=1.3.6.1.4.1.18060.0.4.1.2.7.ldif
Thu Dec  3 02:49:32 2009
@@ -9,7 +9,6 @@
 m-collective: FALSE
 m-oid: 1.3.6.1.4.1.18060.0.4.1.2.7
 entrycsn: 20090818052729.137000Z#000000#000#000000
-m-supattributetype: distinguishedName
 m-nousermodification: TRUE
 m-syntax: 1.3.6.1.4.1.1466.115.121.1.12
 objectclass: metaAttributeType




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886660 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091203023512.387BE23889E5@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091203023512-387BE23889E5@eris-apache-org%3e</id>
<updated>2009-12-03T02:35:11Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Thu Dec  3 02:35:10 2009
New Revision: 886660

URL: http://svn.apache.org/viewvc?rev=886660&amp;view=rev
Log:
Added a new test 

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886660&amp;r1=886659&amp;r2=886660&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Thu Dec  3 02:35:10 2009
@@ -273,6 +273,27 @@
 
 
     /**
+     * Try to inject an AttributeType which is Collective, and userApplication AT
+     */
+    @Test
+    public void testAddAttributeTypeCollectiveUser() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.USER_APPLICATIONS );
+        attributeType.setCollective( true );
+
+        // It should not fail
+        schemaManager.add( attributeType );
+    }
+
+
+    /**
      * Try to inject an AttributeType which is Collective, but an operational AT
      */
     @Test(expected = LdapOperationNotSupportedException.class)




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886263 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091202191005.3273723888D1@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202191005-3273723888D1@eris-apache-org%3e</id>
<updated>2009-12-02T19:10:05Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Wed Dec  2 19:10:04 2009
New Revision: 886263

URL: http://svn.apache.org/viewvc?rev=886263&amp;view=rev
Log:
Created a new test for AT being collective and Operational

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886263&amp;r1=886262&amp;r2=886263&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Wed Dec  2 19:10:04 2009
@@ -38,6 +38,7 @@
 import org.apache.directory.shared.ldap.schema.Normalizer;
 import org.apache.directory.shared.ldap.schema.SchemaManager;
 import org.apache.directory.shared.ldap.schema.SyntaxChecker;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.shared.ldap.schema.ldif.extractor.SchemaLdifExtractor;
 import org.apache.directory.shared.ldap.schema.registries.Registries;
 import org.apache.directory.shared.schema.DefaultSchemaManager;
@@ -249,6 +250,9 @@
     }
 
 
+    //-------------------------------------------------------------------------
+    // AttributeType addition tests
+    //-------------------------------------------------------------------------
     /**
      * Try to inject an AttributeType without any superior nor Syntax : it's invalid
      */
@@ -263,6 +267,28 @@
         attributeType.setSubstringOid( null );
         attributeType.setSuperior( ( String ) null );
 
+        // It should fail
+        schemaManager.add( attributeType );
+    }
+
+
+    /**
+     * Try to inject an AttributeType which is Collective, but an operational AT
+     */
+    @Test(expected = LdapOperationNotSupportedException.class)
+    public void testAddAttributeTypeCollectiveOperational() throws Exception
+    {
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSyntaxOid( "1.3.6.1.4.1.1466.115.121.1.26" );
+        attributeType.setUsage( UsageEnum.DIRECTORY_OPERATION );
+        attributeType.setCollective( true );
+
+        // It should fail
         schemaManager.add( attributeType );
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886231 - /directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091202181028.BE51823889D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202181028-BE51823889D0@eris-apache-org%3e</id>
<updated>2009-12-02T18:10:28Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Wed Dec  2 18:10:28 2009
New Revision: 886231

URL: http://svn.apache.org/viewvc?rev=886231&amp;view=rev
Log:
Added a test for SchemaObject injection (AttributeType)

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java?rev=886231&amp;r1=886230&amp;r2=886231&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
(original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/test/java/org/apache/directory/server/schema/SchemaManagerTest.java
Wed Dec  2 18:10:28 2009
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.server.schema;
 
+
 import static org.junit.Assert.fail;
 
 import java.io.File;
@@ -29,6 +30,7 @@
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.server.schema.loader.ldif.LdifSchemaLoaderTest;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.LdapComparator;
 import org.apache.directory.shared.ldap.schema.LdapSyntax;
@@ -57,13 +59,14 @@
 {
     // A directory in which the ldif files will be stored
     private static String workingDirectory;
-    
+
     // A LDIF loader
     private static LdifSchemaLoader ldifLoader;
-    
+
     // A SchemaObject factory
     private static SchemaEntityFactory factory;
-    
+
+
     @BeforeClass
     public static void setup() throws Exception
     {
@@ -75,50 +78,54 @@
             int targetPos = path.indexOf( "target" );
             workingDirectory = path.substring( 0, targetPos + 6 );
         }
-        
+
         // Cleanup the target directory
         FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
 
         SchemaLdifExtractor extractor = new SchemaLdifExtractor( new File( workingDirectory
) );
         extractor.extractOrCopy();
-        
+
         ldifLoader = new LdifSchemaLoader( new File( workingDirectory, "schema" ) );
         factory = new SchemaEntityFactory();
     }
-    
-    
+
+
     @AfterClass
     public static void cleanup() throws IOException
     {
         // Cleanup the target directory
         FileUtils.deleteDirectory( new File( workingDirectory + "/schema" ) );
     }
-    
-    
-    private void checkComparators( List&lt;Entry&gt; comparators, SchemaManager schemaManager,
Registries expectedRegistries ) throws Exception
+
+
+    private void checkComparators( List&lt;Entry&gt; comparators, SchemaManager schemaManager,
Registries expectedRegistries )
+        throws Exception
     {
         for ( Entry entry : comparators )
         {
-            LdapComparator&lt;?&gt; expectedComparator = factory.getLdapComparator( schemaManager,
entry, schemaManager.getRegistries(), "system" );
+            LdapComparator&lt;?&gt; expectedComparator = factory.getLdapComparator( schemaManager,
entry, schemaManager
+                .getRegistries(), "system" );
             LdapComparator&lt;?&gt; comparator = schemaManager.getComparatorRegistry().lookup(
expectedComparator.getOid() );
-            
+
             if ( !expectedComparator.equals( comparator ) )
             {
                 fail();
             }
-            
+
             expectedRegistries.add( expectedComparator );
         }
     }
-    
-    
-    private void checkNormalizers( List&lt;Entry&gt; normalizers, SchemaManager schemaManager,
Registries expectedRegistries ) throws Exception
+
+
+    private void checkNormalizers( List&lt;Entry&gt; normalizers, SchemaManager schemaManager,
Registries expectedRegistries )
+        throws Exception
     {
         for ( Entry entry : normalizers )
         {
-            Normalizer expectedNormalizer = factory.getNormalizer( schemaManager, entry,
schemaManager.getRegistries(), "system" );
+            Normalizer expectedNormalizer = factory.getNormalizer( schemaManager, entry,
schemaManager.getRegistries(),
+                "system" );
             Normalizer normalizer = schemaManager.getNormalizerRegistry().lookup( expectedNormalizer.getOid()
);
-            
+
             if ( !expectedNormalizer.equals( normalizer ) )
             {
                 fail();
@@ -127,80 +134,87 @@
             expectedRegistries.add( expectedNormalizer );
         }
     }
-    
-    
-    private void checkSyntaxCheckers( List&lt;Entry&gt; syntaxCheckers, SchemaManager schemaManager,
Registries expectedRegistries ) throws Exception
+
+
+    private void checkSyntaxCheckers( List&lt;Entry&gt; syntaxCheckers, SchemaManager schemaManager,
+        Registries expectedRegistries ) throws Exception
     {
         for ( Entry entry : syntaxCheckers )
         {
-            SyntaxChecker expectedSyntaxChecker = factory.getSyntaxChecker( schemaManager,
entry, schemaManager.getRegistries(), "system" );
-            SyntaxChecker syntaxChecker = schemaManager.getSyntaxCheckerRegistry().lookup(
expectedSyntaxChecker.getOid() );
-            
+            SyntaxChecker expectedSyntaxChecker = factory.getSyntaxChecker( schemaManager,
entry, schemaManager
+                .getRegistries(), "system" );
+            SyntaxChecker syntaxChecker = schemaManager.getSyntaxCheckerRegistry().lookup(
+                expectedSyntaxChecker.getOid() );
+
             if ( !expectedSyntaxChecker.equals( syntaxChecker ) )
             {
                 fail();
             }
-            
+
             expectedRegistries.add( expectedSyntaxChecker );
         }
     }
-    
-    
-    private void checkSyntaxes( List&lt;Entry&gt; syntaxes, SchemaManager schemaManager,
Registries expectedRegistries ) throws Exception
+
+
+    private void checkSyntaxes( List&lt;Entry&gt; syntaxes, SchemaManager schemaManager,
Registries expectedRegistries )
+        throws Exception
     {
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         for ( Entry entry : syntaxes )
         {
-            LdapSyntax expectedLdapSyntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
"system" );
+            LdapSyntax expectedLdapSyntax = factory.getSyntax( schemaManager, entry, schemaManager.getRegistries(),
+                "system" );
             LdapSyntax syntax = schemaManager.getLdapSyntaxRegistry().lookup( expectedLdapSyntax.getOid()
);
-            
+
             expectedLdapSyntax.applyRegistries( errors, expectedRegistries );
-            
+
             if ( !expectedLdapSyntax.equals( syntax ) )
             {
                 fail();
             }
-            
+
             expectedRegistries.add( expectedLdapSyntax );
         }
     }
-    
-    
-    private void checkMatchingRules( List&lt;Entry&gt; matchingRules, SchemaManager schemaManager,
Registries expectedRegistries ) throws Exception
+
+
+    private void checkMatchingRules( List&lt;Entry&gt; matchingRules, SchemaManager schemaManager,
+        Registries expectedRegistries ) throws Exception
     {
         List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
-        
+
         for ( Entry entry : matchingRules )
         {
-            MatchingRule expectedMatchingRule = factory.getMatchingRule( schemaManager, entry,
schemaManager.getRegistries(), "system" );
+            MatchingRule expectedMatchingRule = factory.getMatchingRule( schemaManager, entry,
schemaManager
+                .getRegistries(), "system" );
             MatchingRule matchingRule = schemaManager.getMatchingRuleRegistry().lookup( expectedMatchingRule.getOid()
);
-            
+
             expectedMatchingRule.applyRegistries( errors, expectedRegistries );
-            
+
             if ( !expectedMatchingRule.equals( matchingRule ) )
             {
                 fail();
             }
-            
+
             expectedRegistries.add( expectedMatchingRule );
         }
     }
-    
-    
+
+
     private SchemaManager loadSystem() throws Exception
     {
         JarLdifSchemaLoader loader = new JarLdifSchemaLoader();
         SchemaManager schemaManager = new DefaultSchemaManager( loader );
 
         String schemaName = "system";
-        
+
         schemaManager.loadWithDeps( schemaName );
-        
+
         return schemaManager;
     }
-    
-    
+
+
     /**
      * We will load the System schema, and test that the schemaManager is consistent
      */
@@ -213,42 +227,42 @@
         Registries expectedRegistries = new Registries( null );
 
         String schemaName = "system";
-        
+
         schemaManager.loadWithDeps( schemaName );
-        
+
         // Test Comparators
         checkComparators( ldifLoader.loadComparators( schemaName ), schemaManager, expectedRegistries
);
-        
+
         // Test Normalizers
         checkNormalizers( ldifLoader.loadNormalizers( schemaName ), schemaManager, expectedRegistries
);
-        
+
         // Test SyntaxCheckers
         checkSyntaxCheckers( ldifLoader.loadSyntaxCheckers( schemaName ), schemaManager,
expectedRegistries );
-        
+
         // Test LdapSyntax
         checkSyntaxes( ldifLoader.loadSyntaxes( schemaName ), schemaManager, expectedRegistries
);
 
         // Test MatchingRules
         checkMatchingRules( ldifLoader.loadMatchingRules( schemaName ), schemaManager, expectedRegistries
);
-        
+
         // Test ATs
     }
-    
-    
-    @Test
-    public void testAddAttributeType() throws Exception
+
+
+    /**
+     * Try to inject an AttributeType without any superior nor Syntax : it's invalid
+     */
+    @Test(expected = LdapOperationNotSupportedException.class)
+    public void testAddAttributeTypeNoSyntaxNoSuperior() throws Exception
     {
-    	SchemaManager schemaManager = loadSystem();
-    	
-    	AttributeType attributeType = new AttributeType( "1.1.0" );
-    	attributeType.setEqualityOid( "2.5.13.1" );
-    	attributeType.setOrderingOid( null );
-    	attributeType.setSubstringOid( null );
-    	attributeType.setSuperior( (String)null );
-    	
-    	schemaManager.add( attributeType );
-    	
-    	// Check that the AT has been correctly added
-    	
+        SchemaManager schemaManager = loadSystem();
+
+        AttributeType attributeType = new AttributeType( "1.1.0" );
+        attributeType.setEqualityOid( "2.5.13.1" );
+        attributeType.setOrderingOid( null );
+        attributeType.setSubstringOid( null );
+        attributeType.setSuperior( ( String ) null );
+
+        schemaManager.add( attributeType );
     }
 }




</pre>
</div>
</content>
</entry>
<entry>
<title>svn commit: r886230 - in /directory/shared/branches/shared-schema: ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/ ldap/src/main/java/org/apache/directory/shared/ldap/schema/ ldap/src/main/java/org/apache/directory/shared/ldap/sche...</title>
<author><name>elecharny@apache.org</name></author>
<link rel="alternate" href="http://mail-archives.apache.org/mod_mbox/directory-commits/200912.mbox/%3c20091202180807.898DA23889D0@eris.apache.org%3e"/>
<id>urn:uuid:%3c20091202180807-898DA23889D0@eris-apache-org%3e</id>
<updated>2009-12-02T18:08:07Z</updated>
<content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml">
<pre>
Author: elecharny
Date: Wed Dec  2 18:08:07 2009
New Revision: 886230

URL: http://svn.apache.org/viewvc?rev=886230&amp;view=rev
Log:
o Added a add( schemaObject ) method
o minor refactoring

Modified:
    directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
    directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java

Modified: directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java?rev=886230&amp;r1=886229&amp;r2=886230&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java (original)
+++ directory/shared/branches/shared-schema/ldap-schema-loader/src/main/java/org/apache/directory/shared/schema/DefaultSchemaManager.java Wed Dec  2 18:08:07 2009
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.schema;
 
+
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -26,8 +27,12 @@
 import javax.naming.NamingException;
 
 import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.ldap.constants.MetaSchemaConstants;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.entry.Entry;
+import org.apache.directory.shared.ldap.exception.LdapOperationNotSupportedException;
+import org.apache.directory.shared.ldap.exception.LdapSchemaViolationException;
+import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.AttributeType;
 import org.apache.directory.shared.ldap.schema.EntityFactory;
@@ -71,6 +76,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * The SchemaManager class : it handles all the schema operations (addition, removal,
  * modification).
@@ -85,29 +91,30 @@
 
     /** The NamingContext this SchemaManager is associated with */
     private LdapDN namingContext;
-    
+
     /** The global registries for this namingContext */
     private volatile Registries registries;
-    
+
     /** The list of errors produced when loading some schema elements */
     private List&lt;Throwable&gt; errors;
-    
+
     /** The Schema schemaLoader used by this SchemaManager */
     private SchemaLoader schemaLoader;
-    
+
     /** the factory that generates respective SchemaObjects from LDIF entries */
     protected final EntityFactory factory;
-    
+
     /** the normalized name for the schema modification attributes */
     private LdapDN schemaModificationAttributesDN;
-    
+
     /** A flag indicating that the SchemaManager is relaxed or not */
     private boolean isRelaxed = STRICT;
-    
+
     /** Two flags for RELAXED and STRUCT */
     public static final boolean STRICT = false;
     public static final boolean RELAXED = true;
-    
+
+
     /**
      * Creates a new instance of DefaultSchemaManager with the default schema schemaLoader
      *
@@ -123,7 +130,7 @@
         factory = new SchemaEntityFactory();
         isRelaxed = STRICT;
     }
-    
+
 
     /**
      * Creates a new instance of DefaultSchemaManager, for a specific
@@ -141,7 +148,7 @@
         isRelaxed = STRICT;
     }
 
-    
+
     //-----------------------------------------------------------------------
     // Helper methods
     //-----------------------------------------------------------------------
@@ -156,18 +163,18 @@
 
         // Clone the Registries
         Registries clonedRegistries = registries.clone();
-        
+
         // And update references. We may have errors, that may be fixed
         // by the new loaded schemas.
         errors = clonedRegistries.checkRefInteg();
-        
+
         // Now, relax the cloned Registries if there is no error
         clonedRegistries.setRelaxed();
-        
+
         return clonedRegistries;
     }
-    
-    
+
+
     /**
      * Transform a String[] array of schema to a Schema[]
      */
@@ -175,16 +182,16 @@
     {
         Schema[] schemaArray = new Schema[schemas.length];
         int n = 0;
-        
-        for ( String schemaName:schemas )
+
+        for ( String schemaName : schemas )
         {
             schemaArray[n++] = schemaLoader.getSchema( schemaName );
         }
-        
+
         return schemaArray;
     }
-    
-    
+
+
     private void addSchemaObjects( Schema schema, Registries registries ) throws Exception
     {
         addComparators( schema, registries );
@@ -202,15 +209,15 @@
         // TODO Add some listener handling at this point
         //notifyListenerOrRegistries( schema, registries );
     }
-    
-    
+
+
     //-----------------------------------------------------------------------
     // API methods
     //-----------------------------------------------------------------------
     /***
      * {@inheritDoc}
      */
-    public boolean swapRegistries( Registries targetRegistries ) throws NamingException 
+    public boolean swapRegistries( Registries targetRegistries ) throws NamingException
     {
         // Check the resulting registries
         errors = targetRegistries.checkRefInteg();
@@ -223,13 +230,13 @@
             {
                 targetRegistries.setStrict();
             }
-            
+
             Registries oldRegistries = registries;
             registries = targetRegistries;
-            
+
             // Delete the old registries to avoid memory leaks
             oldRegistries.clear();
-            
+
             return true;
         }
         else
@@ -238,8 +245,8 @@
             return false;
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -259,7 +266,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -269,7 +276,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -279,7 +286,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -288,31 +295,31 @@
         // Work on a cloned and relaxed registries
         Registries clonedRegistries = cloneRegistries();
 
-        for ( Schema schema:schemas )
+        for ( Schema schema : schemas )
         {
             schema.enable();
-            load( clonedRegistries, schema  );
+            load( clonedRegistries, schema );
         }
-        
+
         List&lt;Throwable&gt; errors = clonedRegistries.checkRefInteg();
-        
+
         // Destroy the clonedRegistry
         clonedRegistries.clear();
-        
+
         if ( errors.isEmpty() )
         {
             // No error, inject the schema in the current registries 
-            for ( Schema schema:schemas )
+            for ( Schema schema : schemas )
             {
                 schema.enable();
-                load( registries, schema  );
+                load( registries, schema );
             }
-            
+
             errors = registries.checkRefInteg();
         }
-        
+
         return errors.isEmpty();
-        
+
         // Swap the registries if it is consistent
         //return swapRegistries( clonedRegistries );
     }
@@ -326,7 +333,7 @@
         return enable( toArray( schemas ) );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -336,7 +343,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -346,7 +353,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -355,7 +362,7 @@
         return errors;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -363,7 +370,7 @@
     {
         return registries;
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -374,14 +381,14 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public boolean load( Schema... schemas ) throws Exception
     {
-    	boolean loaded = false;
-    	
+        boolean loaded = false;
+
         // Work on a cloned and relaxed registries
         Registries clonedRegistries = cloneRegistries();
         clonedRegistries.setRelaxed();
@@ -389,41 +396,41 @@
         // Load the schemas
         for ( Schema schema : schemas )
         {
-            load( clonedRegistries, schema  );
+            load( clonedRegistries, schema );
         }
 
         // Build the cross references
         List&lt;Throwable&gt; errors = clonedRegistries.buildReferences();
-        
+
         if ( errors.isEmpty() )
         {
-        	// Ok no errors. Check the registries now
-        	errors = clonedRegistries.checkRefInteg();
-        	
-        	if ( errors.isEmpty() )
-        	{
-        		// We are golden : let's apply the schema in the real registries
+            // Ok no errors. Check the registries now
+            errors = clonedRegistries.checkRefInteg();
+
+            if ( errors.isEmpty() )
+            {
+                // We are golden : let's apply the schema in the real registries
 
-        		// Load the schemas
+                // Load the schemas
                 for ( Schema schema : schemas )
                 {
-                    load( registries, schema  );
+                    load( registries, schema );
                 }
 
                 // Build the cross references
                 registries.buildReferences();
-                
+
                 loaded = true;
-        	}
+            }
         }
 
         // clear the cloned registries
         clonedRegistries.clear();
-        
+
         return loaded;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -432,7 +439,7 @@
         return load( toArray( schemas ) );
     }
 
-    
+
     /**
      * Load the schema in the registries. We will load everything accordingly to the two flags :
      * - isRelaxed
@@ -450,15 +457,15 @@
         {
             return true;
         }
-        
+
         if ( schema.isDisabled() )
         {
             if ( registries.isDisabledAccepted() )
             {
                 LOG.info( "Loading {} schema: \n{}", schema.getSchemaName(), schema );
-                
+
                 registries.schemaLoaded( schema );
-                
+
                 addSchemaObjects( schema, registries );
             }
             else
@@ -469,15 +476,15 @@
         else
         {
             LOG.info( "Loading {} schema: \n{}", schema.getSchemaName(), schema );
-            
+
             registries.schemaLoaded( schema );
             addSchemaObjects( schema, registries );
         }
-        
+
         return true;
     }
 
-    
+
     /**
      * Add all the Schema's AttributeTypes
      */
@@ -491,7 +498,7 @@
         }
     }
 
-    
+
     /**
      * Add all the Schema's comparators
      */
@@ -499,14 +506,13 @@
     {
         for ( Entry entry : schemaLoader.loadComparators( schema ) )
         {
-            LdapComparator&lt;?&gt; comparator = 
-                factory.getLdapComparator( this, entry, registries, schema.getSchemaName() );
-            
+            LdapComparator&lt;?&gt; comparator = factory.getLdapComparator( this, entry, registries, schema.getSchemaName() );
+
             addSchemaObject( registries, comparator, schema );
         }
     }
 
-    
+
     /**
      * Add all the Schema's DitContentRules
      */
@@ -514,12 +520,11 @@
     {
         for ( Entry entry : schemaLoader.loadDitContentRules( schema ) )
         {
-            throw new NotImplementedException( "Need to implement factory " +
-                "method for creating a DitContentRule" );
+            throw new NotImplementedException( "Need to implement factory " + "method for creating a DitContentRule" );
         }
     }
 
-    
+
     /**
      * Add all the Schema's DitStructureRules
      */
@@ -527,12 +532,11 @@
     {
         for ( Entry entry : schemaLoader.loadDitStructureRules( schema ) )
         {
-            throw new NotImplementedException( "Need to implement factory " +
-                "method for creating a DitStructureRule" );
+            throw new NotImplementedException( "Need to implement factory " + "method for creating a DitStructureRule" );
         }
     }
 
-    
+
     /**
      * Add all the Schema's MatchingRules
      */
@@ -540,14 +544,13 @@
     {
         for ( Entry entry : schemaLoader.loadMatchingRules( schema ) )
         {
-            MatchingRule matchingRule = factory.getMatchingRule( 
-                this, entry, registries, schema.getSchemaName() );
+            MatchingRule matchingRule = factory.getMatchingRule( this, entry, registries, schema.getSchemaName() );
 
             addSchemaObject( registries, matchingRule, schema );
         }
     }
 
-    
+
     /**
      * Add all the Schema's MatchingRuleUses
      */
@@ -555,12 +558,11 @@
     {
         for ( Entry entry : schemaLoader.loadMatchingRuleUses( schema ) )
         {
-            throw new NotImplementedException( "Need to implement factory " +
-                "method for creating a MatchingRuleUse" );
+            throw new NotImplementedException( "Need to implement factory " + "method for creating a MatchingRuleUse" );
         }
     }
 
-    
+
     /**
      * Add all the Schema's NameForms
      */
@@ -568,12 +570,11 @@
     {
         for ( Entry entry : schemaLoader.loadNameForms( schema ) )
         {
-            throw new NotImplementedException( "Need to implement factory " +
-                "method for creating a NameForm" );
+            throw new NotImplementedException( "Need to implement factory " + "method for creating a NameForm" );
         }
     }
 
-    
+
     /**
      * Add all the Schema's Normalizers
      */
@@ -581,14 +582,13 @@
     {
         for ( Entry entry : schemaLoader.loadNormalizers( schema ) )
         {
-            Normalizer normalizer =
-                factory.getNormalizer( this, entry, registries, schema.getSchemaName() );
-            
+            Normalizer normalizer = factory.getNormalizer( this, entry, registries, schema.getSchemaName() );
+
             addSchemaObject( registries, normalizer, schema );
         }
     }
 
-    
+
     /**
      * Add all the Schema's ObjectClasses
      */
@@ -602,7 +602,7 @@
         }
     }
 
-    
+
     /**
      * Add all the Schema's Syntaxes
      */
@@ -610,14 +610,13 @@
     {
         for ( Entry entry : schemaLoader.loadSyntaxes( schema ) )
         {
-            LdapSyntax syntax = factory.getSyntax( this,
-                entry, registries, schema.getSchemaName() );
+            LdapSyntax syntax = factory.getSyntax( this, entry, registries, schema.getSchemaName() );
 
             addSchemaObject( registries, syntax, schema );
         }
     }
 
-    
+
     /**Add
      * Register all the Schema's SyntaxCheckers
      */
@@ -625,14 +624,13 @@
     {
         for ( Entry entry : schemaLoader.loadSyntaxCheckers( schema ) )
         {
-            SyntaxChecker syntaxChecker = 
-                factory.getSyntaxChecker( this, entry, registries, schema.getSchemaName() );
+            SyntaxChecker syntaxChecker = factory.getSyntaxChecker( this, entry, registries, schema.getSchemaName() );
 
             addSchemaObject( registries, syntaxChecker, schema );
         }
     }
 
-    
+
     /**
      * Add the schemaObject into the registries. 
      *
@@ -642,7 +640,7 @@
      * @return the created schemaObject instance
      * @throws Exception If the registering failed
      */
-    private SchemaObject addSchemaObject( Registries registries, SchemaObject schemaObject, Schema schema) 
+    private SchemaObject addSchemaObject( Registries registries, SchemaObject schemaObject, Schema schema )
         throws Exception
     {
         if ( registries.isRelaxed() )
@@ -668,22 +666,22 @@
                 errors.add( new Throwable() );
             }
         }
-        
+
         return schemaObject;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public boolean loadAllEnabled() throws Exception
     {
         Schema[] schemas = schemaLoader.getAllEnabled().toArray( new Schema[0] );
-        
+
         return loadWithDeps( schemas );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -701,7 +699,7 @@
     {
         // Work on a cloned and relaxed registries
         Registries clonedRegistries = cloneRegistries();
-        
+
         // Accept the disabled schemas
         clonedRegistries.setDisabledAccepted( true );
 
@@ -710,14 +708,14 @@
         {
             // Enable the Schema object before loading it
             schema.enable();
-            load( clonedRegistries, schema  );
+            load( clonedRegistries, schema );
         }
 
         // Swap the registries if it is consistent
         return swapRegistries( clonedRegistries );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -726,7 +724,7 @@
         return loadDisabled( toArray( schemas ) );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -736,7 +734,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -745,16 +743,16 @@
         // TODO Auto-generated method stub
         return false;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
     public boolean loadWithDeps( Schema... schemas ) throws Exception
     {
-    	boolean loaded = false;
+        boolean loaded = false;
 
-    	// Work on a cloned and relaxed registries
+        // Work on a cloned and relaxed registries
         Registries clonedRegistries = cloneRegistries();
         clonedRegistries.setRelaxed();
 
@@ -763,39 +761,39 @@
         {
             loadDepsFirst( clonedRegistries, schema );
         }
-        
+
         // Build the cross references
         List&lt;Throwable&gt; errors = clonedRegistries.buildReferences();
-        
+
         if ( errors.isEmpty() )
         {
-        	// Ok no errors. Check the registries now
-        	errors = clonedRegistries.checkRefInteg();
-        	
-        	if ( errors.isEmpty() )
-        	{
-        		// We are golden : let's apply the schema in the real registries
+            // Ok no errors. Check the registries now
+            errors = clonedRegistries.checkRefInteg();
+
+            if ( errors.isEmpty() )
+            {
+                // We are golden : let's apply the schema in the real registries
 
-        		// Load the schemas
+                // Load the schemas
                 for ( Schema schema : schemas )
                 {
-                	loadDepsFirst( registries, schema  );
+                    loadDepsFirst( registries, schema );
                 }
 
                 // Build the cross references
                 registries.buildReferences();
-                
+
                 loaded = true;
-        	}
+            }
         }
-        
+
         // clear the cloned registries
         clonedRegistries.clear();
 
         return loaded;
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -804,7 +802,7 @@
         return loadWithDeps( toArray( schemas ) );
     }
 
-    
+
     /**
      * Recursive method which loads schema's with their dependent schemas first
      * and tracks what schemas it has seen so the recursion does not go out of
@@ -822,22 +820,22 @@
             LOG.info( "The schema is disabled and the registries does not accepted disabled schema" );
             return;
         }
-        
+
         String schemaName = schema.getSchemaName();
-        
+
         if ( registries.isSchemaLoaded( schemaName ) )
         {
             LOG.info( "{} schema has already been loaded" + schema.getSchemaName() );
             return;
         }
-        
+
         String[] deps = schema.getDependencies();
 
         // if no deps then load this guy and return
         if ( ( deps == null ) || ( deps.length == 0 ) )
         {
             load( registries, schema );
-            
+
             return;
         }
 
@@ -865,7 +863,7 @@
         load( registries, schema );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -875,7 +873,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -885,17 +883,17 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
     public void setRegistries( Registries registries )
     {
         // TODO Auto-generated method stub
-        
+
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -915,7 +913,7 @@
         return false;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -923,7 +921,7 @@
     {
         // Work on a cloned registries
         Registries clonedRegistries = cloneRegistries();
-        
+
         // Loop on all the schemas 
         for ( Schema schema : schemas )
         {
@@ -931,17 +929,17 @@
             {
                 // Inject the schema
                 boolean loaded = load( clonedRegistries, schema );
-                
+
                 if ( !loaded )
                 {
                     // We got an error : exit
                     clonedRegistries.clear();
                     return false;
                 }
-                
+
                 // Now, check the registries
                 List&lt;Throwable&gt; errors = clonedRegistries.checkRefInteg();
-                
+
                 if ( errors.size() != 0 )
                 {
                     // We got an error : exit
@@ -956,14 +954,14 @@
                 return false;
             }
         }
-        
+
         // We can now delete the cloned registries before exiting
         clonedRegistries.clear();
-        
+
         return true;
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -972,7 +970,7 @@
         return verify( toArray( schemas ) );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1001,8 +999,8 @@
         try
         {
             schemaModificationAttributesDN = new LdapDN( SchemaConstants.SCHEMA_MODIFICATIONS_DN );
-            schemaModificationAttributesDN.normalize( 
-                getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
+            schemaModificationAttributesDN
+                .normalize( getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
         }
         catch ( NamingException e )
         {
@@ -1039,7 +1037,7 @@
     {
         return new ImmutableComparatorRegistry( registries.getComparatorRegistry() );
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -1049,7 +1047,7 @@
         return new ImmutableDITContentRuleRegistry( registries.getDitContentRuleRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1058,7 +1056,7 @@
         return new ImmutableDITStructureRuleRegistry( registries.getDitStructureRuleRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1067,7 +1065,7 @@
         return new ImmutableMatchingRuleRegistry( registries.getMatchingRuleRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1076,7 +1074,7 @@
         return new ImmutableMatchingRuleUseRegistry( registries.getMatchingRuleUseRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1085,7 +1083,7 @@
         return new ImmutableNameFormRegistry( registries.getNameFormRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1094,7 +1092,7 @@
         return new ImmutableNormalizerRegistry( registries.getNormalizerRegistry() );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1140,24 +1138,103 @@
     }
 
 
+    /**
+     * Check that the given OID does not already exist in the globalOidRegistry.
+     */
+    private void checkOidIsUnique( SchemaObject schemaObject ) throws NamingException
+    {
+        if ( registries.getGlobalOidRegistry().hasOid( schemaObject.getOid() ) )
+        {
+            throw new LdapSchemaViolationException( "Oid " + schemaObject.getOid()
+                + " for new schema entity is not unique.", ResultCodeEnum.OTHER );
+        }
+    }
+
+
+    /**
+     * Retrieve the schema name for a specific SchemaObject, or return "other" if none is found.
+     */
+    private String getSchemaName( SchemaObject schemaObject ) throws Exception
+    {
+        String schemaName = StringTools.toLowerCase( schemaObject.getSchemaName() );
+
+        if ( schemaLoader.getSchema( schemaName ) == null )
+        {
+            return MetaSchemaConstants.SCHEMA_OTHER;
+        }
+        else
+        {
+            return schemaName;
+        }
+    }
+
+
     //-----------------------------------------------------------------------------------
     // SchemaObject operations
     //-----------------------------------------------------------------------------------
     /**
      * {@inheritDoc}
      */
-    public void add( SchemaObject schemaObject ) throws NamingException
+    public void add( SchemaObject schemaObject ) throws Exception
     {
-    	if ( isRelaxed )
-    	{
-    		// Apply the addition right away
-    		registries.add( schemaObject );
-    	}
-    	else
-    	{
-    		// Clone, apply, check, then apply again if ok
-    		
-    	}
+        if ( registries.isRelaxed() )
+        {
+            // Apply the addition right away
+            registries.add( schemaObject );
+        }
+        else
+        {
+            // Clone, apply, check, then apply again if ok
+            // The new schemaObject's OID must not already exist
+            checkOidIsUnique( schemaObject );
+
+            // Build the new AttributeType from the given entry
+            String schemaName = getSchemaName( schemaObject );
+
+            // At this point, the constructed AttributeType has not been checked against the 
+            // existing Registries. It may be broken (missing SUP, or such), it will be checked
+            // there, if the schema and the AttributeType are both enabled.
+            Schema schema = getLoadedSchema( schemaName );
+            List&lt;Throwable&gt; errors = new ArrayList&lt;Throwable&gt;();
+
+            if ( schema.isEnabled() &amp;&amp; schemaObject.isEnabled() )
+            {
+                // As we may break the registries, work on a cloned registries
+                Registries clonedRegistries = registries.clone();
+
+                // Inject the new SchemaObject in the cloned registries
+                clonedRegistries.add( errors, schemaObject );
+
+                // Remove the cloned registries
+                clonedRegistries.clear();
+
+                // If we didn't get any error, apply the addition to the real retistries
+                if ( errors.isEmpty() )
+                {
+                    // Apply the addition to the real registries
+                    registries.add( errors, schemaObject );
+
+                    LOG.debug( "Added {} into the enabled schema {}", schemaObject.getName(), schemaName );
+                }
+                else
+                {
+                    // We have some error : reject the addition and get out
+                    String msg = "Cannot add the SchemaObject " + schemaObject.getOid() + " into the registries, "
+                        + "the resulting registries would be inconsistent :" + StringTools.listToString( errors );
+                    LOG.info( msg );
+                    throw new LdapOperationNotSupportedException( msg, ResultCodeEnum.UNWILLING_TO_PERFORM );
+                }
+            }
+            else
+            {
+                // At least, we register the OID in the globalOidRegistry, and associates it with the
+                // schema
+                registries.associateWithSchema( schemaObject );
+
+                LOG.debug( "Added {} into the disabled schema {}", schemaObject.getName(), schemaName );
+            }
+
+        }
     }
 
 
@@ -1169,7 +1246,7 @@
         return registries.unregister( schemaObject );
     }
 
-    
+
     /**
      * {@inheritDoc}
      */
@@ -1177,8 +1254,8 @@
     {
         return registries.getAttributeTypeRegistry().getNormalizerMapping();
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -1219,7 +1296,7 @@
             return false;
         }
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -1331,7 +1408,7 @@
         return isRelaxed;
     }
 
-    
+
     /**
      * Tells if the SchemaManager is strict.
      *
@@ -1342,7 +1419,7 @@
         return !isRelaxed;
     }
 
-    
+
     /**
      * Change the SchemaManager to a relaxed mode, where invalid SchemaObjects
      * can be registered.
@@ -1352,7 +1429,7 @@
         isRelaxed = RELAXED;
     }
 
-    
+
     /**
      * Change the SchemaManager to a strict mode, where invalid SchemaObjects
      * cannot be registered.

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java?rev=886230&amp;r1=886229&amp;r2=886230&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/SchemaManager.java Wed Dec  2 18:08:07 2009
@@ -19,6 +19,7 @@
  */
 package org.apache.directory.shared.ldap.schema;
 
+
 import java.util.List;
 import java.util.Map;
 
@@ -42,6 +43,7 @@
 import org.apache.directory.shared.ldap.schema.registries.SchemaLoader;
 import org.apache.directory.shared.ldap.schema.registries.SyntaxCheckerRegistry;
 
+
 /**
  * A class used to manage access to the Schemas and Registries. It's associated 
  * with a SchemaLoader, in charge of loading the schemas from the disk.
@@ -69,7 +71,7 @@
      */
     boolean load( Schema... schemas ) throws Exception;
 
-    
+
     /**
      * Load some Schemas into the registries. The Registries is checked after the 
      * schemas have been loaded, and if there is an error, the method returns false
@@ -116,8 +118,8 @@
      * @throws Exception @TODO 
      */
     boolean loadWithDeps( String... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Load Schemas into the registries, even if there are some errors in the schemas. 
      * The Registries is checked after the schemas have been loaded. Even if we have 
@@ -132,8 +134,8 @@
      * @throws Exception @TODO 
      */
     boolean loadRelaxed( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Load Schemas into the registries, even if there are some errors in the schemas. 
      * The Registries is checked after the schemas have been loaded. Even if we have 
@@ -180,8 +182,8 @@
      * @throws Exception @TODO 
      */
     boolean loadWithDepsRelaxed( String... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Load Schemas into the Registries, even if they are disabled. The disabled
      * SchemaObject from an enabled schema will also be loaded. The Registries will
@@ -195,8 +197,8 @@
      * @throws Exception @TODO 
      */
     boolean loadDisabled( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Load Schemas into the Registries, even if they are disabled. The disabled
      * SchemaObject from an enabled schema will also be loaded. The Registries will
@@ -210,8 +212,8 @@
      * @throws Exception @TODO 
      */
     boolean loadDisabled( String... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Load all the enabled schema into the Registries. The Registries is strict,
      * any inconsistent schema will be rejected. 
@@ -220,8 +222,8 @@
      * @throws Exception @TODO
      */
     boolean loadAllEnabled() throws Exception;
-    
-    
+
+
     /**
      * Load all the enabled schema into the Registries. The Registries is relaxed,
      * even inconsistent schema will be loaded. 
@@ -230,8 +232,8 @@
      * @throws Exception @TODO
      */
     boolean loadAllEnabledRelaxed() throws Exception;
-    
-    
+
+
     /**
      * Unload the given set of Schemas
      *
@@ -239,8 +241,8 @@
      * @return True if all the schemas have been unloaded
      */
     boolean unload( Schema... schemas );
-    
-    
+
+
     /**
      * Unload the given set of Schemas
      *
@@ -248,8 +250,8 @@
      * @return True if all the schemas have been unloaded
      */
     boolean unload( String... schemas );
-    
-    
+
+
     //---------------------------------------------------------------------------------
     // Other Schema methods
     //---------------------------------------------------------------------------------
@@ -264,7 +266,7 @@
      *  @return true if the Registries is still consistent, false otherwise.
      */
     boolean enable( Schema... schemas ) throws Exception;
-    
+
 
     /**
      * Enables a set of Schemas, and returns true if all the schema have been
@@ -278,7 +280,7 @@
      */
     boolean enable( String... schemas ) throws Exception;
 
-    
+
     /**
      * Enables a set of Schemas, and returns true if all the schema have been
      * enabled, with all the dependent schemas. No check is done, the Registries
@@ -289,7 +291,7 @@
      */
     boolean enableRelaxed( Schema... schemas );
 
-    
+
     /**
      * Enables a set of Schemas, and returns true if all the schema have been
      * enabled, with all the dependent schemas. No check is done, the Registries
@@ -299,8 +301,8 @@
      *  @return true if all the schemas have been enabled
      */
     boolean enableRelaxed( String... schemas );
-    
-    
+
+
     /**
      * Disables a set of Schemas, and returns true if all the schema have been
      * disabled, with all the dependent schemas, and if the registries is 
@@ -312,8 +314,8 @@
      *  @return true if the Registries is still consistent, false otherwise.
      */
     boolean disable( Schema... schemas );
-    
-    
+
+
     /**
      * Disables a set of Schemas, and returns true if all the schema have been
      * disabled, with all the dependent schemas, and if the registries is 
@@ -326,7 +328,7 @@
      */
     boolean disable( String... schemas );
 
-    
+
     /**
      * Disables a set of Schemas, and returns true if all the schema have been
      * disabled, with all the dependent schemas. The Registries is not checked
@@ -339,7 +341,7 @@
      */
     boolean disabledRelaxed( Schema... schemas );
 
-    
+
     /**
      * Disables a set of Schemas, and returns true if all the schema have been
      * disabled, with all the dependent schemas. The Registries is not checked
@@ -361,8 +363,8 @@
      * @throws Exception if something went wrong
      */
     boolean verify( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Check that the Schemas are consistent regarding the current Registries.
      * 
@@ -371,14 +373,14 @@
      * @throws Exception if something went wrong
      */
     boolean verify( String... schemas ) throws Exception;
-    
-    
+
+
     /**
      * @return The Registries
      */
     Registries getRegistries();
-    
-    
+
+
     /**
      * Lookup for an AttributeType in the AttributeType registry
      * 
@@ -388,7 +390,7 @@
      */
     AttributeType lookupAttributeTypeRegistry( String oid ) throws NamingException;
 
-    
+
     /**
      * Lookup for a Comparator in the Comparator registry
      * 
@@ -397,8 +399,8 @@
      * @throws NamingException if the OID is not found in the Comparator registry
      */
     LdapComparator&lt;?&gt; lookupComparatorRegistry( String oid ) throws NamingException;
-    
-    
+
+
     /**
      * Get an immutable reference on the AttributeType registry
      * 
@@ -406,7 +408,7 @@
      */
     AttributeTypeRegistry getAttributeTypeRegistry();
 
-    
+
     /**
      * Get an immutable reference on the Comparator registry
      * 
@@ -414,7 +416,7 @@
      */
     ComparatorRegistry getComparatorRegistry();
 
-    
+
     /**
      * Get an immutable reference on the DITContentRule registry
      * 
@@ -422,7 +424,7 @@
      */
     DITContentRuleRegistry getDITContentRuleRegistry();
 
-    
+
     /**
      * Get an immutable reference on the DITStructureRule registry
      * 
@@ -430,7 +432,7 @@
      */
     DITStructureRuleRegistry getDITStructureRuleRegistry();
 
-    
+
     /**
      * Get an immutable reference on the MatchingRule registry
      * 
@@ -438,7 +440,7 @@
      */
     MatchingRuleRegistry getMatchingRuleRegistry();
 
-    
+
     /**
      * Get an immutable reference on the MatchingRuleUse registry
      * 
@@ -446,7 +448,7 @@
      */
     MatchingRuleUseRegistry getMatchingRuleUseRegistry();
 
-    
+
     /**
      * Get an immutable reference on the Normalizer registry
      * 
@@ -454,7 +456,7 @@
      */
     NormalizerRegistry getNormalizerRegistry();
 
-    
+
     /**
      * Get an immutable reference on the NameForm registry
      * 
@@ -462,7 +464,7 @@
      */
     NameFormRegistry getNameFormRegistry();
 
-    
+
     /**
      * Get an immutable reference on the ObjectClass registry
      * 
@@ -470,7 +472,7 @@
      */
     ObjectClassRegistry getObjectClassRegistry();
 
-    
+
     /**
      * Get an immutable reference on the LdapSyntax registry
      * 
@@ -478,7 +480,7 @@
      */
     LdapSyntaxRegistry getLdapSyntaxRegistry();
 
-    
+
     /**
      * Get an immutable reference on the SyntaxChecker registry
      * 
@@ -486,7 +488,7 @@
      */
     SyntaxCheckerRegistry getSyntaxCheckerRegistry();
 
-    
+
     /**
      * Get an immutable reference on the Normalizer mapping
      * 
@@ -494,15 +496,15 @@
      */
     Map&lt;String, OidNormalizer&gt; getNormalizerMapping();
 
-    
+
     /**
      * Associate a new Registries to the SchemaManager
      *
      * @param registries The new Registries
      */
     void setRegistries( Registries registries );
-    
-    
+
+
     /***
      * Swap the registries, deleting all the schemaObjects and links from the old one
      * to avoid memory leaks.
@@ -512,14 +514,14 @@
      * @return true if the replacement has been done
      */
     public boolean swapRegistries( Registries targetRegistries ) throws NamingException;
-    
-    
+
+
     /**
      * @return The errors obtained when checking the registries
      */
     List&lt;Throwable&gt; getErrors();
-    
-    
+
+
     /**
      * Associate a Schema loader to this SchemaManager
      *
@@ -540,8 +542,8 @@
      * @throws Exception If the initialization fails
      */
     void initialize() throws Exception;
-    
-    
+
+
     /**
      * @return The used loader
      */
@@ -553,10 +555,10 @@
      * consistent after this addition, if the SchemaManager is in Strict mode.
      *
      * @param schemaObject the SchemaObject to register
-     * @throws NamingException if the SchemaObject is already registered or
+     * @throws Exception if the SchemaObject is already registered or
      * the registration operation is not supported
      */
-    void add( SchemaObject schemaObject ) throws NamingException;
+    void add( SchemaObject schemaObject ) throws Exception;
 
 
     /**
@@ -673,8 +675,8 @@
      * @return The OidRegistry
      */
     OidRegistry getOidRegistry();
-    
-    
+
+
     /**
      * Gets a schema that has been loaded into these Registries.
      * 

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java?rev=886230&amp;r1=886229&amp;r2=886230&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/AbstractSchemaLoader.java Wed Dec  2 18:08:07 2009
@@ -48,31 +48,30 @@
 {
     /** static class logger */
     private static final Logger LOG = LoggerFactory.getLogger( AbstractSchemaLoader.class );
-    
 
     protected SchemaLoaderListener listener;
-    
+
     /** 
      * A map of all available schema names to schema objects. This map is 
      * populated when this class is created with all the schemas present in
      * the LDIF based schema repository.
      */
-    protected final Map&lt;String,Schema&gt; schemaMap = new HashMap&lt;String,Schema&gt;();
-    
+    protected final Map&lt;String, Schema&gt; schemaMap = new HashMap&lt;String, Schema&gt;();
+
 
     public void setListener( SchemaLoaderListener listener )
     {
         this.listener = listener;
     }
-    
-    
+
+
     protected final void notifyListenerOrRegistries( Schema schema, Registries registries )
     {
         if ( listener != null )
         {
             listener.schemaLoaded( schema );
         }
-        
+
         if ( registries instanceof SchemaLoaderListener )
         {
             if ( registries != listener )
@@ -82,8 +81,8 @@
             }
         }
     }
-    
-    
+
+
     /**
      * {@inheritDoc}
      */
@@ -91,8 +90,8 @@
     {
         return schemaMap.values();
     }
-    
-    
+
+
     /**
      * Recursive method which loads schema's with their dependent schemas first
      * and tracks what schemas it has seen so the recursion does not go out of
@@ -197,57 +196,59 @@
         return this.schemaMap.get( schemaName );
     }
 
-    
+
     protected Schema getSchema( Entry entry ) throws Exception
     {
         String name;
         String owner;
         String[] dependencies = StringTools.EMPTY_STRINGS;
         boolean isDisabled = false;
-        
+
         if ( entry == null )
         {
             throw new NullPointerException( "entry cannot be null" );
         }
-        
+
         if ( entry.get( SchemaConstants.CN_AT ) == null )
         {
             throw new NullPointerException( "entry must have a valid cn attribute" );
         }
-        
+
         name = entry.get( SchemaConstants.CN_AT ).getString();
-        
+
         if ( entry.get( SchemaConstants.CREATORS_NAME_AT ) == null )
         {
-            throw new NullPointerException( "entry must have a valid " 
-                + SchemaConstants.CREATORS_NAME_AT + " attribute" );
+            throw new NullPointerException( "entry must have a valid " + SchemaConstants.CREATORS_NAME_AT
+                + " attribute" );
         }
-        
+
         owner = entry.get( SchemaConstants.CREATORS_NAME_AT ).getString();
-        
+
         if ( entry.get( MetaSchemaConstants.M_DISABLED_AT ) != null )
         {
             String value = entry.get( MetaSchemaConstants.M_DISABLED_AT ).getString();
             value = value.toUpperCase();
             isDisabled = value.equals( "TRUE" );
         }
-        
+
         if ( entry.get( MetaSchemaConstants.M_DEPENDENCIES_AT ) != null )
         {
             Set&lt;String&gt; depsSet = new HashSet&lt;String&gt;();
             EntryAttribute depsAttr = entry.get( MetaSchemaConstants.M_DEPENDENCIES_AT );
-            
-            for ( Value&lt;?&gt; value:depsAttr )
+
+            for ( Value&lt;?&gt; value : depsAttr )
             {
                 depsSet.add( value.getString() );
             }
 
             dependencies = depsSet.toArray( StringTools.EMPTY_STRINGS );
         }
-        
-        return new DefaultSchema( name, owner, dependencies, isDisabled ){};
+
+        return new DefaultSchema( name, owner, dependencies, isDisabled )
+        {
+        };
     }
-    
+
 
     /**
      * {@inheritDoc}
@@ -662,18 +663,18 @@
     {
         return null;
     }
-    
-    
+
+
     private Schema[] buildSchemaArray( String... schemaNames ) throws Exception
     {
         Schema[] schemas = new Schema[schemaNames.length];
         int pos = 0;
-        
+
         for ( String schemaName : schemaNames )
         {
             schemas[pos++] = getSchema( schemaName );
         }
-        
+
         return schemas;
     }
 
@@ -687,7 +688,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadAttributeTypes( buildSchemaArray( schemaNames ) );
     }
 
@@ -701,7 +702,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadComparators( buildSchemaArray( schemaNames ) );
     }
 
@@ -715,7 +716,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadDitContentRules( buildSchemaArray( schemaNames ) );
     }
 
@@ -729,7 +730,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadDitStructureRules( buildSchemaArray( schemaNames ) );
     }
 
@@ -743,7 +744,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadMatchingRules( buildSchemaArray( schemaNames ) );
     }
 
@@ -757,7 +758,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadMatchingRuleUses( buildSchemaArray( schemaNames ) );
     }
 
@@ -771,7 +772,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadNameForms( buildSchemaArray( schemaNames ) );
     }
 
@@ -785,7 +786,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadNormalizers( buildSchemaArray( schemaNames ) );
     }
 
@@ -799,7 +800,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadObjectClasses( buildSchemaArray( schemaNames ) );
     }
 
@@ -813,7 +814,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadSyntaxes( buildSchemaArray( schemaNames ) );
     }
 
@@ -827,7 +828,7 @@
         {
             return new ArrayList&lt;Entry&gt;();
         }
-        
+
         return loadSyntaxCheckers( buildSchemaArray( schemaNames ) );
     }
 }

Modified: directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java?rev=886230&amp;r1=886229&amp;r2=886230&amp;view=diff
==============================================================================
--- directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java (original)
+++ directory/shared/branches/shared-schema/ldap/src/main/java/org/apache/directory/shared/ldap/schema/registries/SchemaLoader.java Wed Dec  2 18:08:07 2009
@@ -40,8 +40,8 @@
      * @param listener the listener to notify (only one is enough for us)
      */
     void setListener( SchemaLoaderListener listener );
-    
-    
+
+
     /**
      * Gets a schema object based on it's name.
      * 
@@ -50,8 +50,8 @@
      * @throws Exception if any problems while trying to find the associated Schema
      */
     Schema getSchema( String schemaName ) throws Exception;
-    
-    
+
+
     /**
      * Loads a set of schemas.  A best effort should be made to load the dependended 
      * schemas that these schemas may rely on even if they are not included in the collection.
@@ -95,8 +95,8 @@
      * @throws Exception if there are failures accessing AttributeType information
      */
     List&lt;Entry&gt; loadAttributeTypes( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of AttributeTypes read from the underlying storage for
      * a list of specific schema, using their name
@@ -105,8 +105,8 @@
      * @throws Exception if there are failures accessing AttributeType information
      */
     List&lt;Entry&gt; loadAttributeTypes( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of Comparators read from the underlying storage for
      * a list of specific schema.
@@ -115,8 +115,8 @@
      * @throws Exception if there are failures accessing Comparator information
      */
     List&lt;Entry&gt; loadComparators( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of Comparators read from the underlying storage for
      * a list of specific schema, using their name
@@ -125,8 +125,8 @@
      * @throws Exception if there are failures accessing Comparator information
      */
     List&lt;Entry&gt; loadComparators( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of DitContentRules read from the underlying storage for
      * a list of specific schema.
@@ -135,8 +135,8 @@
      * @throws Exception if there are failures accessing DitContentRule information
      */
     List&lt;Entry&gt; loadDitContentRules( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of DitContentRules read from the underlying storage for
      * a list of specified schema names
@@ -155,8 +155,8 @@
      * @throws Exception if there are failures accessing DitStructureRule information
      */
     List&lt;Entry&gt; loadDitStructureRules( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of DitStructureRules read from the underlying storage for
      * a list of specified schema names
@@ -175,8 +175,8 @@
      * @throws Exception if there are failures accessing MatchingRule information
      */
     List&lt;Entry&gt; loadMatchingRules( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of MatchingRules read from the underlying storage for
      * a list of specific schema, using their name
@@ -185,8 +185,8 @@
      * @throws Exception if there are failures accessing MatchingRule information
      */
     List&lt;Entry&gt; loadMatchingRules( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of MatchingRuleUses read from the underlying storage for
      * a list of specific schema.
@@ -195,8 +195,8 @@
      * @throws Exception if there are failures accessing MatchingRuleUse information
      */
     List&lt;Entry&gt; loadMatchingRuleUses( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of MatchingRuleUses read from the underlying storage for
      * a list of specified schema names
@@ -215,8 +215,8 @@
      * @throws Exception if there are failures accessing NameForm information
      */
     List&lt;Entry&gt; loadNameForms( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of NameForms read from the underlying storage for
      * a list of specified schema names
@@ -235,8 +235,8 @@
      * @throws Exception if there are failures accessing Normalizer information
      */
     List&lt;Entry&gt; loadNormalizers( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of Normalizers read from the underlying storage for
      * a list of specified schema names
@@ -245,8 +245,8 @@
      * @throws Exception if there are failures accessing Normalizer information
      */
     List&lt;Entry&gt; loadNormalizers( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of ObjectClasses read from the underlying storage for
      * a list of specific schema.
@@ -255,8 +255,8 @@
      * @throws Exception if there are failures accessing ObjectClass information
      */
     List&lt;Entry&gt; loadObjectClasses( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of ObjectClasses read from the underlying storage for
      * a list of specified schema names
@@ -265,8 +265,8 @@
      * @throws Exception if there are failures accessing ObjectClasses information
      */
     List&lt;Entry&gt; loadObjectClasses( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of Syntaxes read from the underlying storage for
      * a list of specified schema
@@ -275,8 +275,8 @@
      * @throws Exception if there are failures accessing Syntax information
      */
     List&lt;Entry&gt; loadSyntaxes( Schema... schemas ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of Syntaxes read from the underlying storage for
      * a list of specified schema names
@@ -285,8 +285,8 @@
      * @throws Exception if there are failures accessing Syntax information
      */
     List&lt;Entry&gt; loadSyntaxes( String... schemaNames ) throws Exception;
-    
-    
+
+
     /**
      * Build a list of SyntaxCheckers read from the underlying storage for
      * a list of specified schema




</pre>
</div>
</content>
</entry>
</feed>
