directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r524132 - in /directory/sandbox/oersoy/guides/das.ldap.design.documentation: ./ META-INF/ source/ src/ src/main/ src/main/resources/ src/main/resources/css/ src/main/resources/images/ target/ target/classes/ target/html/ target/html/recipes...
Date Fri, 30 Mar 2007 15:33:23 GMT
Author: oersoy
Date: Fri Mar 30 08:33:21 2007
New Revision: 524132

URL: http://svn.apache.org/viewvc?view=rev&rev=524132
Log:
Initial import.

Added:
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/.classpath
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/.project
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/MANIFEST.MF
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/about.html
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.toc.xml
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.xml
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/plugin.xml
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/pom.xml
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/recipes.xml
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/book.css
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/recipes.css
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/images/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/images/123.png   (with props)
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/classes/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/recipe00.html
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe10.html
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe11.html
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe12.html
    directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe13.html

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/.classpath
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/.classpath?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/.classpath (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/.classpath Fri Mar 30 08:33:21 2007
@@ -0,0 +1,5 @@
+<classpath>
+  <classpathentry kind="src" path="src/main/resources"/>
+  <classpathentry kind="output" path="target/classes"/>
+  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+</classpath>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/.project
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/.project?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/.project (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/.project Fri Mar 30 08:33:21 2007
@@ -0,0 +1,14 @@
+<projectDescription>
+  <name>das.ldap.design.documentation</name>
+  <comment/>
+  <projects/>
+  <buildSpec>
+    <buildCommand>
+      <name>org.eclipse.jdt.core.javabuilder</name>
+      <arguments/>
+    </buildCommand>
+  </buildSpec>
+  <natures>
+    <nature>org.eclipse.jdt.core.javanature</nature>
+  </natures>
+</projectDescription>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/MANIFEST.MF?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/MANIFEST.MF (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/META-INF/MANIFEST.MF Fri Mar 30 08:33:21 2007
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-Name: %pluginName
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Bundle-ManifestVersion: 2
+Bundle-Localization: plugin
+Bundle-SymbolicName: org.apache.tuscany.das.ldap.design.documentation; singleton:=true
+Require-Bundle: org.eclipse.help
+Bundle-Version: 1.0.0
+Eclipse-LazyStart: true
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/about.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/about.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/about.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/about.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,34 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+
+<h2>About This Content</h2>
+ 
+<p>February 12, 2007</p>	
+<h3>License</h3>
+
+<p>
+All content ("Content") in this plug-in is made available
+by the The Apache Software Foundation.  The Content is provided 
+under the terms and conditions of the Apache Public License Version 2.0 ("ASL")
+unless otherwise indicated.  A copy of the ASL can be obtained via the URL
+<a href="http://www.apache.org/licenses/LICENSE-2.0.html">http://www.apache.org/licenses/LICENSE-2.0.html</a>.
+</p>
+
+<p>
+If the Content was obtained from a party other than the Apache Software Foundation, the Content is 
+being redistributed by that party ("Redistributor") and different terms and conditions may
+apply to your use of any object code in the Content.
+Contact the Redistributor or check the Redistributor's license if one was 
+provided with the Content.  Unless otherwise
+expressed below, the conditions and terms of the ASL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.apache.org/">http://www.apache.org</a>.
+</p>
+
+</body>
+</html>

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.toc.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.toc.xml?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.toc.xml (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.toc.xml Fri Mar 30 08:33:21 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="LDAP DAS Design Guide">	
+			<topic label="Initializing the DAS">
+				<topic label="Providing the DAS With an Initial Context" href="target/html/recipes/0/recipe00.html"/>
+			</topic>	
+			<topic label="Storing a New DataGraph">
+				<topic label="Getting the Model Resource's Root Object" href="target/html/recipes/1/recipe10.html"/>
+				<topic label="Writing an LDAP ObjectClass per EClass in the Model" href="target/html/recipes/1/recipe11.html"/>
+				<topic label="Creating a DataGraph in ADS" href="target/html/recipes/1/recipe12.html"/>
+				<topic label="Creating an EReference Subcontext" href="target/html/recipes/1/recipe13.html"/>
+			</topic>
+</toc>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.xml?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.xml (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/org.apache.tuscany.das.ldap.design.documentation.xml Fri Mar 30 08:33:21 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="LDAP DAS Design Recipes">	
+			<topic label="Initializing the DAS">
+				<topic label="Providing the DAS With an Initial Context" href="target/html/recipes/0/recipe00.html"/>
+			</topic>	
+			<topic label="Storing a New DataGraph">
+				<topic label="Getting the Model Resource's Root Object" href="target/html/recipes/1/recipe10.html"/>
+				<topic label="Writing an LDAP ObjectClass per EClass in the Model" href="target/html/recipes/1/recipe11.html"/>
+				<topic label="Creating a DataGraph in ADS" href="target/html/recipes/1/recipe12.html"/>
+				<topic label="Creating an EReference Subcontext" href="target/html/recipes/1/recipe13.html"/>
+			</topic>
+</toc>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/plugin.xml?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/plugin.xml (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/plugin.xml Fri Mar 30 08:33:21 2007
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin 
+	name="das.ldap.design.documentation"
+	id="org.apache.tuscany.das.ldap.design.documentation"
+	version = "1.0.0"
+	provider= "org.apache.tuscany">
+  <!-- ====================================================================== -->
+  <!-- Define primary TOC                                                     -->
+  <!-- ====================================================================== -->
+  <extension point="org.eclipse.help.toc">
+    <toc file="org.apache.tuscany.das.ldap.design.documentation.toc.xml" primary="true"/>
+  </extension>
+</plugin>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/pom.xml?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/pom.xml (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/pom.xml Fri Mar 30 08:33:21 2007
@@ -0,0 +1,27 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>org.apache.tuscany</groupId>
+	<artifactId>das.ldap.design.documentation</artifactId>
+	<version>1.0</version>
+	<packaging>infocenter.recipes.documentation</packaging>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven</groupId>
+				<artifactId>documentation.recipes.mojo</artifactId>
+				<extensions>true</extensions>
+				<version>1.0-SNAPSHOT</version>
+				<executions>
+					<execution>
+						<id>generate</id>
+						<goals>
+							<goal>generate</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/recipes.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/recipes.xml?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/recipes.xml (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/source/recipes.xml Fri Mar 30 08:33:21 2007
@@ -0,0 +1,393 @@
+<?xml version="1.0" encoding="ASCII"?>
+<recipes xmlns="http://maven.apache.org/documentation/recipes/1.0.0"
+		 label="LDAP DAS Design Recipes">
+   <recipeGroup
+      id="0"
+      label="Initializing the DAS">
+      <recipe id="00">
+         <challenge>Providing the DAS With an Initial Context</challenge>
+         <solution>Use the package namespace.</solution>
+         <discussion>
+            <![CDATA[
+            Suppose the root package of the SDO model has the following
+            namespace:
+
+            </br>
+            </br>
+            <pre class="codeblock">  http://com.example.org/users/accounts</pre>
+            </br>
+            </br>
+
+            Thus we make the initial context:
+
+            </br>
+            </br>
+            <pre class="codeblock">  cn=accounts, cn=users, cn=org, cn=example, cn=com</pre>
+            </br>
+            </br>
+
+            The model root (DocumentRoot, or some other Class representing the root)
+            will be stored in the LDAP repository using this initial context to reference
+            it.
+            ]]>
+         </discussion>
+      </recipe>
+    </recipeGroup>
+   <recipeGroup
+      id="1"
+      label="Storing a New DataGraph">
+
+
+      <recipe id="10">
+         <challenge>Getting the Model Resource's Root Object</challenge>
+         <solution>Use the RDN from the initial context.</solution>
+         <discussion>
+            <![CDATA[
+            In this case the RDN for the root object in the model
+            is 
+
+            </br>
+            </br>
+            <pre class="codeblock">  accounts</pre>
+            </br>
+            </br>
+
+            Therefore we can get our model root object like this:
+
+            </br>
+            </br>
+            <pre class="codeblock">  EObject eObjectRoot = resource.getEObject("//@accounts");  </pre>
+            </br>
+            </br>
+            ]]>
+         </discussion>
+      </recipe>
+
+      <recipe id="11">
+         <challenge>Writing an LDAP ObjectClass per EClass in the Model</challenge>
+         <solution>Use the LDAP Server's Dynamic Schema Capabilities</solution>
+         <discussion>
+            <![CDATA[
+            
+            First create a new ObjectClass representing the SDO Type (Class)
+            and add it to a new instance of LDAP attributes.
+
+            </br>
+            </br>
+            <pre class="codeblock">
+  Attributes ldapAttributes = new AttributesImpl();
+  Attribute objectClass = new AttributeImpl( SystemSchemaConstants.OBJECT_CLASS_AT, eClass.getName() );
+  objectClass.add( MetaSchemaConstants.META_TOP_OC );
+  objectClass.add( MetaSchemaConstants.META_OBJECT_CLASS_OC );
+  ldapAttributes.put( objectClass ); 
+            </pre>
+            </br>
+            </br>
+
+            Then add the EAttributes of the EClass to the LDAP attributes list.
+
+            </br>
+            </br>
+            <pre class="codeblock">
+  EList eAttributes = eClass.getEAllAttributes();
+  Iterator<EAttribute> eAttributeIterator = eAttributes.iterator();
+  while(eAttributeIterator.hasNext() )
+  {
+  	EAttribute eAttribute = eAttributeIterator.next();
+  	if ( eAttributes.isRequired() )
+  	{
+   	ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eAttribute.getName() ); 
+  	}
+  	else
+  	{
+  		ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eAttribute.getName() );
+  	}
+  }
+            </pre>
+            </br>
+            </br>
+
+
+            For each EReference on the EClass, that is 
+            not a multiplicity many EReference,
+            we will create another ldap attribute
+            using the following naming convention:
+
+            </br>
+            </br>
+            <pre class="codeblock">  EReference.getName() + "EReference"</pre>
+            </br>
+            </br>
+            
+            If the EReference is a multiplicity many
+            reference then the naming convention used
+            is:
+            
+
+            </br>
+            </br>
+            <pre class="codeblock">  EReference.getName() + "EReferenceMany"</pre>
+            </br>
+            </br>
+            
+            If the EReference ldap attribute 
+            is multiplicity many, it will
+            store the size of the EList containing
+            the references.
+            
+            If it is not multiplicity many,
+            it will just store a boolean indicating 
+            whether the reference was set or not.
+            
+            Thus we iterate through all the 
+            EReferences of the EClass adding them like
+            this:
+            
+            <br/>
+            <br/>
+            <pre class="codeblock">
+  EList eReferences = eClass.getEAllReferences();
+  Iterator<EReference> eReferenceIterator = references.iterator();
+  while(eReferenceIterator.hasNext() )
+  {
+  	EReference eReference = eReferenceIterator.next();
+  	if ( eReference.isRequired() )
+  	{
+  		if ( eReference.isMany() )
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eReference.getName() +  "EReferenceMany");
+  		}
+  		else
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eReference.getName() +  "EReference");
+  		}
+  	}
+  	else
+  	{
+  		if ( eReference.isMany() )
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eReference.getName() +  "EReferenceMany");
+  		}
+  		else
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eReference.getName() +  "EReference");
+  		}
+  	}
+  }
+            </pre>
+            <br/>
+            <br/>
+            
+            Now when the LDAP DAS attempts to retrieve references it will
+            know where to look based on the convention discussed in the READ-TODO
+            recipe, and it will know how many to retrieve based on the value stored
+            in the reference attribute.
+            ]]>
+         </discussion>
+         <relatedRecipeDescriptor id="10" />
+      </recipe>      
+
+      <recipe id="12">
+         <challenge>Creating a DataGraph in ADS</challenge>
+         <solution>Use DAS.LDAP.write(eObject) [Just made it up]</solution>
+         <discussion>
+            <![CDATA[
+            Creating a DataGraph in ADS means writing all the 
+            DataObjects contained in the graph to ADS,
+            along with their corresponding 
+            types (Classes), which correspond to ObjectClasses
+            in ADS.
+            
+            <br/>
+            <br/>
+            
+            To do this we first get the root DataObject
+            in the DataGraph.
+            
+            </br>
+            </br>
+            <pre class="codeblock">  EObject eObjectRoot = resource.getEObject("//@accounts");</pre>
+            </br>
+            </br>
+            
+            We also create the Directory Context
+            where this object will be stored
+            (using the convention discussed in the 
+            recipe <recipeLink id="00"/>) like this:
+
+	        </br>
+            </br>
+            <pre class="codeblock">
+  //I just made the below ctx method stuff up..
+  //will correct when coding :-) 
+  DirContext rootContext = DirContext.createContexts("cn=accounts, cn=users, cn=org, cn=example, cn=com");
+            </pre>
+            </br>
+            </br>
+            
+            Then we get the root object's type (EClass):
+            
+            </br>
+            </br>
+            <pre class="codeblock">  EClass eClass = eObjectRoot.eClass();</pre>
+            </br>
+            </br>
+            
+            Now we write the ObjectClass corresponding
+            to this EClass to ADS (See Related Recipes).
+
+            </br>
+            </br>
+            
+			Once the ObjectClass is added to ADS
+			we create a directory attributes list and 
+			add it like this:
+			
+			</br>
+            </br>
+            <pre class="codeblock">
+  Attributes ldapAttributes = new AttributesImpl();
+  ldapAttributes.put(SystemSchemaConstants.OBJECT_CLASS_NAME, eClass.getFullyQualifiedName() );            
+			</pre>
+            </br>
+            </br>
+            
+            Once this is done, we add the simple
+            properties contained in the DataObject
+            to a list of ldap attributes as follows.
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+EList<EAttribute> eAttributes = eClass.getEAllAttributes();
+Iterator<EAttribute> attributeIterator = eAttributes.iterator();
+while ( attributeIterator.hasNext() )
+  {
+	  EAttribute eAttribute    = attributeIterator.next();
+	  EObject eAttributeObject = eObjectRoot.eGet(eAttribute);
+	
+	 ldapAttributes.put(eAttribute.getName(), eAttributeObject.toString() );
+  }
+          </pre>
+            </br>
+            </br>
+            
+            We must also add the directory attributes that contain
+            metadata (size() for multiplicity many EReferences and isSet() otherwise)
+            for the EReferences (Complex properties) on the
+            root object like this.
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+  EList<EReference> eReferences = eClass.getEAllReferences();
+  Iterator<EReference> eReferenceIterator = eReferences.iterator();
+  while ( eReferenceIterator.hasNext() )
+  {
+	  EReference eReference    = eReferenceIterator.next();
+	  if (eReference.isMany())
+	  {
+		  if ( eObjectRoot.isSet(eReference) )
+		  {
+			  EList eReferenceList = eObjectRoot.eGet(eReference);
+ 		  ldapAttributes.put(eReference.getName(), eReferenceList.size() );
+		  }
+		  else
+		  {
+			  ldapAttributes.put(eReference.getName(), 0 );
+		  }
+	  }
+	  else
+	  {
+		  ldapAttributes.put(eReference.getName(), eObjectRoot.isSet(eReference);
+	  }
+  }
+            </pre>
+            </br>
+            </br>
+            
+            Finally we add the list of ldap attributes, effectively adding the 
+            root DataGraph object, to the server:
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+  //I'm making this up too
+  ctx.addAttributes(ldapAttributes);
+            </pre>
+            </br>
+            </br>
+            ]]>
+         </discussion>
+         <relatedRecipeDescriptor id="11" />
+      </recipe>      
+
+      <recipe id="13">
+         <challenge>Creating an EReference Subcontext</challenge>
+         <solution>Use the JNDI InitialContext bind Operation</solution>
+         <discussion>
+            <![CDATA[
+            We need to establish a subcontext for each EReference.
+            <br/>
+            <br/>
+            The subcontext naming convention used
+            is 
+            <br/>
+            <br/>
+            EReference.getName()
+            <br/>
+            <br/>
+            if the EReference is not a multiplicity many
+            EReference.
+            <br/>
+            <br/>
+            If the EReference is a multiplicity many EReference,
+            the convention used is: 
+            <br/>
+            <br/>
+            EReference.getName() + index
+            <br/>
+            <br/>
+            where index is an integer indicating 
+            where the EReference is stored on the EList of its
+            container.
+            <br/>
+            <br/>
+            Thus if our root object is getEObject("//account");
+            and it is stored here:
+            <br/>
+            <br/>
+            DN: cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            and it has an non multiplicity many EReference
+            of type User named user, then user would be stored
+            here:
+            <br/>
+            <br/>
+            DN: cn=user, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            <br/>
+            If User was a multiplicity many EReference, and its index was 0,
+            it would be stored here:
+            <br/>
+            <br/>
+            DN: cn=user0, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            <br/>
+            So if there were 3 User EReferences stored on the multiplicity
+            many User EReference, then they would be stored under the following
+            contexts:
+            <br/>
+            <br/>
+            DN: cn=user0, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            DN: cn=user1, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            DN: cn=user2, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+      ]]>
+         </discussion>
+      </recipe>
+      
+   </recipeGroup>
+</recipes>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/book.css
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/book.css?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/book.css (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/book.css Fri Mar 30 08:33:21 2007
@@ -0,0 +1,106 @@
+body {
+  font-family: sans-serif;
+  font-size: 10pt;
+  background-color: white;
+  color: black;
+  max-width: 800px;
+}
+
+h1 {
+  font-size: 18pt;
+}
+
+h2 {
+  font-size: 16pt;
+}
+
+h3 {
+  font-size: 14pt;
+}
+
+h4 {
+  font-size: 12pt;
+}
+
+table {
+  font-size: 10pt;
+}
+
+th {
+  font-weight: bold;
+}
+
+kbd {
+  font-family: monospace;
+  font-weight: bold;
+}
+
+var {
+  font-style: italic;
+}
+
+ol {
+  margin-bottom: 1em;
+}
+
+dt {
+  font-weight: bold;
+  margin-top: 1em;
+}
+
+li {
+  margin-top: 1em;
+}
+
+span.control {
+  font-weight: bold;
+}
+
+span.name {
+  font-style: italic;
+  font-weight: bold;
+}
+
+span.action {
+  font-style: italic;
+}
+
+span.code {
+  font-family: monospace;
+}
+
+span.menu {
+  color: #660033;
+  font-weight: bold;
+}
+
+span.filefolder {
+  font-family: monospace;
+}
+
+blockquote {
+  background-color: #e8e8e8;
+  border: 1pt black;
+  margin: 2em; border: 1px solid black;
+  padding: 1em;
+}
+
+.tasks, .reference, .faq {
+  padding-left: 18px;
+  font-size: 14pt;
+  background-image:url(images/bullet14.png);
+  background-repeat: no-repeat;
+  background-position: left;
+ }
+
+
+pre
+{
+border-width:thin;
+border-style: solid;
+font-family: "Courier New", Courier, mono;
+font-style: normal;
+font-size: 12px;
+padding-top: 6px;
+padding-bottom: 6px;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/recipes.css
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/recipes.css?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/recipes.css (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/css/recipes.css Fri Mar 30 08:33:21 2007
@@ -0,0 +1,3 @@
+.notRequired {
+  color: #959595;
+}
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/images/123.png
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/images/123.png?view=auto&rev=524132
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/oersoy/guides/das.ldap.design.documentation/src/main/resources/images/123.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/recipe00.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/recipe00.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/recipe00.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/0/recipe00.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,53 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Providing the DAS With an Initial Context</title>
+   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<link href="../../../../src/main/resources/css/book.css" rel="stylesheet" type="text/css">
+	<link href="../../../../src/main/resources/css/recipes.css" rel="stylesheet" type="text/css">
+  </head>
+<body>
+
+<h2>Challenge</h2>
+
+<div class="content">
+	<p>Providing the DAS With an Initial Context</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use the package namespace.</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+            
+            Suppose the root package of the SDO model has the following
+            namespace:
+
+            </br>
+            </br>
+            <pre class="codeblock">  http://com.example.org/users/accounts</pre>
+            </br>
+            </br>
+
+            Thus we make the initial context:
+
+            </br>
+            </br>
+            <pre class="codeblock">  cn=accounts, cn=users, cn=org, cn=example, cn=com</pre>
+            </br>
+            </br>
+
+            The model root (DocumentRoot, or some other Class representing the root)
+            will be stored in the LDAP repository using this initial context to reference
+            it.
+            
+         </p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe10.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe10.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe10.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe10.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,49 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Getting the Model Resource's Root Object</title>
+   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<link href="../../../../src/main/resources/css/book.css" rel="stylesheet" type="text/css">
+	<link href="../../../../src/main/resources/css/recipes.css" rel="stylesheet" type="text/css">
+  </head>
+<body>
+
+<h2>Challenge</h2>
+
+<div class="content">
+	<p>Getting the Model Resource's Root Object</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use the RDN from the initial context.</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+            
+            In this case the RDN for the root object in the model
+            is 
+
+            </br>
+            </br>
+            <pre class="codeblock">  accounts</pre>
+            </br>
+            </br>
+
+            Therefore we can get our model root object like this:
+
+            </br>
+            </br>
+            <pre class="codeblock">  EObject eObjectRoot = resource.getEObject("//@accounts");  </pre>
+            </br>
+            </br>
+            
+         </p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe11.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe11.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe11.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe11.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,167 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Writing an LDAP ObjectClass per EClass in the Model</title>
+   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<link href="../../../../src/main/resources/css/book.css" rel="stylesheet" type="text/css">
+	<link href="../../../../src/main/resources/css/recipes.css" rel="stylesheet" type="text/css">
+  </head>
+<body>
+
+<h2>Challenge</h2>
+
+<div class="content">
+	<p>Writing an LDAP ObjectClass per EClass in the Model</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use the LDAP Server's Dynamic Schema Capabilities</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+            
+            
+            First create a new ObjectClass representing the SDO Type (Class)
+            and add it to a new instance of LDAP attributes.
+
+            </br>
+            </br>
+            <pre class="codeblock">
+  Attributes ldapAttributes = new AttributesImpl();
+  Attribute objectClass = new AttributeImpl( SystemSchemaConstants.OBJECT_CLASS_AT, eClass.getName() );
+  objectClass.add( MetaSchemaConstants.META_TOP_OC );
+  objectClass.add( MetaSchemaConstants.META_OBJECT_CLASS_OC );
+  ldapAttributes.put( objectClass ); 
+            </pre>
+            </br>
+            </br>
+
+            Then add the EAttributes of the EClass to the LDAP attributes list.
+
+            </br>
+            </br>
+            <pre class="codeblock">
+  EList eAttributes = eClass.getEAllAttributes();
+  Iterator<EAttribute> eAttributeIterator = eAttributes.iterator();
+  while(eAttributeIterator.hasNext() )
+  {
+  	EAttribute eAttribute = eAttributeIterator.next();
+  	if ( eAttributes.isRequired() )
+  	{
+   	ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eAttribute.getName() ); 
+  	}
+  	else
+  	{
+  		ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eAttribute.getName() );
+  	}
+  }
+            </pre>
+            </br>
+            </br>
+
+
+            For each EReference on the EClass, that is 
+            not a multiplicity many EReference,
+            we will create another ldap attribute
+            using the following naming convention:
+
+            </br>
+            </br>
+            <pre class="codeblock">  EReference.getName() + "EReference"</pre>
+            </br>
+            </br>
+            
+            If the EReference is a multiplicity many
+            reference then the naming convention used
+            is:
+            
+
+            </br>
+            </br>
+            <pre class="codeblock">  EReference.getName() + "EReferenceMany"</pre>
+            </br>
+            </br>
+            
+            If the EReference ldap attribute 
+            is multiplicity many, it will
+            store the size of the EList containing
+            the references.
+            
+            If it is not multiplicity many,
+            it will just store a boolean indicating 
+            whether the reference was set or not.
+            
+            Thus we iterate through all the 
+            EReferences of the EClass adding them like
+            this:
+            
+            <br/>
+            <br/>
+            <pre class="codeblock">
+  EList eReferences = eClass.getEAllReferences();
+  Iterator<EReference> eReferenceIterator = references.iterator();
+  while(eReferenceIterator.hasNext() )
+  {
+  	EReference eReference = eReferenceIterator.next();
+  	if ( eReference.isRequired() )
+  	{
+  		if ( eReference.isMany() )
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eReference.getName() +  "EReferenceMany");
+  		}
+  		else
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MUST_AT, eReference.getName() +  "EReference");
+  		}
+  	}
+  	else
+  	{
+  		if ( eReference.isMany() )
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eReference.getName() +  "EReferenceMany");
+  		}
+  		else
+  		{
+  			ldapAttributes.put( MetaSchemaConstants.M_MAY_AT, eReference.getName() +  "EReference");
+  		}
+  	}
+  }
+            </pre>
+            <br/>
+            <br/>
+            
+            Now when the LDAP DAS attempts to retrieve references it will
+            know where to look based on the convention discussed in the READ-TODO
+            recipe, and it will know how many to retrieve based on the value stored
+            in the reference attribute.
+            
+         </p>
+
+
+<h2>Related Challenges</h2>
+
+<table>
+	<tbody>
+		<tr>
+			<td>
+    			<a
+    				href="../1/recipe10.html">
+    				<img
+    					border="0" 
+    					title="Getting the Model Resource's Root Object"
+    					alt="Getting the Model Resource's Root Object"
+    					src="../../../../src/main/resources/images/123.png">
+    			</a>
+			</td>
+			<td>Getting the Model Resource's Root Object</td>
+		</tr>
+	</tbody>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe12.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe12.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe12.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe12.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,178 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Creating a DataGraph in ADS</title>
+   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<link href="../../../../src/main/resources/css/book.css" rel="stylesheet" type="text/css">
+	<link href="../../../../src/main/resources/css/recipes.css" rel="stylesheet" type="text/css">
+  </head>
+<body>
+
+<h2>Challenge</h2>
+
+<div class="content">
+	<p>Creating a DataGraph in ADS</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use DAS.LDAP.write(eObject) [Just made it up]</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+            
+            Creating a DataGraph in ADS means writing all the 
+            DataObjects contained in the graph to ADS,
+            along with their corresponding 
+            types (Classes), which correspond to ObjectClasses
+            in ADS.
+            
+            <br/>
+            <br/>
+            
+            To do this we first get the root DataObject
+            in the DataGraph.
+            
+            </br>
+            </br>
+            <pre class="codeblock">  EObject eObjectRoot = resource.getEObject("//@accounts");</pre>
+            </br>
+            </br>
+            
+            We also create the Directory Context
+            where this object will be stored
+            (using the convention discussed in the 
+            recipe <recipeLink id="00"/>) like this:
+
+	        </br>
+            </br>
+            <pre class="codeblock">
+  //I just made the below ctx method stuff up..
+  //will correct when coding :-) 
+  DirContext rootContext = DirContext.createContexts("cn=accounts, cn=users, cn=org, cn=example, cn=com");
+            </pre>
+            </br>
+            </br>
+            
+            Then we get the root object's type (EClass):
+            
+            </br>
+            </br>
+            <pre class="codeblock">  EClass eClass = eObjectRoot.eClass();</pre>
+            </br>
+            </br>
+            
+            Now we write the ObjectClass corresponding
+            to this EClass to ADS (See Related Recipes).
+
+            </br>
+            </br>
+            
+			Once the ObjectClass is added to ADS
+			we create a directory attributes list and 
+			add it like this:
+			
+			</br>
+            </br>
+            <pre class="codeblock">
+  Attributes ldapAttributes = new AttributesImpl();
+  ldapAttributes.put(SystemSchemaConstants.OBJECT_CLASS_NAME, eClass.getFullyQualifiedName() );            
+			</pre>
+            </br>
+            </br>
+            
+            Once this is done, we add the simple
+            properties contained in the DataObject
+            to a list of ldap attributes as follows.
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+EList<EAttribute> eAttributes = eClass.getEAllAttributes();
+Iterator<EAttribute> attributeIterator = eAttributes.iterator();
+while ( attributeIterator.hasNext() )
+  {
+	  EAttribute eAttribute    = attributeIterator.next();
+	  EObject eAttributeObject = eObjectRoot.eGet(eAttribute);
+	
+	 ldapAttributes.put(eAttribute.getName(), eAttributeObject.toString() );
+  }
+          </pre>
+            </br>
+            </br>
+            
+            We must also add the directory attributes that contain
+            metadata (size() for multiplicity many EReferences and isSet() otherwise)
+            for the EReferences (Complex properties) on the
+            root object like this.
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+  EList<EReference> eReferences = eClass.getEAllReferences();
+  Iterator<EReference> eReferenceIterator = eReferences.iterator();
+  while ( eReferenceIterator.hasNext() )
+  {
+	  EReference eReference    = eReferenceIterator.next();
+	  if (eReference.isMany())
+	  {
+		  if ( eObjectRoot.isSet(eReference) )
+		  {
+			  EList eReferenceList = eObjectRoot.eGet(eReference);
+ 		  ldapAttributes.put(eReference.getName(), eReferenceList.size() );
+		  }
+		  else
+		  {
+			  ldapAttributes.put(eReference.getName(), 0 );
+		  }
+	  }
+	  else
+	  {
+		  ldapAttributes.put(eReference.getName(), eObjectRoot.isSet(eReference);
+	  }
+  }
+            </pre>
+            </br>
+            </br>
+            
+            Finally we add the list of ldap attributes, effectively adding the 
+            root DataGraph object, to the server:
+            
+            </br>
+            </br>
+            <pre class="codeblock">
+  //I'm making this up too
+  ctx.addAttributes(ldapAttributes);
+            </pre>
+            </br>
+            </br>
+            
+         </p>
+
+
+<h2>Related Challenges</h2>
+
+<table>
+	<tbody>
+		<tr>
+			<td>
+    			<a
+    				href="../1/recipe11.html">
+    				<img
+    					border="0" 
+    					title="Writing an LDAP ObjectClass per EClass in the Model"
+    					alt="Writing an LDAP ObjectClass per EClass in the Model"
+    					src="../../../../src/main/resources/images/123.png">
+    			</a>
+			</td>
+			<td>Writing an LDAP ObjectClass per EClass in the Model</td>
+		</tr>
+	</tbody>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe13.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe13.html?view=auto&rev=524132
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe13.html (added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/1/recipe13.html Fri Mar 30 08:33:21 2007
@@ -0,0 +1,91 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Creating an EReference Subcontext</title>
+   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+	<link href="../../../../src/main/resources/css/book.css" rel="stylesheet" type="text/css">
+	<link href="../../../../src/main/resources/css/recipes.css" rel="stylesheet" type="text/css">
+  </head>
+<body>
+
+<h2>Challenge</h2>
+
+<div class="content">
+	<p>Creating an EReference Subcontext</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use the JNDI InitialContext bind Operation</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+            
+            We need to establish a subcontext for each EReference.
+            <br/>
+            <br/>
+            The subcontext naming convention used
+            is 
+            <br/>
+            <br/>
+            EReference.getName()
+            <br/>
+            <br/>
+            if the EReference is not a multiplicity many
+            EReference.
+            <br/>
+            <br/>
+            If the EReference is a multiplicity many EReference,
+            the convention used is: 
+            <br/>
+            <br/>
+            EReference.getName() + index
+            <br/>
+            <br/>
+            where index is an integer indicating 
+            where the EReference is stored on the EList of its
+            container.
+            <br/>
+            <br/>
+            Thus if our root object is getEObject("//account");
+            and it is stored here:
+            <br/>
+            <br/>
+            DN: cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            and it has an non multiplicity many EReference
+            of type User named user, then user would be stored
+            here:
+            <br/>
+            <br/>
+            DN: cn=user, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            <br/>
+            If User was a multiplicity many EReference, and its index was 0,
+            it would be stored here:
+            <br/>
+            <br/>
+            DN: cn=user0, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            <br/>
+            So if there were 3 User EReferences stored on the multiplicity
+            many User EReference, then they would be stored under the following
+            contexts:
+            <br/>
+            <br/>
+            DN: cn=user0, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            DN: cn=user1, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+            DN: cn=user2, cn=accounts, cn=users, cn=org, cn=example, cn=com
+            <br/>
+      
+         </p>
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message