You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Weijian Fang <wf...@ecs.soton.ac.uk> on 2007/05/10 16:54:26 UTC

Is there a tool to convert LDAP data to Java bean based on schema

Hi,

Is there a tool to convert LDAP data to Java bean based on LDAP
schema? What I want is quite like what JAXB does on XML. Given an XML
schema, JAXB is able to generate Java classes that translate schema
compliant XML to Java beans and back. Now I have a LDAP schema, and a
LDAP server where data complies with the scheam. I need to read LDAP
data and conert to Java beans. I can do this manually. But if there is
a tool able to automatically generate the code based on the LDAP
schema, it wiil be great!

Is there such a tool? Any hint? Thanks a lot!

Cheers,

Weijian

Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Stefan Zoerner <st...@labeo.de>.
Weijian Fang wrote:
> Is there a tool to convert LDAP data to Java bean based on LDAP
> schema? What I want is quite like what JAXB does on XML. Given an XML
> schema, JAXB is able to generate Java classes that translate schema
> compliant XML to Java beans and back. Now I have a LDAP schema, and a
> LDAP server where data complies with the scheam. I need to read LDAP
> data and conert to Java beans. I can do this manually. But if there is
> a tool able to automatically generate the code based on the LDAP
> schema, it wiil be great!
> 
> Is there such a tool? Any hint? Thanks a lot!

I had a conversation after a talk on the JAX conference last month. A 
participant had exactly the same question. We thought about generating 
classes which implement the JNDI interfaces StateFactory and 
ObjectFactory from schema elements. This would be a nice feature within 
Directory LDAP Studio. But no, we have not implemented it yet. Perhaps 
we should?

Greetings, Stefan




Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Weijian Fang <wf...@ecs.soton.ac.uk>.
Thanks for your quick response!

On 10/05/07, Emmanuel Lecharny <el...@apache.org> wrote:
> Weijian Fang a écrit :
>
> > Hi,
>
> Hi !
>
> >
> > Is there a tool to convert LDAP data to Java bean based on LDAP
> > schema? What I want is quite like what JAXB does on XML. Given an XML
> > schema, JAXB is able to generate Java classes that translate schema
> > compliant XML to Java beans and back. Now I have a LDAP schema, and a
> > LDAP server where data complies with the scheam. I need to read LDAP
> > data and conert to Java beans. I can do this manually. But if there is
> > a tool able to automatically generate the code based on the LDAP
> > schema, it wiil be great!
>
> I haven't heard of such a tool. But this would be pretty easy to write
> one. We have a tool which converts Schema files to Ldif files, and one
> could easily create something which generates Java classes.
>
> Wanna try ?
>
Sure. Please send me the tool and possibly some doc. And please tell
me more hints on how to do it.

Thanks a lot!

Weijian


> Emmanuel
>
>

Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Emmanuel Lecharny <el...@apache.org>.
Weijian Fang a écrit :

> Hi,

Hi !

>
> Is there a tool to convert LDAP data to Java bean based on LDAP
> schema? What I want is quite like what JAXB does on XML. Given an XML
> schema, JAXB is able to generate Java classes that translate schema
> compliant XML to Java beans and back. Now I have a LDAP schema, and a
> LDAP server where data complies with the scheam. I need to read LDAP
> data and conert to Java beans. I can do this manually. But if there is
> a tool able to automatically generate the code based on the LDAP
> schema, it wiil be great!

I haven't heard of such a tool. But this would be pretty easy to write 
one. We have a tool which converts Schema files to Ldif files, and one 
could easily create something which generates Java classes.

Wanna try ?

Emmanuel


Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Ole Ersoy <ol...@gmail.com>.
Hi Weijian,


Weijian Fang wrote:
> Hi,

SNIP

 > I need to read LDAP
> data and convert to Java beans. I can do this manually. But if there is
> a tool able to automatically generate the code based on the LDAP
> schema, it wiil be great!

We are working on a DAS for LDAP
(See Tuscany RDB DAS)

This tool will be able to start with an XML Schema,
write the corresponding LDAP Schema, and perform CRUD with
SDO DataGraph instances (Effectively object graphs where
each object has a change summary for fast updates, etc.)

So you will be able to go from XML Schema to LDAP.
If you write a tool that generates the XML Schema
from the LDAP Schema, then you have what you are
searching for, once the DAS is complete.

You will be able to go from/to XML Schema/LDAP Schema,
and have a Apache Licensed (Tuscany) or Eclipse Licensed (EMF)
SDO API
to work with.

We are hanging on some Exceptions with the new
Schema Capabilities new in 1.5.0, so it may be a little
while before the DAS is done, but once these are cleared,
it should go very quickly.

Cheers,
- Ole


Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Ole Ersoy <ol...@gmail.com>.
Hi Weijian,

In case you are still interested,
I'll be publishing a new revision
of the DAS LDAP Design Guide in a few days.

This is written as a cook book for how
to write the DAS, so it should be fairly straight
forward to follow.

Also - Apache Tuscany is very supportive
of this approach (We've had many discussions already)
and the project will
likely be moved into Tuscany as soon
as the initial implementation is complete.

I could have a working implementation
right now that reads and writes data graphs,
but there are a few bugs in the ADS
Dynamic Schema capabilities that need to be cleared
first.  As soon as that's done I'll commit to
having an implementation that reads and writes SDO DataGraphs
within 10 days.

Note that SDO DataGraphs are really XSD Instances
and SDO was designed to use XML Schema for Typing.

Cheers,
- Ole


Alex Karasulu wrote:
> Hi Weijian,
> 
> As others have already confirmed such a tool does not exist in 
> totality.  There
> were some efforts out there with partial support for such functionality. 
> 
> Spring LDAP (not really but handles some glue code)
> Hibernate LDAP (incomplete)
> Castor LDAP (some say it is complete but I have not tried it)
> 
> BTW it would be nice to start such an effort here.  There are several 
> interesting
> approaches one of which was mentioned by Stefan Zoerner regarding he use of
> Object and State factories for JNDI.  I thought heavily about this a 
> while back however
> there are some issues with using OF and OS namely in the area of 
> managing references
> in an object graph.  I think the DAS stuff Ole spoke about has potential 
> however
> the timeline is unknown and we only have one person looking into it at 
> the moment.
> 
> If enough people are interested I think we can find a solid approach 
> with a visible
> timeline to implement such a Object-LDAP (OL) mapping tool.
> 
> HTH,
> Alex
> 
> 
> On 5/10/07, *Weijian Fang* <wf@ecs.soton.ac.uk 
> <ma...@ecs.soton.ac.uk>> wrote:
> 
>     Hi,
> 
>     Is there a tool to convert LDAP data to Java bean based on LDAP
>     schema? What I want is quite like what JAXB does on XML. Given an XML
>     schema, JAXB is able to generate Java classes that translate schema
>     compliant XML to Java beans and back. Now I have a LDAP schema, and a
>     LDAP server where data complies with the scheam. I need to read LDAP
>     data and conert to Java beans. I can do this manually. But if there is
>     a tool able to automatically generate the code based on the LDAP
>     schema, it wiil be great!
> 
>     Is there such a tool? Any hint? Thanks a lot!
> 
>     Cheers,
> 
>     Weijian
> 
> 

Re: Is there a tool to convert LDAP data to Java bean based on schema

Posted by Alex Karasulu <ak...@apache.org>.
Hi Weijian,

As others have already confirmed such a tool does not exist in totality.
There
were some efforts out there with partial support for such functionality.

Spring LDAP (not really but handles some glue code)
Hibernate LDAP (incomplete)
Castor LDAP (some say it is complete but I have not tried it)

BTW it would be nice to start such an effort here.  There are several
interesting
approaches one of which was mentioned by Stefan Zoerner regarding he use of
Object and State factories for JNDI.  I thought heavily about this a while
back however
there are some issues with using OF and OS namely in the area of managing
references
in an object graph.  I think the DAS stuff Ole spoke about has potential
however
the timeline is unknown and we only have one person looking into it at the
moment.

If enough people are interested I think we can find a solid approach with a
visible
timeline to implement such a Object-LDAP (OL) mapping tool.

HTH,
Alex


On 5/10/07, Weijian Fang <wf...@ecs.soton.ac.uk> wrote:
>
> Hi,
>
> Is there a tool to convert LDAP data to Java bean based on LDAP
> schema? What I want is quite like what JAXB does on XML. Given an XML
> schema, JAXB is able to generate Java classes that translate schema
> compliant XML to Java beans and back. Now I have a LDAP schema, and a
> LDAP server where data complies with the scheam. I need to read LDAP
> data and conert to Java beans. I can do this manually. But if there is
> a tool able to automatically generate the code based on the LDAP
> schema, it wiil be great!
>
> Is there such a tool? Any hint? Thanks a lot!
>
> Cheers,
>
> Weijian
>