directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r543239 [8/37] - in /directory/sandbox/oersoy/das.testing/das.ldap.parent: ./ das.ldap.configuration.model.ecore.v100/ das.ldap.configuration.model.ecore.v100/.settings/ das.ldap.configuration.model.ecore.v100/model/ das.ldap.configuration....
Date Thu, 31 May 2007 19:58:38 GMT
Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMayAttributeTypeCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,52 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MComplexMayAttributeTypeCreator
+extends AbstractAttributeTypeCreator
+{
+    public MComplexMayAttributeTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        String  oidPrefix) 
+    throws NamingException, Exception
+    {
+        basicAttributes.put( M_DESCRIPTION, M_COMPLEX_MAY_DESCRIPTION);
+        basicAttributes.put( M_SYNTAX,      OID_SYNTAX_OID_VALUE );
+        basicAttributes.put( M_NAME,        M_COMPLEX_MAY );
+        
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix, 
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MAY);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MComplexMustAttributeTypeCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,52 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MComplexMustAttributeTypeCreator 
+extends AbstractAttributeTypeCreator 
+{
+    public MComplexMustAttributeTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        basicAttributes.put(M_DESCRIPTION, M_COMPLEX_MUST_DESCRIPTION);
+        basicAttributes.put(M_SYNTAX,      OID_SYNTAX_OID_VALUE );
+        basicAttributes.put(M_NAME,        M_COMPLEX_MUST);
+
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MUST);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/MetaTopSDOObjectClassCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,86 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+public class MetaTopSDOObjectClassCreator
+extends AbstractTypeCreator
+{
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param objectClassesContext the object classes context
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     * 
+     */
+    
+    public MetaTopSDOObjectClassCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        MComplexMayAttributeTypeCreator 
+        mComplexMayAttributeTypeCreator = 
+            new MComplexMayAttributeTypeCreator();
+        
+        mComplexMayAttributeTypeCreator.create( 
+            attributeTypesContext, 
+            oidPrefix );
+
+        MComplexMustAttributeTypeCreator 
+        mComplexMustAttributeTypeCreator = 
+            new MComplexMustAttributeTypeCreator();
+        
+        mComplexMustAttributeTypeCreator.create( 
+            attributeTypesContext, 
+            oidPrefix );
+
+        objectClassAttribute.add( 
+            META_OBJECT_CLASS );
+        
+        basicAttributes.put( M_MAY,               M_COMPLEX_MAY);
+        basicAttributes.put( M_MAY,               M_COMPLEX_MUST);
+        basicAttributes.put( M_SUP_OBJECT_CLASS,  META_OBJECT_CLASS );
+        basicAttributes.put( M_TYPE_OBJECT_CLASS, STRUCTURAL);
+        basicAttributes.put( M_NAME,              M_META_TOP_SDO_OBJECT_CLASS);
+        basicAttributes.put( M_DESCRIPTION,      
+            "Meta ObjectClass for all SDO DataObjects" );
+        
+        String rdn = 
+            ComplexTypeRDNCreator.create( 
+                oidPrefix,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS);
+
+        objectClassesContext.createSubcontext(
+            rdn, basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SimpleTypeRDNCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,63 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import org.apache.tuscany.das.ldap.oid.create.SimpleTypeOIDCreator;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+
+/**
+ * The Class DataTypeRDNCreator.
+ */
+public class SimpleTypeRDNCreator
+implements SchemaAttributeTypeConstants
+{
+    
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param namespaceURI the namespace URI
+     * @param complexTypeName the name
+     * @param simpleTypeName the simple type name
+     * 
+     * @return the string
+     * 
+     * @throws Exception the exception
+     */
+    public static String create(
+        String oidPrefix,
+        String namespaceURI,
+        String complexTypeName,
+        String simpleTypeName)
+    throws Exception
+    {
+        String oid = 
+            SimpleTypeOIDCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                complexTypeName,
+                simpleTypeName);
+        
+        String rdn = 
+            M_OID + "="  + oid;
+        
+        return rdn;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/create/SyntaxEntryCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,111 @@
+/*
+ *  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.tuscany.das.ldap.schema.create;
+
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.BasicAttribute;
+import javax.naming.directory.BasicAttributes;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier;
+
+/**
+ * The Class SyntaxEntryCreator.
+ */
+public class SyntaxEntryCreator 
+implements 
+AttributeTypeConstants,
+SchemaAttributeTypeConstants,
+ObjectClassConstants,
+SchemaObjectClassConstants
+{
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param namespaceURI the namespace URI
+     * @param dataTypeName the name of the DataType
+     * @param syntaxesContext the directory context
+     * 
+     * @throws Exception the exception
+     */
+    public static void create(
+        String oidPrefix,
+        String namespaceURI,
+        String dataTypeName,
+        DirContext syntaxesContext) 
+    throws Exception
+    {
+        String syntaxDescription =
+            ComplexTypeNamespaceQualifier.qualify(namespaceURI, dataTypeName);
+        
+        String rdn = 
+            ComplexTypeRDNCreator.
+            create( 
+                oidPrefix,
+                namespaceURI,
+                dataTypeName);
+
+        Attributes attributes = 
+            prepareSyntaxAttributes( 
+                syntaxDescription );
+        
+        //TODO Put back in when bug gets resolved.
+        //attributes.put(M_NAME, name );
+        //attributes.put("x-humandReadible", "false");
+        //attributes.put("m-obsolete, "false");
+        syntaxesContext.createSubcontext(
+            rdn, 
+            attributes);
+    }
+
+    /**
+     * TODO - Move to helper
+     * Prepare syntax attributes.
+     * 
+     * @param syntaxDescription the syntax description
+     * 
+     * @return the attributes
+     */
+    public static Attributes prepareSyntaxAttributes(
+        String syntaxDescription)
+    {
+        Attribute objectClassAttribute = new BasicAttribute(
+            OBJECT_CLASS, TOP);
+        objectClassAttribute.add( META_TOP );
+        objectClassAttribute.add( META_SYNTAX );
+        
+        Attribute descriptionAttribute = new BasicAttribute(
+            M_DESCRIPTION, 
+            syntaxDescription);
+        
+        Attributes attributes = new BasicAttributes();
+        
+        attributes.put( objectClassAttribute );
+        attributes.put( descriptionAttribute );
+
+        return attributes;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMayAttributeTypeDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,46 @@
+/*
+ *  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.tuscany.das.ldap.schema.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+
+public class MComplexMayAttributeTypeDestroyer
+implements DASConstants
+{
+    public static void destroy(
+        DirContext attributeTypesContext,
+        String  oidPrefix) 
+    throws NamingException, Exception
+    {
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix, 
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MAY);
+        
+        attributeTypesContext.destroySubcontext(
+            rdn);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MComplexMustAttributeTypeDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,46 @@
+/*
+ *  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.tuscany.das.ldap.schema.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+
+public class MComplexMustAttributeTypeDestroyer
+implements DASConstants
+{
+    public static void destroy(
+        DirContext attributeTypesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS,
+                M_COMPLEX_MUST);
+        
+        attributeTypesContext.destroySubcontext(
+            rdn);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/MetaTopSDOObjectClassDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,63 @@
+/*
+ *  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.tuscany.das.ldap.schema.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+
+public class MetaTopSDOObjectClassDestroyer
+implements 
+AttributeTypeConstants,
+SchemaAttributeTypeConstants,
+ObjectClassConstants,
+SchemaObjectClassConstants, 
+DASConstants
+{
+    public static void destroy(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        String rdn = 
+            ComplexTypeRDNCreator.create( 
+                oidPrefix, 
+                DAS_XSD_NAMESPACE,
+                M_META_TOP_SDO_OBJECT_CLASS);
+        
+        objectClassesContext.destroySubcontext(
+            rdn);
+
+        MComplexMayAttributeTypeDestroyer.destroy( 
+            attributeTypesContext, 
+            oidPrefix );
+        
+        MComplexMustAttributeTypeDestroyer.destroy( 
+            attributeTypesContext, 
+            oidPrefix );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/destroy/SyntaxEntryDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,56 @@
+/*
+ *  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.tuscany.das.ldap.schema.destroy;
+
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+
+/**
+ * The Class SyntaxEntryCreator.
+ */
+public class SyntaxEntryDestroyer 
+{
+    /**
+     * Destroy.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param namespaceURI the namespace URI
+     * @param simpleTypeName the name
+     * @param directoryContext the directory context
+     * 
+     * @throws Exception the exception
+     */
+    public static void destroy(
+        String oidPrefix,
+        String namespaceURI,
+        String simpleTypeName,
+        DirContext directoryContext) 
+    throws Exception
+    {
+        String rdn = null;
+        rdn = ComplexTypeRDNCreator.create( 
+            oidPrefix, 
+            namespaceURI, 
+            simpleTypeName );
+        
+        directoryContext.destroySubcontext(rdn);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EAttributeTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EAttributeTypeCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EAttributeTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EAttributeTypeCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,111 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.oid.create.ComplexTypeOIDCreator;
+import org.apache.tuscany.das.ldap.schema.create.AbstractAttributeTypeCreator;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+
+public class EAttributeTypeCreator
+extends AbstractAttributeTypeCreator
+{
+    public EAttributeTypeCreator()
+    {
+        super();
+    }
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param eAttribute the e attribute
+     * @param attributeTypesContext the attribute types context
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     */
+    public void create(
+        DirContext attributeTypesContext,
+        EAttribute eAttribute,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        String eAttributeName             = 
+            eAttribute.getName();
+        
+        EClass eContainingClass           = 
+            eAttribute.getEContainingClass();
+        
+        String eContainingClassName       = 
+            eContainingClass.getName();
+        
+        String namespaceURI               = 
+            eContainingClass.getEPackage().getNsURI();
+
+        String qualifiedEAttributeNameURI = 
+            SimpleTypeNamespaceQualifier.qualify(
+                namespaceURI, 
+                eContainingClassName,
+                eAttributeName);
+        
+        EClassifier eDataType             = 
+            eAttribute.getEType();
+        
+        String eDatatypeName              = 
+            eDataType.getName();
+        
+        String eDataTypeNamespaceURI      = 
+            eDataType.getEPackage().getNsURI(); 
+        
+        String syntaxOID                  = 
+            ComplexTypeOIDCreator.create( 
+            oidPrefix,
+            eDataTypeNamespaceURI,
+            eDatatypeName);
+        
+        basicAttributes.put( 
+            M_DESCRIPTION, 
+            eAttributeName);
+        
+        basicAttributes.put( 
+            M_SYNTAX,      
+            syntaxOID);
+        
+        basicAttributes.put( 
+            M_NAME,        
+            qualifiedEAttributeNameURI );
+
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                eContainingClassName,
+                eAttributeName);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, 
+            basicAttributes);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,128 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.create.AbstractTypeCreator;
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EClass;
+
+public class EObjectClassCreator
+extends AbstractTypeCreator
+{
+    public EObjectClassCreator()
+    {
+        super();
+    }
+    /**
+     * Create.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param eAttribute the e attribute
+     * @param attributeTypesContext the attribute types context
+     * 
+     * @throws Exception the exception  
+     * @throws NamingException the naming exception
+     */
+    public void create(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        EClass eClass,
+        String oidPrefix)
+    throws NamingException, Exception
+    {
+        objectClassAttribute.add( META_OBJECT_CLASS );
+        objectClassAttribute.add( M_META_TOP_SDO_OBJECT_CLASS );
+
+        EcoreTypeSystemHelper.
+        createAttributeTypes( 
+            attributeTypesContext, 
+            eClass, 
+            oidPrefix );
+        
+        String namespaceURI     = 
+            eClass.getEPackage().
+            getNsURI();
+        
+        String qualifiedEClassNameURI = 
+            ComplexTypeNamespaceQualifier.
+            qualify(
+                namespaceURI, 
+                eClass.getName());
+
+        basicAttributes.put( 
+            M_NAME, 
+            qualifiedEClassNameURI );
+
+        basicAttributes.put( 
+            M_DESCRIPTION, 
+            eClass.getName() );
+        
+        basicAttributes.put( 
+            M_OBSOLETE, 
+            LDAP_FALSE );
+
+        //TODO Remember to test with parent combination.
+        EObjectClassCreatorHelper.
+        addParentAttribute( 
+            basicAttributes, 
+            namespaceURI, 
+            eClass );
+
+        if (!eClass.isAbstract())
+        {
+            basicAttributes.put( 
+                M_TYPE_OBJECT_CLASS, 
+                STRUCTURAL );
+        }
+        else
+        {
+            basicAttributes.put( 
+                M_TYPE_OBJECT_CLASS, 
+                ABSTRACT );
+        }
+
+        EObjectClassCreatorHelper.
+        addEAttributes( 
+            basicAttributes, 
+            namespaceURI, 
+            eClass );
+        
+        EObjectClassCreatorHelper.
+        addEReferences( 
+            basicAttributes, 
+            namespaceURI, 
+            eClass );
+ 
+        String rdn = 
+            ComplexTypeRDNCreator.
+            create( 
+                oidPrefix,
+                namespaceURI,
+                eClass.getName());
+        
+        objectClassesContext.
+        createSubcontext(
+            rdn, 
+            basicAttributes );
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreatorHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreatorHelper.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreatorHelper.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EObjectClassCreatorHelper.java Thu May 31 12:58:13 2007
@@ -0,0 +1,163 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.directory.Attributes;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.constants.AttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.EnumeratedSchemaAttributeTypeValues;
+import org.apache.tuscany.das.ldap.schema.constants.ObjectClassConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaAttributeTypeConstants;
+import org.apache.tuscany.das.ldap.schema.constants.SchemaObjectClassConstants;
+import org.apache.tuscany.das.ldap.util.ComplexTypeNamespaceQualifier;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+
+public class EObjectClassCreatorHelper
+implements 
+EnumeratedSchemaAttributeTypeValues,
+SchemaAttributeTypeConstants,
+AttributeTypeConstants,
+SchemaObjectClassConstants,
+ObjectClassConstants,
+DASConstants
+{
+    public static void addParentAttribute(
+        Attributes objectClassAttributes,
+        String namespaceURI,
+        EClass eClass)
+    {
+        EClass eClassParent     = 
+            EcoreTypeSystemHelper.
+            getEClassParent( eClass );
+
+        if(eClassParent !=null)
+        {
+            String qualifiedEClassParentNameURI = 
+                ComplexTypeNamespaceQualifier.
+                qualify(
+                    namespaceURI, 
+                    eClassParent.
+                    getName());
+
+            objectClassAttributes.put( 
+                M_SUP_OBJECT_CLASS, 
+                qualifiedEClassParentNameURI);
+        }
+        else
+        {
+            objectClassAttributes.put( 
+                M_SUP_OBJECT_CLASS, 
+                TOP);
+        }
+    }
+    
+    public static void addEAttributes(
+        Attributes objectClassAttributes,
+        String namespaceURI,
+        EClass eClass)
+    {
+        List<EAttribute> eAttributes =
+            eClass.getEAttributes();
+        
+        Iterator<EAttribute> eAttributeIterator  =
+            eAttributes.iterator();
+        
+        EAttribute eAttribute          = 
+            null;
+        
+        String qualifiedEAttributeName = 
+            null;
+        
+        while( eAttributeIterator.hasNext())
+        {
+            eAttribute = eAttributeIterator.next();
+
+            qualifiedEAttributeName = 
+                SimpleTypeNamespaceQualifier.
+                qualify(
+                    namespaceURI,
+                    eClass.getName(),
+                    eAttribute.getName());
+            
+            if (!eAttribute.isRequired())
+            {
+                objectClassAttributes.put( 
+                    M_MAY,
+                    qualifiedEAttributeName);
+            }
+            else
+            {
+                objectClassAttributes.put( 
+                    M_MUST, 
+                    qualifiedEAttributeName);
+            }
+        }
+
+    }
+    
+    public static void addEReferences(
+        Attributes objectClassAttributes,
+        String namespaceURI,
+        EClass eClass)
+    {
+        List<EReference> eReferences            = 
+            eClass.getEReferences();
+        
+        Iterator<EReference> eReferenceIterator =
+            eReferences.iterator();
+        
+        EReference eReference          = 
+            null;
+        
+        String qualifiedEReferenceName = 
+            null;
+        
+        while ( eReferenceIterator.hasNext())
+        {
+            eReference = eReferenceIterator.next();
+
+            qualifiedEReferenceName    = 
+                SimpleTypeNamespaceQualifier.
+                qualify(
+                    namespaceURI,
+                    eClass.getName(),
+                    eReference.getName());
+            
+            if (!eReference.isRequired())
+            {
+                objectClassAttributes.put( 
+                    M_MAY,
+                    qualifiedEReferenceName);
+            }
+            else
+            {
+                objectClassAttributes.put( 
+                    M_MUST, 
+                    qualifiedEReferenceName);
+            }
+        }
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EReferenceTypeCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EReferenceTypeCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EReferenceTypeCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EReferenceTypeCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,90 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.constants.DASConstants;
+import org.apache.tuscany.das.ldap.schema.create.AbstractAttributeTypeCreator;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
+
+public class EReferenceTypeCreator
+extends AbstractAttributeTypeCreator
+implements DASConstants
+{
+    public EReferenceTypeCreator()
+    {
+        super();
+    }
+    
+    public void create(
+        DirContext attributeTypesContext,
+        EReference eReference,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        String eReferenceName             = 
+            eReference.getName();
+        
+        EClass eContainingClass           = 
+            eReference.getEContainingClass();
+        
+        String eContainingClassName       = 
+            eContainingClass.getName();
+        
+        String namespaceURI               = 
+            eContainingClass.
+            getEPackage().
+            getNsURI();
+
+        String qualifiedEReferenceNameURI = 
+            SimpleTypeNamespaceQualifier.qualify(
+                namespaceURI, 
+                eContainingClassName,
+                eReferenceName);
+
+        
+        basicAttributes.put( 
+            M_DESCRIPTION, 
+            eReferenceName);
+        
+        basicAttributes.put( 
+            M_SYNTAX,      
+            DISTINGUISHED_NAME_SYNTAX_OID_VALUE);
+        
+        basicAttributes.put( 
+            M_NAME,        
+            qualifiedEReferenceNameURI );
+
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                eContainingClassName,
+                eReferenceName);
+        
+        attributeTypesContext.createSubcontext(
+            rdn, 
+            basicAttributes);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreModelTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreModelTypeSystemCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreModelTypeSystemCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreModelTypeSystemCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,91 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.directory.DirContext; 
+
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EPackage;
+
+public class EcoreModelTypeSystemCreator
+{
+    private List<EClass> processedEClassifiers = 
+        new ArrayList<EClass>();
+    
+    public boolean isEClassProcessed(EClass eClass)
+    {
+        return processedEClassifiers.contains( eClass );
+    }
+    
+    public static void create(
+        DirContext syntaxesContext,
+        DirContext attributeTypesContext,
+        EPackage ePackage,
+        String oidPrefix)
+    throws Exception
+    {
+        List<EDataType> eDataTypes            = 
+            EcoreTypeSystemHelper.
+            createEDataTypesList(ePackage);
+        
+        EcoreTypeSystemHelper.
+            createEDataTypeEntries( 
+                eDataTypes, 
+                oidPrefix, 
+                syntaxesContext );
+        
+        List<EClass> eClassifiers = 
+            EcoreTypeSystemHelper.
+            createEClassifiersList( ePackage );
+        
+        Iterator<EClass> eClassIterator = 
+            eClassifiers.iterator();
+
+        
+        while (eClassIterator.hasNext())
+        {
+            EClass eClass = eClassIterator.next();
+            
+            
+            
+            
+            
+            List<EAttribute> eAttributes = 
+                eClass.getEAllAttributes();
+            
+        }
+    }
+    
+    public static boolean createParent(EClass eClass)
+    {
+        return false;
+    }
+    
+    public static boolean isParentCreated(EClass eClass)
+    {
+        return false;
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemCreator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemCreator.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemCreator.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemCreator.java Thu May 31 12:58:13 2007
@@ -0,0 +1,50 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import java.util.List;
+
+import javax.naming.directory.DirContext;
+
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EcorePackage;
+
+public class EcoreTypeSystemCreator
+{
+    private static 
+    EcorePackage ecorePackage = 
+        EcorePackage.eINSTANCE;
+    
+    public static void create(
+        DirContext syntaxesContext,
+        String oidPrefix) throws Exception
+    {
+        List<EDataType> eDataTypes            = 
+            EcoreTypeSystemHelper.
+            createEDataTypesList(
+                ecorePackage);
+        
+        EcoreTypeSystemHelper.
+        createEDataTypeEntries(
+            eDataTypes, 
+            oidPrefix, 
+            syntaxesContext);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemHelper.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemHelper.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemHelper.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/create/EcoreTypeSystemHelper.java Thu May 31 12:58:13 2007
@@ -0,0 +1,374 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.create;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.create.SyntaxEntryCreator;
+import org.apache.tuscany.das.ldap.schema.emf.destroy.EStructuralFeatureTypeDestroyer;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+/**
+ * The Class EcoreTypeSystemCreatorHelper.
+ */
+public class EcoreTypeSystemHelper
+{
+    
+    /**
+     * Creates the E data types list.
+     * 
+     * @param ePackage the e package
+     * 
+     * @return the list< E data type>
+     */
+    public static List<EDataType> createEDataTypesList(
+        EPackage ePackage)
+    {
+        List<EObject> list         = ePackage.eContents();
+        List<EDataType> eDataTypes = new ArrayList<EDataType>();
+        Iterator<EObject> iterator = list.iterator();
+        while (iterator.hasNext())
+        {
+            Object object = iterator.next();
+            if (object instanceof EDataType )
+            {
+                eDataTypes.add( ( EDataType ) object );
+            }
+        }
+        return eDataTypes;
+    }
+    
+    /**
+     * Creates the E data type entries.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param eDataTypes the e data types
+     * @param syntaxesContext the syntaxes context
+     * 
+     * @throws Exception the exception
+     */
+    public static void createEDataTypeEntries(
+        List<EDataType> eDataTypes,
+        String oidPrefix,
+        DirContext syntaxesContext) throws Exception
+    {
+        Iterator<EDataType> eDataTypeIterator = 
+            eDataTypes.iterator();                          
+
+        String eDataTypeName                  = 
+            null;
+        String eDataTypeNamespaceURI          = 
+            null;
+        
+        while (eDataTypeIterator.hasNext())
+        {
+            EDataType eDataType        = 
+                eDataTypeIterator.next();
+            eDataTypeName              = 
+                eDataType.getName();
+            eDataTypeNamespaceURI      = 
+                eDataType.getEPackage().getNsURI();
+            
+            SyntaxEntryCreator.create( 
+                oidPrefix,
+                eDataTypeNamespaceURI,
+                eDataTypeName, 
+                syntaxesContext );
+        }
+    }
+
+    /**
+     * Creates the E classifiers list.
+     * 
+     * @param ePackage the e package
+     * 
+     * @return the list< E class>
+     */
+    public static List<EClass> createEClassifiersList(
+        EPackage ePackage)
+    {
+        List<EObject> list         = ePackage.eContents();
+        List<EClass> eClassifiers  = new ArrayList<EClass>();
+        Iterator<EObject> iterator = list.iterator();
+        while (iterator.hasNext())
+        {
+            Object object = iterator.next();
+            if (object instanceof EClassifier )
+            {
+                eClassifiers.add( ( EClass ) object );
+            }
+        }
+        return eClassifiers;
+    }
+    
+    /**
+     * Creates the E classifier entries.
+     * 
+     * @param eClassifiers the e classifiers
+     */
+    public static void createEClassifierEntries(
+        List<EClass> eClassifiers)
+    {
+        
+    }
+
+    /**
+     * Load parent E classifier stack.
+     * 
+     * @param parentEClassifierStack the parent E classifier stack
+     * @param eClass the e class
+     * 
+     * @return the stack< E class>
+     * 
+     * Note that clients should pass null for the
+     * parentEClassifierStack argument.  The method
+     * creates the stack when needed, and uses
+     * it during recursion.
+     */
+    public static Stack<EClass> loadParentEClassifierStack(
+        EClass eClass, 
+        Stack<EClass> parentEClassifierStack)
+    {
+        List<EClass> eClassParents   = 
+            eClass.getESuperTypes();
+        
+        if (eClassParents.size() > 0)
+        {
+            Iterator<EClass> eClassParentIterator = 
+                eClassParents.iterator();
+            
+            while(eClassParentIterator.hasNext())
+            {
+                EClass parentEClass = 
+                    eClassParentIterator.next();
+                
+                if (!parentEClass.isInterface())
+                {
+                    if (parentEClassifierStack == null)
+                    {
+                        parentEClassifierStack = new Stack<EClass>();
+                    }
+
+                    parentEClassifierStack.push( parentEClass );
+                    
+                    eClassParents = parentEClass.getESuperTypes();
+                    
+                    if (eClassParents.size() == 0)
+                    {
+                        return parentEClassifierStack;
+                    }
+                    else
+                    {
+                        loadParentEClassifierStack( 
+                            parentEClass, 
+                            parentEClassifierStack );
+                    }
+                }
+            }
+        }
+        return parentEClassifierStack;            
+    }
+    
+    /**
+     * Creates the E object class parents.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param objectClassesContext the object classes context
+     * @param eClass the e class
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     */
+    public static void createEObjectClassParents(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        EClass eClass,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        Stack<EClass> parentEClassifierStack = 
+            EcoreTypeSystemHelper.
+            loadParentEClassifierStack( 
+                eClass, 
+                null);
+        
+        EClass parentEClass = null;
+        
+        for (int i=0; i<parentEClassifierStack.size(); i++)            
+        {
+            parentEClass = parentEClassifierStack.pop();
+            
+            EObjectClassCreator
+            eObjectClassCreator =
+                new EObjectClassCreator();
+            
+            eObjectClassCreator.create(
+                attributeTypesContext,
+                objectClassesContext,
+                parentEClass, 
+                oidPrefix);
+        }
+    }
+    
+    /**
+     * Creates the attribute types.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param eClass the e class
+     * @param attributeTypesContext the attribute types context
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     */
+    public static void createAttributeTypes(
+        DirContext attributeTypesContext,
+        EClass eClass,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        List<EAttribute> eAttributes            = 
+            eClass.getEAttributes();
+
+        Iterator<EAttribute> eAttributeIterator = 
+            eAttributes.iterator();
+        
+        while (eAttributeIterator.hasNext())
+        {
+            EAttribute eAttribute = eAttributeIterator.next();
+            
+            EAttributeTypeCreator
+            eAttributeTypeCreator =
+                new EAttributeTypeCreator();
+            
+            eAttributeTypeCreator.create( 
+                attributeTypesContext, 
+                eAttribute, 
+                oidPrefix );
+        }
+        
+        List<EReference> eReferences            = 
+            eClass.getEReferences();
+
+        Iterator<EReference> eReferenceIterator = 
+            eReferences.iterator();
+        
+        while(eReferenceIterator.hasNext())
+        {
+            EReference eReference = 
+                eReferenceIterator.
+                next();
+            
+            EReferenceTypeCreator
+            eReferenceTypeCreator =
+                new EReferenceTypeCreator();
+            
+            eReferenceTypeCreator.create(
+                attributeTypesContext,
+                eReference,
+                oidPrefix);
+        }
+    }
+    
+    /**
+     * Destroy attribute types.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param eClass the e class
+     * @param attributeTypesContext the attribute types context
+     * 
+     * @throws Exception the exception
+     * @throws NamingException the naming exception
+     */
+    public static void destroyAttributeTypes(
+        DirContext attributeTypesContext,
+        EClass eClass,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        List<EStructuralFeature> 
+        eStructuralFeatures                = 
+            eClass.
+            getEStructuralFeatures();
+
+        Iterator<EStructuralFeature> 
+        eStructuralFeatureIterator         = 
+            eStructuralFeatures.iterator();
+        
+        while (eStructuralFeatureIterator.hasNext())
+        {
+            EStructuralFeature 
+            eStructuralFeature             = 
+                eStructuralFeatureIterator.next();
+            
+            EStructuralFeatureTypeDestroyer.destroy( 
+                attributeTypesContext, 
+                eStructuralFeature, 
+                oidPrefix );
+        }
+    }
+    
+    /**
+     * Gets the E class parent.
+     * 
+     * @param eClass the e class
+     * 
+     * @return the e class parent
+     */
+    public static EClass getEClassParent(EClass eClass)
+    {
+        List<EClass> eClassParents   = 
+            eClass.getESuperTypes();
+        
+        if (eClassParents.size() > 0)
+        {
+            Iterator<EClass> eClassParentIterator = 
+                eClassParents.iterator();
+            
+            while(eClassParentIterator.hasNext())
+            {
+                EClass parentEClass = 
+                    eClassParentIterator.next();
+                
+                if (!parentEClass.isInterface())
+                {
+                    return parentEClass;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        return null;
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EObjectClassDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EObjectClassDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EObjectClassDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EObjectClassDestroyer.java Thu May 31 12:58:13 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.tuscany.das.ldap.schema.emf.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.create.ComplexTypeRDNCreator;
+import org.apache.tuscany.das.ldap.schema.emf.create.EcoreTypeSystemHelper;
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ * The Class EObjectClassDestroyer.
+ */
+public class EObjectClassDestroyer
+{
+    public static void destroy(
+        DirContext attributeTypesContext,
+        DirContext objectClassesContext,
+        EClass eClass,
+        String oidPrefix) 
+    throws NamingException, Exception
+    {
+        String namespaceURI     = 
+            eClass.getEPackage().
+            getNsURI();
+ 
+        EcoreTypeSystemHelper.
+        destroyAttributeTypes( 
+            attributeTypesContext, 
+            eClass, 
+            oidPrefix ); 
+ 
+        String rdn = 
+            ComplexTypeRDNCreator.create( 
+                oidPrefix,
+                eClass.getName(),
+                namespaceURI);
+        
+        objectClassesContext.destroySubcontext(
+            rdn);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EStructuralFeatureTypeDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EStructuralFeatureTypeDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EStructuralFeatureTypeDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EStructuralFeatureTypeDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,61 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.destroy;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.create.AbstractAttributeTypeCreator;
+import org.apache.tuscany.das.ldap.schema.create.SimpleTypeRDNCreator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EStructuralFeature;
+
+public class EStructuralFeatureTypeDestroyer
+extends AbstractAttributeTypeCreator
+{
+    public static void destroy(
+        DirContext attributeTypesContext,
+        EStructuralFeature eStructuralFeature,
+        String oidPrefix)
+    throws NamingException, Exception
+    {
+        EClass eContainingClass     =
+            eStructuralFeature.
+            getEContainingClass();
+        
+        String eContainingClassName = 
+            eContainingClass.
+            getName();
+        
+        String namespaceURI         = 
+            eContainingClass.
+            getEPackage().
+            getNsURI();
+
+        String rdn = 
+            SimpleTypeRDNCreator.create( 
+                oidPrefix,
+                namespaceURI,
+                eContainingClassName,
+                eStructuralFeature.getName());
+        
+        attributeTypesContext.destroySubcontext(
+            rdn);
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EcoreTypeSystemDestroyer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EcoreTypeSystemDestroyer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EcoreTypeSystemDestroyer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/destroy/EcoreTypeSystemDestroyer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,78 @@
+/*
+ *  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.tuscany.das.ldap.schema.emf.destroy;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.naming.directory.DirContext;
+
+import org.apache.tuscany.das.ldap.schema.destroy.SyntaxEntryDestroyer;
+import org.apache.tuscany.das.ldap.schema.emf.create.EcoreTypeSystemHelper;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EcorePackage;
+
+public class EcoreTypeSystemDestroyer
+{
+
+    private static EcorePackage ecorePackage = 
+        EcorePackage.eINSTANCE;
+
+    /**
+     * Destroy.
+     * 
+     * @param oidPrefix the oid prefix
+     * @param syntaxesContext the syntaxes context
+     * 
+     * @throws Exception the exception
+     */
+    public static void destroy(
+        DirContext syntaxesContext,
+        String oidPrefix) throws Exception
+    {
+        List<EDataType> eDataTypes   = 
+            EcoreTypeSystemHelper.
+            createEDataTypesList(ecorePackage);
+        
+        Iterator<EDataType> eDataTypeIterator = eDataTypes.iterator();                          
+
+        EDataType eDataType          = null;
+        String eDataTypeName         = null;
+        String eDataTypeNamespaceURI = null;
+        
+        while (eDataTypeIterator.hasNext())
+        {
+            eDataType             = 
+                eDataTypeIterator.next();
+            
+            eDataTypeName         = 
+                eDataType.getName();
+            
+            eDataTypeNamespaceURI = 
+                eDataType.getEPackage().getNsURI();
+            
+            SyntaxEntryDestroyer.destroy(
+                oidPrefix,
+                eDataTypeNamespaceURI,
+                eDataTypeName, 
+                syntaxesContext);
+        }
+    }
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/util/EAttributeNamespaceQualifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/util/EAttributeNamespaceQualifier.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/util/EAttributeNamespaceQualifier.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/schema/emf/util/EAttributeNamespaceQualifier.java Thu May 31 12:58:13 2007
@@ -0,0 +1,16 @@
+
+package org.apache.tuscany.das.ldap.schema.emf.util;
+
+import org.apache.tuscany.das.ldap.util.SimpleTypeNamespaceQualifier;
+import org.eclipse.emf.ecore.EAttribute;
+
+public class EAttributeNamespaceQualifier
+{
+//TODO - Finish if this starts looking useful...
+    public static String qualify(EAttribute eAttribute)
+    {
+        
+        SimpleTypeNamespaceQualifier a;
+        return null;   
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/ComplexTypeNamespaceQualifier.java Thu May 31 12:58:13 2007
@@ -0,0 +1,39 @@
+/*
+ *  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.tuscany.das.ldap.util;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DataTypeNamespaceQualifier.
+ */
+public class ComplexTypeNamespaceQualifier
+{
+    /**
+     * Qualify.
+     * 
+     * @param namespaceURI the namespace URI
+     * @param complexTypeName the name
+     * 
+     * @return the string
+     */
+    public static String qualify(String namespaceURI, String complexTypeName )
+    {
+        return namespaceURI + "/" + complexTypeName;
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/JNDIUtil.java Thu May 31 12:58:13 2007
@@ -0,0 +1,168 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+
+/**
+ * The Class JNDIUtil.
+ */
+public class JNDIUtil
+{
+    /**
+     * Calculate DN components.
+     * 
+     * @param context the context
+     * 
+     * @return the string[] containing the components of the DN
+     * 
+     * @throws NamingException the naming exception
+     */
+    public static String[] calculateDNComponents(
+        DirContext context) 
+    throws NamingException
+    {
+        String contextDN                  = 
+            context.getNameInNamespace();
+        
+        String[] initialContextComponents = 
+            contextDN.split( "[,]" );
+
+        return initialContextComponents;
+    }
+
+    
+    /**
+     * Calculate DN components.
+     * 
+     * @param contextDN the context DN
+     * 
+     * @return the string[] containing the components of the DN
+     * 
+     * @throws NamingException the naming exception
+     */
+    public static String[] calculateDNComponents(
+        String contextDN) 
+    throws NamingException
+    {
+        String[] initialContextComponents = 
+            contextDN.split( "[,]" );
+
+        return initialContextComponents;
+    }
+    
+    /**
+     * Gets the parent context.
+     * 
+     * @param partitionContext the partition context
+     * @param childContext the child context
+     * 
+     * @return the parent context (Null if the child context is the root)
+     * 
+     * @throws NamingException the naming exception
+     */
+    public static DirContext getParentContext(
+        DirContext childContext, 
+        DirContext partitionContext) 
+    throws NamingException
+    {
+        String[] childContextDNComponents = 
+            calculateDNComponents( childContext );
+        
+        String[] partitionDNComponents    = 
+            calculateDNComponents( partitionContext );
+        
+        DirContext parentContext          = null; 
+        
+        if (childContextDNComponents.length == partitionDNComponents.length)
+        {
+            return null;
+        }
+        else if ( (childContextDNComponents.length - 1) == partitionDNComponents.length)
+        {
+            return partitionContext;
+        }
+        else
+        {
+            String parentLookupDN = 
+                calculateParentRelativeDN( 
+                    childContext, partitionContext.getNameInNamespace() );
+            
+            
+            
+            parentContext = 
+                ( DirContext ) partitionContext.lookup( parentLookupDN );
+        }
+        return parentContext;
+    }
+
+    
+    /**
+     * Calculate parent relative DN.
+     * The parent relative DN is the
+     * DN of the parent context, relative
+     * to the partition context.
+     * 
+     * So if the partition context is
+     * <i>ou=system</i> and
+     * the child context has DN
+     * <i>cn=accounts, cn=users, cn=example, ou=system</i>
+     * 
+     * then the parent relative DN is
+     * <i>cn=users, cn=example</i>
+     * 
+     * @param childContext the child context
+     * @param partitionDN the partition DN
+     * 
+     * @return the string
+     * 
+     * @throws NamingException the naming exception
+     */
+    public static String calculateParentRelativeDN(
+        DirContext childContext, 
+        String partitionDN) 
+    throws NamingException
+    {
+        String parentRelativeDN           = null;
+        
+        String[] childContextDNComponents = 
+            calculateDNComponents( childContext );
+        
+        String[] partitionDNComponents    = 
+            calculateDNComponents( partitionDN );
+        
+        if (childContextDNComponents.length == 
+            partitionDNComponents.length)
+        {
+            return null;
+        }
+        else if (childContextDNComponents.length ==
+             partitionDNComponents.length + 1)
+        {
+            String childRDN            = childContextDNComponents[0];
+            String childContextDN      = childContext.getNameInNamespace();
+            
+            int beginIndex = childRDN.length() + 1;
+            int endIndex   = childContextDN.length();
+
+            parentRelativeDN = childContextDN.substring( 
+                beginIndex, endIndex );
+            
+            return parentRelativeDN;
+        }
+        else
+        {
+            String childRDN            = childContextDNComponents[0];
+            String childContextDN      = childContext.getNameInNamespace();
+            
+            int beginIndex = childRDN.length() + 1;
+            int endIndex   = 
+                childContextDN.length() - 
+                ( partitionDN.length() +1);
+            
+            parentRelativeDN = childContextDN.substring( 
+                beginIndex, endIndex );
+        }
+        return parentRelativeDN;
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/LDAPNormalizer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,18 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+public class LDAPNormalizer
+{
+    
+    /**
+     * Normalize a qualified string for LDAP
+     * by replacing periods with dashes.
+     * 
+     * @param qualifiedName the qualified name
+     */
+    public static void normalize(String qualifiedName)
+    {
+        qualifiedName = qualifiedName.replace( ".", "-" );
+    }
+
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/SimpleTypeNamespaceQualifier.java Thu May 31 12:58:13 2007
@@ -0,0 +1,39 @@
+/*
+ *  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.tuscany.das.ldap.util;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class DataTypeNamespaceQualifier.
+ */
+public class SimpleTypeNamespaceQualifier
+{
+    /**
+     * Qualify.
+     * 
+     * @param namespaceURI the namespace URI
+     * @param complexTypeName the name
+     * 
+     * @return the string
+     */
+    public static String qualify(String namespaceURI, String complexTypeName, String simpleTypeName )
+    {
+        return namespaceURI + "/" + complexTypeName  + "/" + simpleTypeName;
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceToInitialContextTransformer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,49 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import org.eclipse.emf.common.util.URI;
+
+/**
+ * The Class XSDNamespaceToInitialContextTransformer.
+ * 
+ * Takes the XSD Namespace used by the DataObjects
+ * and transforms it into the DN of the initial context
+ * used for the root DataObject entry.
+ */
+public class XSDNamespaceToInitialContextTransformer
+{
+    /**
+     * Transform.
+     * 
+     * @param namespaceURIString the namespace URI string
+     * 
+     * @return the DN of the initial context
+     * 
+     * @throws Exception the exception
+     */
+    public static String transform(String namespaceURIString) throws Exception
+    {
+        URI namespaceURI = URI.createURI(namespaceURIString);
+        String authority = namespaceURI.authority();
+
+        String path      = namespaceURI.path();
+
+        String[] authorityTokens = authority.split( "[.]" );
+        String[] pathTokens      = path.split("[/]");
+        
+        String DN = new String("");
+        
+        for (int i = (pathTokens.length-1); i > 0; i--)
+        {
+            DN = DN + "cn=" + pathTokens[i] + ", ";
+        }
+
+        for (int i = 0; i <= (authorityTokens.length-2); i++)
+        {
+            DN = DN + "cn=" + authorityTokens[i] + ", ";
+        }
+        
+        DN = DN + "ou=" + authorityTokens[authorityTokens.length-1];
+        return DN;
+    }
+}

Added: directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java?view=auto&rev=543239
==============================================================================
--- directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java (added)
+++ directory/sandbox/oersoy/das.testing/das.ldap.parent/das.ldap/src/main/java/org/apache/tuscany/das/ldap/util/XSDNamespaceURITokenizer.java Thu May 31 12:58:13 2007
@@ -0,0 +1,26 @@
+
+package org.apache.tuscany.das.ldap.util;
+
+import org.eclipse.emf.common.util.URI;
+
+public class XSDNamespaceURITokenizer
+{
+    
+    public static String[] createAuthorityTokens( URI xsdNamespaceURI )
+    {
+        String authority = xsdNamespaceURI.authority();
+        String[] authorityTokens = authority.split( "[.]" );
+        return authorityTokens;
+    }
+    
+    public static String[] createPathTokens(URI xsdNamespace)
+    {
+        String path              = xsdNamespace.path(); 
+        if (path != null)
+        {
+            return path.split("[/]"); 
+        }
+        else
+            return null;
+    }
+}



Mime
View raw message