directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r592094 [9/35] - in /directory/sandbox/felixk/studio-schemaeditor: ./ META-INF/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/studio/ src/ma...
Date Mon, 05 Nov 2007 17:15:02 GMT
Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SingleValueDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SingleValueDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SingleValueDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SingleValueDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,43 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of single value value.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SingleValueDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SingleValueDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SingleValueDifference( Object source, Object destination )
+    {
+        super( source, destination, DifferenceType.MODIFIED );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SingleValueDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SubstringDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SubstringDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SubstringDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SubstringDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of substring.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SubstringDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SubstringDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     * @param type
+     *      the type
+     */
+    public SubstringDifference( Object source, Object destination, DifferenceType type )
+    {
+        super( source, destination, type );
+    }
+
+
+    /**
+     * Creates a new instance of SubstringDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SubstringDifference( Object source, Object destination )
+    {
+        super( source, destination );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SubstringDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorATDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorATDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorATDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorATDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of superior attribute type.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SuperiorATDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SuperiorATDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     * @param type
+     *      the type
+     */
+    public SuperiorATDifference( Object source, Object destination, DifferenceType type )
+    {
+        super( source, destination, type );
+    }
+
+
+    /**
+     * Creates a new instance of SuperiorATDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SuperiorATDifference( Object source, Object destination )
+    {
+        super( source, destination );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorATDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorOCDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorOCDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorOCDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorOCDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of added superior object class.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SuperiorOCDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SuperiorOCDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     * @param type
+     *      the type
+     */
+    public SuperiorOCDifference( Object source, Object destination, DifferenceType type )
+    {
+        super( source, destination, type );
+    }
+
+
+    /**
+     * Creates a new instance of SuperiorOCDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SuperiorOCDifference( Object source, Object destination )
+    {
+        super( source, destination );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SuperiorOCDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of syntax.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SyntaxDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SyntaxDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     * @param type
+     *      the type
+     */
+    public SyntaxDifference( Object source, Object destination, DifferenceType type )
+    {
+        super( source, destination, type );
+    }
+
+
+    /**
+     * Creates a new instance of SyntaxDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SyntaxDifference( Object source, Object destination )
+    {
+        super( source, destination );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxLengthDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxLengthDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxLengthDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxLengthDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,59 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of syntax length.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class SyntaxLengthDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of SyntaxLengthDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     * @param type
+     *      the type
+     */
+    public SyntaxLengthDifference( Object source, Object destination, DifferenceType type )
+    {
+        super( source, destination, type );
+    }
+
+
+    /**
+     * Creates a new instance of SyntaxLengthDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public SyntaxLengthDifference( Object source, Object destination )
+    {
+        super( source, destination );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/SyntaxLengthDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/UsageDifference.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/UsageDifference.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/UsageDifference.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/UsageDifference.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,43 @@
+/*
+ *  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.studio.schemaeditor.model.difference;
+
+
+/**
+ * This class represents a difference of usage.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class UsageDifference extends AbstractPropertyDifference
+{
+    /**
+     * Creates a new instance of UsageDifference.
+     *
+     * @param source
+     *      the source Object
+     * @param destination
+     *      the destination Object
+     */
+    public UsageDifference( Object source, Object destination )
+    {
+        super( source, destination, DifferenceType.MODIFIED );
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/difference/UsageDifference.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyManager.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyManager.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyManager.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,557 @@
+/*
+ *  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.studio.schemaeditor.model.hierarchy;
+
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.collections.map.MultiValueMap;
+import org.apache.directory.shared.ldap.schema.SchemaObject;
+import org.apache.directory.studio.schemaeditor.Activator;
+import org.apache.directory.studio.schemaeditor.controller.SchemaHandler;
+import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
+import org.apache.directory.studio.schemaeditor.model.ObjectClassImpl;
+import org.apache.directory.studio.schemaeditor.model.Schema;
+
+
+/**
+ * This class represents the HierarchyManager.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class HierarchyManager
+{
+    /** The parents map is used to store for each element its parents */
+    private MultiValueMap parentsMap;
+
+    /** The parents map is used to store for each element its children */
+    private MultiValueMap childrenMap;
+
+    /** The SchemaHandler */
+    private SchemaHandler schemaHandler;
+
+    /** The RootObject of the Hierarchy */
+    private RootObject root;
+
+
+    /**
+     * Creates a new instance of HierarchyManager.
+     */
+    public HierarchyManager()
+    {
+        // Initializing the maps
+        parentsMap = new MultiValueMap();
+        childrenMap = new MultiValueMap();
+
+        // Getting the SchemaHandler
+        schemaHandler = Activator.getDefault().getSchemaHandler();
+
+        // Loading the complete Schema
+        loadSchema();
+    }
+
+
+    /**
+     * Adds an attribute type.
+     *
+     * @param at
+     *      the attribute type
+     */
+    private void addAttributeType( AttributeTypeImpl at )
+    {
+        // Checking Aliases and OID
+        checkAliasesAndOID( at );
+
+        String superiorName = at.getSuperiorName();
+        if ( superiorName != null )
+        // The attribute type has a superior
+        {
+            AttributeTypeImpl superior = schemaHandler.getAttributeType( superiorName );
+            if ( superior != null )
+            // The superior attribute type object exists
+            {
+                parentsMap.put( at, superior );
+                childrenMap.put( superior, at );
+            }
+            else
+            // The superior attribute type object does not exist
+            {
+                // Then, its parent is the name of its superior and
+                // it becomes the children of it and the RootObject
+                parentsMap.put( at, superiorName.toLowerCase() );
+                childrenMap.put( superiorName.toLowerCase(), at );
+                childrenMap.put( root, at );
+            }
+        }
+        else
+        // The attribute type does not have a superior
+        {
+            // Then, its parent is the RootObject
+            parentsMap.put( at, root );
+            childrenMap.put( root, at );
+        }
+    }
+
+
+    /**
+     * Adds an object class.
+     *
+     * @param oc
+     *      the object class
+     */
+    private void addObjectClass( ObjectClassImpl oc )
+    {
+        // Checking Aliases and OID
+        checkAliasesAndOID( oc );
+
+        String[] superClasseNames = oc.getSuperClassesNames();
+        if ( ( superClasseNames != null ) && ( superClasseNames.length > 0 ) )
+        // The object class has one or more superiors
+        {
+            for ( String superClassName : superClasseNames )
+            {
+                ObjectClassImpl superClass = schemaHandler.getObjectClass( superClassName );
+                if ( superClass == null )
+                {
+                    parentsMap.put( oc, superClassName.toLowerCase() );
+                    childrenMap.put( superClassName.toLowerCase(), oc );
+                    childrenMap.put( root, oc );
+                }
+                else
+                {
+                    parentsMap.put( oc, superClass );
+                    childrenMap.put( superClass, oc );
+                }
+            }
+        }
+        else
+        // The object class does not have any declared superior
+        // Then, it is a child of the "top (2.5.6.0)" object class
+        // (Unless it is the "top (2.5.6.0)" object class itself)
+        {
+            ObjectClassImpl topOC = schemaHandler.getObjectClass( "2.5.6.0" );
+            if ( oc.equals( topOC ) )
+            // The given object class is the "top (2.5.6.0)" object class
+            {
+                parentsMap.put( oc, root );
+                childrenMap.put( root, oc );
+            }
+            else
+            {
+                if ( topOC != null )
+                // The "top (2.5.6.0)" object class exists
+                {
+                    parentsMap.put( oc, topOC );
+                    childrenMap.put( topOC, oc );
+                }
+                else
+                // The "top (2.5.6.0)" object class does not exist
+                {
+                    parentsMap.put( oc, "2.5.6.0" );
+                    childrenMap.put( "2.5.6.0", oc );
+                    childrenMap.put( root, oc );
+                }
+            }
+        }
+    }
+
+
+    /**
+     * This method is called when an attribute type is added.
+     *
+     * @param at
+     *      the added attribute type
+     */
+    public void attributeTypeAdded( AttributeTypeImpl at )
+    {
+        addAttributeType( at );
+    }
+
+
+    /**
+     * This method is called when an attribute type is modified.
+     *
+     * @param at
+     *      the modified attribute type
+     */
+    public void attributeTypeModified( AttributeTypeImpl at )
+    {
+        // Removing the attribute type
+        List<Object> parents = getParents( at );
+        if ( parents != null )
+        {
+            for ( Object parent : parents )
+            {
+                childrenMap.remove( parent, at );
+            }
+
+            parentsMap.remove( at );
+        }
+
+        // Adding the attribute type again
+        addAttributeType( at );
+    }
+
+
+    /**
+     * This method is called when an attribute type is removed.
+     *
+     * @param at
+     *      the removed attribute type
+     */
+    public void attributeTypeRemoved( AttributeTypeImpl at )
+    {
+        removeAttributeType( at );
+    }
+
+
+    /**
+     * Checks the Aliases and OID of an attribute type or an object class.
+     *
+     * @param object
+     *      an attribute type or an object class.
+     */
+    private void checkAliasesAndOID( SchemaObject object )
+    {
+        // Aliases
+        String[] aliases = object.getNames();
+        if ( aliases != null )
+        {
+            for ( String alias : aliases )
+            {
+                // Looking for children objects for this alias value
+                @SuppressWarnings("unchecked")
+                List<Object> children = ( List<Object> ) childrenMap.get( alias.toLowerCase() );
+                if ( children != null )
+                {
+                    for ( Object value : children )
+                    {
+                        childrenMap.put( object, value );
+                        parentsMap.remove( value, alias.toLowerCase() );
+                        parentsMap.put( value, object );
+                    }
+                    childrenMap.remove( alias.toLowerCase() );
+                }
+            }
+        }
+
+        // OID
+        String oid = object.getOid();
+        if ( oid != null )
+        {
+            // Looking for children objects for this OID value
+            @SuppressWarnings("unchecked")
+            List<Object> children = ( List<Object> ) childrenMap.get( oid.toLowerCase() );
+            if ( children != null )
+            {
+                for ( Object value : children )
+                {
+                    childrenMap.put( object, value );
+                    if ( oid.equals( "2.5.6.0" ) )
+                    {
+                        childrenMap.remove( root, value );
+                    }
+                    parentsMap.remove( value, oid.toLowerCase() );
+                    parentsMap.put( value, object );
+
+                }
+                childrenMap.remove( oid.toLowerCase() );
+            }
+        }
+    }
+
+
+    /**
+     * Gets the children of the given object.
+     *
+     * @param o
+     *      the object
+     * @return
+     *      the children of the given object
+     */
+    @SuppressWarnings("unchecked")
+    public List<Object> getChildren( Object o )
+    {
+        return ( List<Object> ) childrenMap.get( o );
+    }
+
+
+    /**
+     * Gets the parents of the given object.
+     *
+     * @param o
+     *      the object
+     * @return
+     *      the parents of the given object
+     */
+    @SuppressWarnings("unchecked")
+    public List<Object> getParents( Object o )
+    {
+        return ( List<Object> ) parentsMap.get( o );
+    }
+
+
+    /**
+     * Gets the RootObject of the Hierarchy.
+     *
+     * @return
+     *      the RootObject of the Hierarchy
+     */
+    public RootObject getRootObject()
+    {
+        return root;
+    }
+
+
+    /**
+     * Loads the Schema.
+     */
+    private void loadSchema()
+    {
+        if ( schemaHandler != null )
+        {
+            // Creating the root element
+            root = new RootObject();
+
+            // Looping on the schemas
+            for ( Schema schema : schemaHandler.getSchemas() )
+            {
+                // Looping on the attribute types
+                for ( AttributeTypeImpl at : schema.getAttributeTypes() )
+                {
+                    addAttributeType( at );
+                }
+
+                // Looping on the object classes
+                for ( ObjectClassImpl oc : schema.getObjectClasses() )
+                {
+                    addObjectClass( oc );
+                }
+            }
+        }
+    }
+
+
+    /**
+     * This method is called when an object class is added.
+     *
+     * @param oc
+     *      the added object class
+     */
+    public void objectClassAdded( ObjectClassImpl oc )
+    {
+        addObjectClass( oc );
+    }
+
+
+    /**
+     * This method is called when an object class is modified.
+     *
+     * @param oc
+     *      the modified object class
+     */
+    public void objectClassModified( ObjectClassImpl oc )
+    {
+        // Removing the object class type
+        List<Object> parents = getParents( oc );
+        if ( parents != null )
+        {
+            for ( Object parent : parents )
+            {
+                childrenMap.remove( parent, oc );
+            }
+
+            parentsMap.remove( oc );
+        }
+
+        // Adding the object class again
+        addObjectClass( oc );
+    }
+
+
+    /**
+     * This method is called when an object class is removed.
+     *
+     * @param oc
+     *      the removed object class
+     */
+    public void objectClassRemoved( ObjectClassImpl oc )
+    {
+        removeObjectClass( oc );
+    }
+
+
+    /**
+     * Removes an attribute type.
+     *
+     * @param at
+     *      the attribute type
+     */
+    private void removeAttributeType( AttributeTypeImpl at )
+    {
+        // Removing the attribute type as child of its superior
+        String superiorName = at.getSuperiorName();
+        if ( ( superiorName != null ) && ( !"".equals( superiorName ) ) )
+        {
+            AttributeTypeImpl superiorAT = schemaHandler.getAttributeType( superiorName );
+            if ( superiorAT == null )
+            {
+                childrenMap.remove( superiorName.toLowerCase(), at );
+            }
+            else
+            {
+                childrenMap.remove( superiorAT, at );
+            }
+        }
+        else
+        {
+            childrenMap.remove( root, at );
+        }
+
+        // Attaching each child (if there are children) to the RootObject
+        List<Object> children = getChildren( at );
+        if ( children != null )
+        {
+            for ( Object child : children )
+            {
+                AttributeTypeImpl childAT = ( AttributeTypeImpl ) child;
+
+                parentsMap.remove( child, at );
+
+                parentsMap.put( child, root );
+                childrenMap.put( root, child );
+                String childSuperiorName = childAT.getSuperiorName();
+                if ( ( childSuperiorName != null ) && ( !"".equals( childSuperiorName ) ) )
+                {
+                    parentsMap.put( child, childSuperiorName.toLowerCase() );
+                    childrenMap.put( childSuperiorName.toLowerCase(), child );
+                }
+            }
+        }
+
+        childrenMap.remove( at );
+        parentsMap.remove( at );
+    }
+
+
+    private void removeObjectClass( ObjectClassImpl oc )
+    {
+        // Removing the object class as child of its superiors
+        String[] superClassesNames = oc.getSuperClassesNames();
+        if ( ( superClassesNames != null ) && ( superClassesNames.length > 0 ) )
+        {
+            for ( String superClassName : superClassesNames )
+            {
+                if ( !"".equals( superClassName ) )
+                {
+                    ObjectClassImpl superClassOC = schemaHandler.getObjectClass( superClassName );
+                    if ( superClassOC == null )
+                    {
+                        childrenMap.remove( superClassName.toLowerCase(), oc );
+                        childrenMap.remove( root, oc );
+                    }
+                    else
+                    {
+                        childrenMap.remove( superClassOC, oc );
+                    }
+                }
+            }
+        }
+        else
+        {
+            if ( oc.getOid().equals( "2.5.6.0" ) )
+            // The given object class is the "top (2.5.6.0)" object class
+            {
+                childrenMap.remove( root, oc );
+            }
+            else
+            {
+                ObjectClassImpl topOC = schemaHandler.getObjectClass( "2.5.6.0" );
+                if ( topOC != null )
+                // The "top (2.5.6.0)" object class exists
+                {
+                    childrenMap.remove( topOC, oc );
+                }
+                else
+                // The "top (2.5.6.0)" object class does not exist
+                {
+                    childrenMap.remove( "2.5.6.0", oc );
+                }
+            }
+        }
+
+        // Attaching each child (if there are children) to the RootObject
+        List<Object> children = getChildren( oc );
+        if ( children != null )
+        {
+            for ( Object child : children )
+            {
+                ObjectClassImpl childOC = ( ObjectClassImpl ) child;
+
+                parentsMap.remove( child, oc );
+
+                parentsMap.put( child, root );
+                childrenMap.put( root, child );
+                String[] childSuperClassesNames = childOC.getSuperClassesNames();
+                if ( ( childSuperClassesNames != null ) && ( childSuperClassesNames.length > 0 ) )
+                {
+                    String correctSuperClassName = getCorrectSuperClassName( oc, childSuperClassesNames );
+                    if ( correctSuperClassName != null )
+                    {
+                        parentsMap.put( child, correctSuperClassName.toLowerCase() );
+                        childrenMap.put( correctSuperClassName.toLowerCase(), child );
+                    }
+                }
+                else
+                {
+                    parentsMap.put( child, "2.5.6.0" );
+                    childrenMap.put( "2.5.6.0", child );
+                }
+            }
+        }
+
+        childrenMap.remove( oc );
+        parentsMap.remove( oc );
+    }
+
+
+    private String getCorrectSuperClassName( ObjectClassImpl oc, String[] childSuperClassesNames )
+    {
+        if ( childSuperClassesNames != null )
+        {
+            List<String> aliases = Arrays.asList( oc.getNames() );
+            if ( aliases != null )
+            {
+                for ( String childSuperClassName : childSuperClassesNames )
+                {
+                    if ( aliases.contains( childSuperClassName ) )
+                    {
+                        return childSuperClassName;
+                    }
+                }
+            }
+        }
+
+        // Default
+        return null;
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyManager.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyWrapper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyWrapper.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyWrapper.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyWrapper.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,231 @@
+/*
+ *  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.studio.schemaeditor.model.hierarchy;
+
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+
+/**
+ * This class represents the HierarchyWrapper.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class HierarchyWrapper
+{
+    /** The wrapped object */
+    private Object wrappedObject;
+
+    /** The parent */
+    private Object parent;
+
+    /** The children */
+    private List<HierarchyWrapper> children = new ArrayList<HierarchyWrapper>();
+
+
+    /**
+     * Creates a new instance of HierarchyWrapper.
+     *
+     * @param obj
+     *      the wrapped object
+     */
+    public HierarchyWrapper( Object obj )
+    {
+        wrappedObject = obj;
+        parent = null;
+    }
+
+
+    /**
+     * Creates a new instance of HierarchyWrapper.
+     *
+     * @param obj
+     *      the wrapped object
+     * @param parent
+     *      the parent
+     */
+    public HierarchyWrapper( Object obj, Object parent )
+    {
+        wrappedObject = obj;
+        this.parent = parent;
+    }
+
+
+    /**
+     * Adds a child.
+     *
+     * @param child
+     *      the child
+     * @return
+     *      true (as per the general contract of the Collection.add method).
+     */
+    public boolean addChild( HierarchyWrapper child )
+    {
+        return children.add( child );
+    }
+
+
+    /**
+     * Appends all of the elements in the specified collection to the end 
+     * of the children, in the order that they are returned by the specified 
+     * collection's iterator (optional operation). 
+     *
+     * @param collection
+     *      the collection
+     * @return
+     *      true if the children changed as a result of the call.
+     */
+    public boolean addChildren( Collection<? extends HierarchyWrapper> children )
+    {
+        return this.children.addAll( children );
+    }
+
+
+    /**
+     * Indicates whether some other object is "equal to" this wrapped object.
+     *
+     * @param o
+     *      the reference object with which to compare.
+     * @return
+     *      true if this object is the same as the obj argument; false otherwise.
+     */
+    public boolean equalsWrappedObject( Object obj )
+    {
+        if ( obj != null )
+        {
+            return obj.equals( wrappedObject );
+        }
+
+        return false;
+    }
+
+
+    /**
+     * Gets the children.
+     *
+     * @return
+     *      the children
+     */
+    public List<HierarchyWrapper> getChildren()
+    {
+        return children;
+    }
+
+
+    /**
+     * Gets the parent.
+     *
+     * @return
+     *      the parent
+     */
+    public Object getParent()
+    {
+        return parent;
+    }
+
+
+    /**
+     * Gets the wrapped object.
+     *
+     * @return
+     *      the wrapped object
+     */
+    public Object getWrappedObject()
+    {
+        return wrappedObject;
+    }
+
+
+    /**
+     * Removes a child.
+     *
+     * @param child
+     *      the child
+     * @return
+     *      true if the children contained the specified element.
+     */
+    public boolean removeChild( HierarchyWrapper child )
+    {
+        return children.remove( child );
+    }
+
+
+    /**
+     * Removes from the children all the elements that are contained in 
+     * the specified collection (optional operation).
+     *
+     * @param collection
+     *      the collection
+     * @return
+     *      true if the children changed as a result of the call.
+     */
+    public boolean removeChildren( Collection<? extends HierarchyWrapper> children )
+    {
+        return this.children.removeAll( children );
+    }
+
+
+    /**
+     * Sets the children.
+     *
+     * @param children
+     *      the children
+     */
+    public void setChildren( List<HierarchyWrapper> children )
+    {
+        this.children = children;
+    }
+
+
+    /**
+     * Sets the parent.
+     *
+     * @param parent
+     *      the parent
+     */
+    public void setParent( Object parent )
+    {
+        this.parent = parent;
+    }
+
+
+    /**
+     * Sets the wrapped object.
+     *
+     * @param wrappedObject
+     *      the wrapped object
+     */
+    public void setWrappedObject( Object wrappedObject )
+    {
+        this.wrappedObject = wrappedObject;
+    }
+
+
+    /* (non-Javadoc)
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return "{|" + wrappedObject + "|" + children + "}";
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/HierarchyWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/RootObject.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/RootObject.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/RootObject.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/RootObject.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,7 @@
+package org.apache.directory.studio.schemaeditor.model.hierarchy;
+
+
+    class RootObject
+    {
+
+    }
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/hierarchy/RootObject.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,106 @@
+/*
+ *  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.studio.schemaeditor.model.io;
+
+
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+
+
+/**
+ * This class represents an AbstractSchemaConnector and implements SchemaConnector.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public abstract class AbstractSchemaConnector implements SchemaConnector
+{
+    /** The name */
+    private String name;
+
+    /** The ID */
+    private String id;
+
+    /** The description */
+    private String description;
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#getDecription()
+     */
+    public String getDescription()
+    {
+        return description;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#getId()
+     */
+    public String getId()
+    {
+        return id;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#getName()
+     */
+    public String getName()
+    {
+        return name;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#isSuitableConnector(org.apache.directory.studio.connection.core.Connection, org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     */
+    public boolean isSuitableConnector( Connection connection, StudioProgressMonitor monitor )
+    {
+        return false;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#setDescription(java.lang.String)
+     */
+    public void setDescription( String description )
+    {
+        this.description = description;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#setId(java.lang.String)
+     */
+    public void setId( String id )
+    {
+        this.id = id;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#setName(java.lang.String)
+     */
+    public void setName( String name )
+    {
+        this.name = name;
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java?rev=592094&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java (added)
+++ directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java Mon Nov  5 09:14:24 2007
@@ -0,0 +1,894 @@
+/*
+ *  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.studio.schemaeditor.model.io;
+
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.SearchControls;
+import javax.naming.directory.SearchResult;
+
+import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
+import org.apache.directory.shared.ldap.schema.UsageEnum;
+import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;
+import org.apache.directory.studio.schemaeditor.model.AttributeTypeImpl;
+import org.apache.directory.studio.schemaeditor.model.MatchingRuleImpl;
+import org.apache.directory.studio.schemaeditor.model.ObjectClassImpl;
+import org.apache.directory.studio.schemaeditor.model.Schema;
+import org.apache.directory.studio.schemaeditor.model.SchemaImpl;
+import org.apache.directory.studio.schemaeditor.model.SyntaxImpl;
+
+
+/**
+ * A Schema Connector for Apache DS.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ApacheDsSchemaConnector extends AbstractSchemaConnector implements SchemaConnector
+{
+
+    /** The Schema DN */
+    public static final String SCHEMA_DN = "ou=schema";
+
+    /** The name of the metaAttributeType object class */
+    private static final String META_ATTRIBUTE_TYPE = "metaAttributeType";
+    /** The name of the metaObjectClass object class */
+    private static final String META_OBJECT_CLASS = "metaObjectClass";
+    /** The name of the metaMatchingRule object class */
+    private static final String META_MATCHING_RULE = "metaMatchingRule";
+    /** The name of the metaSyntax object class */
+    private static final String META_SYNTAX = "metaSyntax";
+
+    private static final String DEREF_ALIAS_METHOD = "always";
+    private static final String HANDLE_REFERALS_METHOD = "throw";
+
+    /**
+     * This enum represents the different types of nodes that can be found while
+     * reading the schema from the DIT.
+     */
+    private enum SchemaNodeTypes
+    {
+        ATTRIBUTE_TYPE, OBJECT_CLASS, MATCHING_RULE, SYNTAX, UNKNOWN
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#exportSchema(org.apache.directory.studio.connection.core.Connection, org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     */
+    public void exportSchema( Connection connection, StudioProgressMonitor monitor )
+    {
+        // TODO Auto-generated method stub
+
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.SchemaConnector#importSchema(org.apache.directory.studio.connection.core.Connection, org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     */
+    public List<Schema> importSchema( Connection connection, StudioProgressMonitor monitor )
+    {
+        List<Schema> schemas = new ArrayList<Schema>();
+
+        JNDIConnectionWrapper wrapper = connection.getJNDIConnectionWrapper();
+
+        monitor.beginTask( "Fetching Schema: ", 1 );
+
+        // Looking for all the defined schemas
+        SearchControls constraintSearch = new SearchControls();
+        constraintSearch.setSearchScope( SearchControls.ONELEVEL_SCOPE );
+
+        NamingEnumeration<SearchResult> answer = wrapper.search( "ou=schema", "(objectclass=metaSchema)",
+            constraintSearch, DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, ( StudioProgressMonitor ) monitor );
+        if ( answer != null )
+        {
+            while ( answer.hasMoreElements() )
+            {
+                SearchResult searchResult = ( SearchResult ) answer.nextElement();
+
+                // Getting the 'cn' Attribute
+                Attribute cnAttribute = searchResult.getAttributes().get( "cn" );
+
+                // Looping on the values
+                NamingEnumeration<?> ne = null;
+                try
+                {
+                    ne = cnAttribute.getAll();
+                    if ( ne != null )
+                    {
+                        while ( ne.hasMoreElements() )
+                        {
+                            String value = ( String ) ne.nextElement();
+                            schemas.add( getSchema( wrapper, value, monitor ) );
+                        }
+                    }
+                }
+                catch ( NamingException e )
+                {
+                    monitor.reportError( e );
+                }
+            }
+        }
+
+        monitor.worked( 1 );
+
+        return schemas;
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.apache.directory.studio.schemaeditor.model.io.AbstractSchemaConnector#isSuitableConnector(org.apache.directory.studio.connection.core.Connection, org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     */
+    public boolean isSuitableConnector( Connection connection, StudioProgressMonitor monitor )
+    {
+        JNDIConnectionWrapper wrapper = connection.getJNDIConnectionWrapper();
+
+        SearchControls constraintSearch = new SearchControls();
+        constraintSearch.setSearchScope( SearchControls.OBJECT_SCOPE );
+        constraintSearch.setReturningAttributes( new String[]
+            { "+" } );
+
+        NamingEnumeration<SearchResult> answer = wrapper.search( "", "(objectclass=*)", constraintSearch,
+            DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, monitor );
+
+        if ( answer != null )
+        {
+            if ( answer.hasMoreElements() )
+            {
+                SearchResult searchResult = ( SearchResult ) answer.nextElement();
+
+                Attribute vendorNameAttribute = searchResult.getAttributes().get( "vendorName" );
+                if ( vendorNameAttribute == null )
+                {
+                    return false;
+                }
+
+                if ( vendorNameAttribute.size() != 1 )
+                {
+                    return false;
+                }
+
+                String vendorName = null;
+                try
+                {
+                    vendorName = ( String ) vendorNameAttribute.get();
+                }
+                catch ( NamingException e )
+                {
+                    return false;
+                }
+
+                return ( ( vendorName != null ) && vendorName.equalsIgnoreCase( "Apache Software Foundation" ) );
+            }
+        }
+
+        return false;
+    }
+
+
+    private static Schema getSchema( JNDIConnectionWrapper wrapper, String name, StudioProgressMonitor monitor )
+        throws NamingException
+    {
+        monitor.subTask( "Reading schema '" + name + "'" );
+
+        // Creating the schema
+        Schema schema = new SchemaImpl( name );
+
+        // Looking for the nodes of the schema
+        SearchControls constraintSearch = new SearchControls();
+        constraintSearch.setSearchScope( SearchControls.SUBTREE_SCOPE );
+
+        NamingEnumeration<SearchResult> answer = wrapper.search( "cn=" + name + ", ou=schema", "(objectclass=*)",
+            constraintSearch, DEREF_ALIAS_METHOD, HANDLE_REFERALS_METHOD, null, monitor );
+        if ( answer != null )
+        {
+            while ( answer.hasMoreElements() )
+            {
+                SearchResult searchResult = ( SearchResult ) answer.nextElement();
+                switch ( getNodeType( searchResult ) )
+                {
+                    case ATTRIBUTE_TYPE:
+                        AttributeTypeImpl at = createAttributeType( searchResult );
+                        at.setSchema( name );
+                        schema.addAttributeType( at );
+                        break;
+                    case OBJECT_CLASS:
+                        ObjectClassImpl oc = createObjectClass( searchResult );
+                        oc.setSchema( name );
+                        schema.addObjectClass( oc );
+                        break;
+                    case MATCHING_RULE:
+                        MatchingRuleImpl mr = createMatchingRule( searchResult );
+                        mr.setSchema( name );
+                        schema.addMatchingRule( mr );
+                        break;
+                    case SYNTAX:
+                        SyntaxImpl syntax = createSyntax( searchResult );
+                        syntax.setSchema( name );
+                        schema.addSyntax( syntax );
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+
+        return schema;
+    }
+
+
+    /**
+     * Gets the Type of node of the given SearchResult.
+     * 
+     * @param sr
+     *      the SearchResult to be identified
+     * @return
+     *      the Type of node
+     * @throws NamingException
+     *      if an error occurrs when reading the SearchResult
+     */
+    private static SchemaNodeTypes getNodeType( SearchResult sr ) throws NamingException
+    {
+        // Getting the 'ObjectClass' Attribute
+        Attribute objectClassAttribute = sr.getAttributes().get( "objectClass" );
+
+        // Looping on the values
+        NamingEnumeration<?> ne = objectClassAttribute.getAll();
+        while ( ne.hasMore() )
+        {
+            String value = ( String ) ne.next();
+            if ( META_ATTRIBUTE_TYPE.equals( value ) )
+            {
+                return SchemaNodeTypes.ATTRIBUTE_TYPE;
+            }
+            else if ( META_OBJECT_CLASS.equals( value ) )
+            {
+                return SchemaNodeTypes.OBJECT_CLASS;
+            }
+            else if ( META_MATCHING_RULE.equals( value ) )
+            {
+                return SchemaNodeTypes.MATCHING_RULE;
+            }
+            else if ( META_SYNTAX.equals( value ) )
+            {
+                return SchemaNodeTypes.SYNTAX;
+            }
+        }
+
+        return SchemaNodeTypes.UNKNOWN;
+    }
+
+
+    /**
+     * Create the AttributeTypeImpl associated with the given SearchResult.
+     * 
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the AttributeTypeImpl associated with the SearchResult, or null if no 
+     * AttributeTypeImpl could be created
+     * @throws NamingException 
+     */
+    private static AttributeTypeImpl createAttributeType( SearchResult sr ) throws NamingException
+    {
+        AttributeTypeImpl at = new AttributeTypeImpl( getOid( sr ) );
+        at.setNames( getNames( sr ) );
+        at.setDescription( getDescription( sr ) );
+        at.setObsolete( isObsolete( sr ) );
+        at.setSuperiorName( getSuperior( sr ) );
+        at.setUsage( getUsage( sr ) );
+        at.setSyntaxOid( getSyntax( sr ) );
+        at.setLength( getSyntaxLength( sr ) );
+        at.setCollective( isCollective( sr ) );
+        at.setSingleValue( isSingleValue( sr ) );
+        at.setCanUserModify( isCanUserModify( sr ) );
+        at.setEqualityName( getEquality( sr ) );
+        at.setOrderingName( getOrdering( sr ) );
+        at.setSubstrName( getSubstr( sr ) );
+        return at;
+    }
+
+
+    /**
+     * Create the ObjectClassImpl associated with the given SearchResult.
+     * 
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the ObjectClassImpl associated with the SearchResult, or null if no 
+     * ObjectClassImpl could be created
+     * @throws NamingException 
+     */
+    private static ObjectClassImpl createObjectClass( SearchResult sr ) throws NamingException
+    {
+        ObjectClassImpl oc = new ObjectClassImpl( getOid( sr ) );
+        oc.setNames( getNames( sr ) );
+        oc.setDescription( getDescription( sr ) );
+        oc.setObsolete( isObsolete( sr ) );
+        oc.setSuperClassesNames( getSuperiors( sr ) );
+        oc.setType( getType( sr ) );
+        oc.setMayNamesList( getMay( sr ) );
+        oc.setMustNamesList( getMust( sr ) );
+        return oc;
+    }
+
+
+    /**
+     * Create the MatchingRule associated with the given SearchResult.
+     * 
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the MatchingRule associated with the SearchResult, or null if no 
+     * ObjectClass could be created
+     * @throws NamingException 
+     */
+    private static MatchingRuleImpl createMatchingRule( SearchResult sr ) throws NamingException
+    {
+        MatchingRuleImpl mr = new MatchingRuleImpl( getOid( sr ) );
+        mr.setNames( getNames( sr ) );
+        mr.setDescription( getDescription( sr ) );
+        mr.setObsolete( isObsolete( sr ) );
+        mr.setSyntaxOid( getSyntax( sr ) );
+        return mr;
+    }
+
+
+    /**
+     * Create the MatchingRule associated with the given SearchResult.
+     * 
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the MatchingRule associated with the SearchResult, or null if no 
+     * ObjectClass could be created
+     * @throws NamingException 
+     */
+    private static SyntaxImpl createSyntax( SearchResult sr ) throws NamingException
+    {
+        SyntaxImpl syntax = new SyntaxImpl( getOid( sr ) );
+        syntax.setNames( getNames( sr ) );
+        syntax.setDescription( getDescription( sr ) );
+        syntax.setObsolete( isObsolete( sr ) );
+        syntax.setHumanReadable( isHumanReadable( sr ) );
+        return syntax;
+    }
+
+
+    /**
+     * Gets the oid of the schema object contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the oid of the schema object, or nullif no oid was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getOid( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-oid" );
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the names of the schema object contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the names of the schema object, or an empty array if no name was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String[] getNames( SearchResult sr ) throws NamingException
+    {
+        List<String> names = new ArrayList<String>();
+
+        Attribute at = sr.getAttributes().get( "m-name" );
+        if ( at != null )
+        {
+            NamingEnumeration<?> ne = at.getAll();
+            while ( ne.hasMore() )
+            {
+                names.add( ( String ) ne.next() );
+            }
+        }
+
+        return names.toArray( new String[0] );
+    }
+
+
+    /**
+     * Gets the description of the schema object contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the description of the schema object, or null if no description was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getDescription( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-description" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the superior of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the superior of the attribute type, or null if no superior was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getSuperior( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-supAttributeType" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the usage of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the usage of the attribute type
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static UsageEnum getUsage( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-usage" );
+
+        if ( at == null )
+        {
+            return UsageEnum.USER_APPLICATIONS;
+        }
+        else
+        {
+            try
+            {
+                return Enum.valueOf( UsageEnum.class, ( String ) at.get() );
+            }
+            catch ( IllegalArgumentException e )
+            {
+                return UsageEnum.USER_APPLICATIONS;
+            }
+            catch ( NullPointerException e )
+            {
+                return UsageEnum.USER_APPLICATIONS;
+            }
+        }
+    }
+
+
+    /**
+     * Gets the syntax of the schema object contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the syntax of the schema object, or null if no syntax was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getSyntax( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-syntax" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the syntax length of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the syntax length of the attribute type, or -1 if no syntax length was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static int getSyntaxLength( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-length" );
+
+        if ( at == null )
+        {
+            return -1;
+        }
+        else
+        {
+            try
+            {
+                return Integer.parseInt( ( String ) at.get() );
+            }
+            catch ( NumberFormatException e )
+            {
+                return -1;
+            }
+        }
+    }
+
+
+    /**
+     * Gets whether or not the schema object contained a SearchResult is obsolete.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      true if the schema object is obsolete, false if not
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static boolean isObsolete( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-obsolete" );
+
+        if ( at == null )
+        {
+            return false;
+        }
+        else
+        {
+            return Boolean.parseBoolean( ( String ) at.get() );
+        }
+    }
+
+
+    /**
+     * Gets whether or not the attribute type contained a SearchResult is collective.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      true if the attribute type is collective, false if not
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static boolean isCollective( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-collective" );
+
+        if ( at == null )
+        {
+            return false;
+        }
+        else
+        {
+            return Boolean.parseBoolean( ( String ) at.get() );
+        }
+    }
+
+
+    /**
+     * Gets whether or not the attribute type contained a SearchResult is single value.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      true if the attribute type is single value, false if not
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static boolean isSingleValue( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-singleValue" );
+
+        if ( at == null )
+        {
+            return false;
+        }
+        else
+        {
+            return Boolean.parseBoolean( ( String ) at.get() );
+        }
+    }
+
+
+    /**
+     * Gets whether or not the attribute type contained a SearchResult is single value.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      true if the attribute type is single value, false if not
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static boolean isCanUserModify( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-noUserModification" );
+
+        if ( at == null )
+        {
+            return true;
+        }
+        else
+        {
+            return !Boolean.parseBoolean( ( String ) at.get() );
+        }
+    }
+
+
+    /**
+     * Gets the name of the equality matching rule of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the name of the equality matching rule of the attribute type, or null if no equality matching rule was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getEquality( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-equality" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the name of the ordering matching rule of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the name of the ordering matching rule of the attribute type, or null if no ordering matching rule was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getOrdering( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-ordering" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the name of the substr matching rule of the attribute type contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the name of the substr matching rule of the attribute type, or null if no substr matching rule was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String getSubstr( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-substr" );
+
+        if ( at == null )
+        {
+            return null;
+        }
+        else
+        {
+            return ( String ) at.get();
+        }
+    }
+
+
+    /**
+     * Gets the superiors of the object class contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the superiors of the attribute type, or an empty array if no superior was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String[] getSuperiors( SearchResult sr ) throws NamingException
+    {
+        List<String> names = new ArrayList<String>();
+
+        Attribute at = sr.getAttributes().get( "m-supObjectClass" );
+        if ( at != null )
+        {
+            NamingEnumeration<?> ne = at.getAll();
+            while ( ne.hasMore() )
+            {
+                names.add( ( String ) ne.next() );
+            }
+        }
+
+        return names.toArray( new String[0] );
+    }
+
+
+    /**
+     * Gets the type of the object class contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the type of the object class
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static ObjectClassTypeEnum getType( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "m-typeObjectClass" );
+
+        if ( at == null )
+        {
+            return ObjectClassTypeEnum.STRUCTURAL;
+        }
+        else
+        {
+            try
+            {
+                return Enum.valueOf( ObjectClassTypeEnum.class, ( String ) at.get() );
+            }
+            catch ( IllegalArgumentException e )
+            {
+                return ObjectClassTypeEnum.STRUCTURAL;
+            }
+            catch ( NullPointerException e )
+            {
+                return ObjectClassTypeEnum.STRUCTURAL;
+            }
+        }
+    }
+
+
+    /**
+     * Gets the optional attribute types of the object class contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the optional attribute types of the attribute type, or an empty array if no optional attribute type was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String[] getMay( SearchResult sr ) throws NamingException
+    {
+        List<String> names = new ArrayList<String>();
+
+        Attribute at = sr.getAttributes().get( "m-may" );
+        if ( at != null )
+        {
+            NamingEnumeration<?> ne = at.getAll();
+            while ( ne.hasMore() )
+            {
+                names.add( ( String ) ne.next() );
+            }
+        }
+
+        return names.toArray( new String[0] );
+    }
+
+
+    /**
+     * Gets the mandatory attribute types of the object class contained a SearchResult.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      the mandatory attribute types of the attribute type, or an empty array if no mandatory attribute type was found
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static String[] getMust( SearchResult sr ) throws NamingException
+    {
+        List<String> names = new ArrayList<String>();
+
+        Attribute at = sr.getAttributes().get( "m-must" );
+        if ( at != null )
+        {
+            NamingEnumeration<?> ne = at.getAll();
+            while ( ne.hasMore() )
+            {
+                names.add( ( String ) ne.next() );
+            }
+        }
+
+        return names.toArray( new String[0] );
+    }
+
+
+    /**
+     * Gets whether or not the schema object contained a SearchResult is obsolete.
+     *
+     * @param sr
+     *      the SearchResult
+     * @return
+     *      true if the schema object is obsolete, false if not
+     * @throws NamingException
+     *      if an error occurrs when searching in the SearchResult
+     */
+    private static boolean isHumanReadable( SearchResult sr ) throws NamingException
+    {
+        Attribute at = sr.getAttributes().get( "x-humanReadable" );
+
+        if ( at == null )
+        {
+            return false;
+        }
+        else
+        {
+            return Boolean.parseBoolean( ( String ) at.get() );
+        }
+    }
+}

Propchange: directory/sandbox/felixk/studio-schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message