Welcome Guest  |  Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | Help


Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 33
Posts: 33   Pages: 4   [ Previous Page | 1 2 3 4 | Next Page ]
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4831 times and has 32 replies Next Thread
Male azevedo
Newbie




Joined: Nov 27, 2008
Post Count: 17
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

So why not raise that JIRA issue you were going to open, and then you can attach a patch to it. I'm sure Stefan would welcome it


Hi

I will open the issue an post the code in there and leave it to Stefan to review and modify my code.


I was wondering if it would not be better to have this filed base like Stefan point before. Also I why not have it Annotated? Like

@DnQuantifier(vendor="DataNucleus")
private String dnQuantifier;


azevedo
[Dec 4, 2008 4:26:02 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male seelmann
Novice




Joined: Jul 2, 2008
Post Count: 36
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

I'm not happy with this dn-qualifiery solution. This way you need to add datastore specific logic into the business class. I think all datastore specific stuff should only be configured using metadata.
[Dec 4, 2008 10:59:47 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 1009
Status: Online
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Just my 2 cents.
I think that the identity of an object must be its full distinguished name, so when you call getObjectById(), the object is simply
retrieve with a Context.lookup().
When you Query the LDAP, the depth could be just controlled by a query extension.
But it is too simple, the must be something I miss....

Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Dec 4, 2008 11:57:13 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male andy
Expert
Member's Avatar

UK
Joined: Mar 13, 2004
Post Count: 5686
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

I'm not happy with this dn-qualifiery solution. This way you need to add datastore specific logic into the business class. I think all datastore specific stuff should only be configured using metadata.

Sure it should but how are you going to configure "persist object X to location X1, persist object Y to location Y1, etc" in metadata ? (JDO has instance callbacks, and JDO/JPA have lifecycle listeners that you could hook into). Data Federation support will, in principle, allow more control over object-by-object persistence but that is not implemented. So awaiting your solution wink
----------------------------------------
-Andy smile

[Dec 5, 2008 9:00:28 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male seelmann
Novice




Joined: Jul 2, 2008
Post Count: 36
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi azevedo,

I thought a bit more about your problem. I started to design different mapping strategies for object relationships in the last few weeks and I think your usecase perfectly fits "hierarchical mapping".

You could create one Java class for each level of your directory tree and define a 1-N (or N-1) relationship between them.

Please see [1] for a draft, especially section "N-1 Unidirectional". I started to implement it and it seems to work well smile . Any feedback is welcome.

[1] http://www.jpox.org/servlet/wiki/display/ENG/Hierarchical+Mapping
[Dec 10, 2008 12:33:34 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male azevedo
Newbie




Joined: Nov 27, 2008
Post Count: 17
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi azevedo,

I thought a bit more about your problem. I started to design different mapping strategies for object relationships in the last few weeks and I think your usecase perfectly fits "hierarchical mapping".

You could create one Java class for each level of your directory tree and define a 1-N (or N-1) relationship between them.

Please see [1] for a draft, especially section "N-1 Unidirectional". I started to implement it and it seems to work well smile . Any feedback is welcome.

[1] http://www.jpox.org/servlet/wiki/display/ENG/Hierarchical+Mapping


applause

Hi seelmann ,

I think this is a good approach of the problem. If I am getting it right, there is a single orgUnit class that holds a reference to its parent. I just need to construct the orgUnit (class) from which I want a children and pass it to the children class and run the query on it. Am I right? Where can I get the binaries to run a test?

azevedo
[Dec 10, 2008 8:38:27 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male ganzuoni
Expert
Member's Avatar


Joined: Nov 16, 2005
Post Count: 1009
Status: Online
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi azevedo,

I thought a bit more about your problem. I started to design different mapping strategies for object relationships in the last few weeks and I think your usecase perfectly fits "hierarchical mapping".

You could create one Java class for each level of your directory tree and define a 1-N (or N-1) relationship between them.

Please see [1] for a draft, especially section "N-1 Unidirectional". I started to implement it and it seems to work well smile . Any feedback is welcome.

[1] http://www.jpox.org/servlet/wiki/display/ENG/Hierarchical+Mapping

Another approach could be allowing for object identity being composed by a local part (i.e. the rdn) and a "foreign-key".
The wiki example would become:

<jdo>
<package name="org.datanucleus.samples.directory.hierarchical1">

<class name="OrgUnit" table="dc=example,dc=com" schema="top,organizationalUnit">
<field name="name" primary-key="true" column="ou" />
</class>

<class name="Person" schema="top,person,organizationalPerson,inetOrgPerson">
<field name="uniqueId" primary-key="true" column="uid" />
<field name="orgUnit" primary-key="true" />
<field name="fullName" column="cn" />
<field name="firstName" column="givenName" />
<field name="lastName" column="sn" />
</class>

</package>
</jdo>


This enhancement would be appreciated for RDBMS store too wink
(Together with column sharing among different foreign-keys)

Guido
----------------------------------------
Guido Anzuoni
http://www.objectmagic.org
[Dec 10, 2008 12:15:37 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male seelmann
Novice




Joined: Jul 2, 2008
Post Count: 36
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi azevedo,
Yes, you are right. You get the instance of orgUnit from the datastore (getObjectById()). I'm still implementing it, so stay tuned please.

Hi Guido,
that a good idea, I'll try that.
[Dec 10, 2008 7:28:03 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Male belgacem
Newbie



Tunisia
Joined: Mar 12, 2010
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi,

i am encountering the same problem. Is there any way now to change the search scope to SUBTREE_SCOPE?

Thank you in advance

Baligh
[Mar 12, 2010 3:21:06 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male seelmann
Novice




Joined: Jul 2, 2008
Post Count: 36
Status: Offline
Reply to this Post  Reply with Quote 
Re: Ldap SearchControls

Hi,

you have two options:

1st: the recommended approach is to model your java classes according your directory tree and to define a class for each hierarchy in your LDAP. See
http://www.datanucleus.org/products/accessplatform_2_0/ldap/hierarchical.html

2nd: you could define an LDAP URL search base, e.g.
<class name="User" table="ldap:///dc=example,dc=com??sub" schema="top,person">
This is implemented but not well tested and not documented, so use it at you own risk ;-) Additionally note that this should only be used for searching because if you persist a new object of that type it will be created directly below the search base.

Kind Regards,
Stefan
[Mar 12, 2010 9:32:47 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Posts: 33   Pages: 4   [ Previous Page | 1 2 3 4 | Next Page ]
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread