directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ole Ersoy <ole.er...@gmail.com>
Subject Re: [GSoC] Project use cases
Date Sat, 15 Mar 2008 17:25:17 GMT
Hi David,

Congratulations on the summer gig.  Just a few comments on top of Emmanuel's comments.  I
also agree with David's comments that working with Graphs is "The" challenge, although it's
easy to understand that someone might want something very light weight that they can use to
quickly persist an object to ADS.  This would be a sub-use case of working with Graph's, so
it's a good place to start experimenting.

> Interesting. Ole already worked on such a matter, I think you can 
> benefit from what he did :
> http://svn.apache.org/repos/asf/directory/sandbox/oersoy/das.testing/

Here' link to the current repository:

http://svn.apache.org/viewvc/incubator/tuscany/java/das/ldap/das.ldap/

This is an EMF based implementation of a Data Access Service for LDAP.  I'll give you a quick
overview so that you get a sense of what pieces you might be able to extract information from
in order to enable your use cases.  In general it works like this (Note that Ecore is just
XMI, which is almost like XML Schema):

WRITE:
XML Schema > Ecore > Ecore Based Java Classes > Instance Graph > LDAP (ADS Only)
Annotated Java Interfaces > Ecore > Ecore Based Java Classes > Instance Graph >
LDAP (ADS Only)
Ecore > Ecore Based Java Classes > Instance Graph > LDAP (ADS Only)

Note that Ecore is the common denominator for all these other models (Annotated Java Intefaces,
XML Schema, etc).  For example one could do 
ObjectClasses > Ecore 

and then the rest is done, when using the DAS.

Note that DAS.write(graph) will write the ObjectClasses for the EObject instances, if they
don't already exist.  So if you replace the meta data provided by EObject instances via their
EClass instance, with java annotations you'll be able to use the same approach to generate
ObjectClasses.  However in order to understand how this works you have to know a little about
EClass instances.  This is a meta object contained by all EMF EObject instances (Which are
also Object instances).  They describe all the methods and properties of the EObject.  There's
a really good article on that here:

http://www.devx.com/Java/Article/29093

READ:
DAS.create(dn);  
That will restore the Graph using a generated factory

UPDATE:
DAS.update(graph);

Updates the correspnding LDAP entries per the objects in the graph.

DELETE:
DAS.delete(graph);

Delete the entire graph;

So if you understand how to work with an EClass (In addition to EAttribute and EReference
instances), you can examine the CRUD methods on the DAS to see how they perform the JNDI operations
that you would need to create an ObjectClass schema, delete one, store a java class per a
newly defined schema, etc.

Hope that helps.   

Cheers,
- Ole

Mime
View raw message