directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oer...@apache.org
Subject svn commit: r525948 [2/2] - in /directory/sandbox/oersoy/guides/das.ldap.design.documentation: ./ META-INF/ source/ source/concepts/ source/concepts/0/ src/ src/main/ src/main/resources/ src/main/resources/css/ src/main/resources/images/ target/ target...
Date Thu, 05 Apr 2007 19:38:44 GMT
Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/2/recipexx.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/2/recipexx.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/2/recipexx.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/2/recipexx.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,153 @@
+ 
+<!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>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe30.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe30.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe30.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe30.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,56 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>
+				Creating an Instance of the DataObject's Classifier
+			</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 Instance of the DataObject's Classifier
+			</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>
+				Use EcoreFactory.eINSTANCE.createEClass()
+			</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+            </br>
+            </br>
+            <pre class="codeblock">
+            EClass eClass = EcoreFactory.eINSTANCE.createEClass();
+            eClass.setName()
+            </pre>
+            </br>
+            </br>
+
+            we would get our EClass or Type name like this this:
+
+            </br>
+            </br>
+            <pre class="codeblock">
+ String className = StringUtils.capitalize( JNDIUtils.getRDN(DN) );  </pre>
+            </br>
+            </br>
+            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe31.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe31.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe31.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe31.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,42 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>
+				Creating an Instance of the SDO DataObject's Type
+			</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 Instance of the SDO DataObject's Type
+			</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use EcoreFactory.eINSTANCE</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+            </br>
+            </br>
+            <pre class="codeblock">EClass eClass = EcoreFactory.eINSTANCE.createEClass()</pre>
+            </br>
+            </br>
+            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe32.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe32.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe32.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe32.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,77 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>
+				Getting the DataObject's Simple Properties from the LDAP
+				Entry
+			</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 DataObject's Simple Properties from the LDAP
+				Entry
+			</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use DirContext.getAttributes()</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+            First get a list of all the attributes contained in the entry:
+            </br>
+            </br>
+            <pre class="codeblock">Attributes ldapAttributes = directoryContext.getAttributes(rootDataObjectDN);</pre>
+            </br>
+            </br>
+            
+            Then clone it, because we need both the complex type metadata, for 
+            retrieving DataObject references, and the
+            simple properties:
+
+            </br>
+            </br>
+            <pre class="codeblock">Attributes ldapAttributesClone = ldapAttributes.clone();</pre>
+            </br>
+            </br>
+            
+            Then delete the objectClass attribute from the ldapAttributes map:
+            
+            </br>
+            </br>
+            <pre class="codeblock">ldapAttributes.remove(SystemSchemaConstants.OBJECT_CLASS_AT);</pre>
+            </br>
+            </br>
+            
+            Then remove all the attributes whose name contains the word EReference.
+            
+            </br>
+            </br>
+            <pre class="codeblock">TODO Code</pre>
+            </br>
+            </br>
+            
+            We now have a map of the simple property names and their corresponding
+            values.
+            
+            </br>
+            </br>
+            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe33.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe33.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe33.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe33.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,71 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>
+				Getting the DataObject's Complex Properties's Metadata
+			</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 DataObject's Complex Properties's Metadata
+			</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use DirContext.getAttributes()</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+            First get a list of all the attributes contained in the entry:
+            </br>
+            </br>
+            <pre class="codeblock">Attributes ldapAttributes = directoryContext.getAttributes(rootDataObjectDN);</pre>
+            </br>
+            </br>
+            
+            </br>
+            </br>
+            <pre class="codeblock">Attributes ldapAttributesClone = ldapAttributes.clone();</pre>
+            </br>
+            </br>
+            
+            Then delete the objectClass attribute from the ldapAttributes map:
+            
+            </br>
+            </br>
+            <pre class="codeblock">ldapAttributes.remove(SystemSchemaConstants.OBJECT_CLASS_AT);</pre>
+            </br>
+            </br>
+            
+            Then if the attribute's name does not contain the String "EReference", 
+            we remove it.
+            
+            </br>
+            </br>
+            <pre class="codeblock">TODO Code</pre>
+            </br>
+            </br>
+            
+            We now have a map of the complex property names and their corresponding
+            meta data values.
+            </br>
+            </br>
+            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe34.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe34.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe34.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/3/recipe34.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,65 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Adding the Root EClass's EAttributes</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>Adding the Root EClass's EAttributes</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>
+				Use the Simple Properties Attributes Map
+			</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+            For each ldapAttribute in the entry, the DAS first creates 
+            an EAttribute instance, if one has not already been created 
+            and added to the model's EPackage.
+			<pre class="codeblock"> EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
</pre>
+            </br>
+            </br>
+            The EAttribute requires a DataType instance in order 
+            to set the the EAttribute's eType property, so the DAS
+            uses the name of the attributeType's Syntax OID
+            to lookup the DataType on the EPackage.  If the
+            DataType reference returned is null, the DAS creates 
+            the DataType and adds it to the EPackage.
+            </br>
+            </br>
+            The EAttribute instance also needs a name.  
+            The name of the EAttribute instance is the
+            name of the attributeType.
+            </br>
+            </br>
+            If the EAttribute instance is a multiplicity
+            many EAttribute, indicated by MetaSchemaConstants.M_SINGLE_VALUE_AT
+            property of the attributeType being set to false, the
+            EAttribute's upperBound property is set to "-1".
+            </br>
+            </br>
+            Lastly if the attributeType is a  
+            MetaSchemaConstants.M_MUST_AT attribute,
+            then the EAttribute required property is set to true.
+            </br>
+            </br>
+            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe13.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe13.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe13.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe13.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,93 @@
+ 
+<!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

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe40.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe40.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe40.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/4/recipe40.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,186 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Writing a DataGraph to 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>Writing a DataGraph to 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="
+				Providing the DAS With an Initial Context
+			"
+    					alt="
+				Providing the DAS With an Initial Context
+			"
+    					src="../../../../src/main/resources/images/123.png">
+    			</a>
+			</td>
+			<td>
+				Providing the DAS With an Initial Context
+			</td>
+		</tr>
+	</tbody>
+</table>
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe50.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe50.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe50.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe50.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,52 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Creating a DataObject Instance</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 DataObject Instance</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>Use the RDN from the current directory context</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+				First get the model's Factory from the EPackage.
+	            </br>
+	            </br>
+	            <pre class="codeblock">EFactory eFactory = modelEPackage.getFactory()</pre>
+	            </br>
+	            </br>
+	            Then create an instance of the 
+	
+	            Therefore we can get our model root object like this:
+	
+	            </br>
+	            </br>
+	            <pre class="codeblock">  EObject eObject = eFactory.create("FileUtils.capitalize(rdnValue);</pre>
+	            </br>
+	            </br>
+	            
+	            Note that if the rdnValue corresponds to a multiplicity many
+	            EReference then the integer at the end of the rdnValue must
+	            be removed.
+	            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe51.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe51.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe51.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe51.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,33 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Setting a DataObject's Simple Properties</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>Setting a DataObject's Simple Properties</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p></p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+	            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe52.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe52.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe52.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/5/recipe52.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,33 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title> Setting the DataObject's Complex Properties</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> Setting the DataObject's Complex Properties</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p></p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>
+				
+	            
+			</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex0.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex0.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex0.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex0.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,32 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>Creating the Prototype Project</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 the Prototype Project</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>
+				Run mvn archetype:create -DartifactId=das.ldap.prototype -DgroupId=org.apache.tuscany
+			</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p>null</p>
+
+</body>
+</html>
\ No newline at end of file

Added: directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex1.html
URL: http://svn.apache.org/viewvc/directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex1.html?view=auto&rev=525948
==============================================================================
--- directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex1.html
(added)
+++ directory/sandbox/oersoy/guides/das.ldap.design.documentation/target/html/recipes/x/recipex1.html
Thu Apr  5 12:38:41 2007
@@ -0,0 +1,34 @@
+ 
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+  <head>
+  <title>
+				Adding the EMF Dependencies to the Build
+			</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>
+				Adding the EMF Dependencies to the Build
+			</p>
+</div>
+
+<h2>Solution</h2>
+
+<div class="content">
+	<p>See Discussion</p>
+</div>
+
+<h2>Discussion</h2>
+
+<div class="content">
+<p></p>
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message