DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Key: NUCLDAP-50
Type: Bug Bug
Status: Closed Closed
Resolution: Incomplete
Priority: Testcase Required Testcase Required
Assignee: Unassigned
Reporter: Stefaan Van Cauwenberge
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store LDAP

Unable to specify search scope. Scope is always subtree.

Created: 11/May/12 02:08 PM   Updated: 11/Apr/16 10:31 AM   Resolved: 30/Mar/16 08:58 AM
Component/s: Queries
Affects Version/s: 3.1.0.m3
Fix Version/s: None

File Attachments: 1. Java Source File DNFieldFetcher.java (2 kB)
2. File ldap.diff (13 kB)
3. Zip Archive patch.zip (42 kB)

Environment: all

Datastore: LDAP
Severity: Proof of Concept


 Description  « Hide
When you specify an LDAP object in the configuration, you are unable to specify the search scope (unless you use an ldap url). Using the table as in
table="{parentContainer}|cn=RoleConfig,cn=AppConfig,cn=User Application Driver,cn=driverset1,o=system"
will always perform a subtree search.l

Sort Order: Ascending order - Click to sort in descending order
Stefaan Van Cauwenberge added a comment - 11/May/12 02:54 PM
Files for issues
NUCLDAP-49
NUCLDAP-50
NUCLDAP-51

Tested on eDirectory and openLDAP.

After I fixed the issue localy, I merged it with the latest version (3.1.0.m3). I hope it still works.

This patch supports the following:
1. A field definition of "dn" will always contain the dn of the object.
Example:
            <field
                  name="dn"
                  persistence-modifier="persistent"
                  primary-key="true"
                  column="dn"/>

2. Extention on the class to add the search scope:
Example:
<extension vendor-name="opns" key="scope" value="SUBTREE_SCOPE"/>

Possible values are the SearchControl.xxx constants.

3. Support for the attribute recursion-depth on the field definition.
Supported values: 0, 1 and 2 (the actual values of the SearchControl.xxx constants).
Example:
            <field
                  name="parentContainer"
                  persistence-modifier="persistent"
                  default-fetch-group="true"/>
            <field
                  name="childContainers"
                  persistence-modifier="persistent"
                  mapped-by="parentContainer"
                  recursion-depth="1">
                  </field>


Stefaan

Andy Jefferson added a comment - 06/Jul/12 09:59 AM
Hi, thx for the diffs, but sadly they don't apply to SVN trunk. Could you please regenerate it, using SVN trunk as the basis and attach a single "patch" file ("diff -u" format).

Stefaan Van Cauwenberge added a comment - 22/Oct/12 08:55 PM
New diff file.
Diff with version 3.1

I hope this one does the trick for you.

This fix includes support for:
- The dn attribute in the object, both in PersistenceManager.newQuery(...) and PersistenceManager.getObjectById, allowing primary-key="true" on the dn attribute (enabling caching of objects with the same naming value but a different context).
- A lot less query towards the ldap (no need to require the ldap to get the DN every 5 seconds...). The dn is associated with the object itself.
- Support for extention 'opns' for search controlling scope (method LDAPUtils.getSearchControls). If included it the release, the extention name should be

Stefaan

Andy Jefferson added a comment - 22/Oct/12 09:02 PM
Thx but please, a ***patch*** file against latest codebase. Patch is also known as "diff -u" or "unified diff".

Stefaan Van Cauwenberge added a comment - 22/Oct/12 09:05 PM
It seems that the diif does not include new class files. Attached the new class file I added: DNFieldFetcher.

Andy Jefferson added a comment - 30/Mar/16 08:58 AM
No testcase provided after 3.5 years!