directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Zoerner (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (DIRGROOVY-7) Support for "returning attributes" in searches
Date Wed, 01 Sep 2010 09:00:55 GMT

     [ https://issues.apache.org/jira/browse/DIRGROOVY-7?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Stefan Zoerner resolved DIRGROOVY-7.
------------------------------------

    Resolution: Fixed

I have tested and added the patch to the current trunk
http://svn.apache.org/viewvc?view=rev&revision=991481
Thanks for the improvement.

> Support for "returning attributes" in searches
> ----------------------------------------------
>
>                 Key: DIRGROOVY-7
>                 URL: https://issues.apache.org/jira/browse/DIRGROOVY-7
>             Project: Directory Groovy LDAP
>          Issue Type: Improvement
>            Reporter: Grégory Joseph
>            Assignee: Stefan Zoerner
>         Attachments: DIRGROOVY-7.patch, DIRGROOVY-7.patch
>
>
> While the {{o.a.d.groovyldap.Search}} currently holds an {{attrs}} array for these, and
they are set accordingly on the SearchControls instance, 2 things are missing to make it useful:
> * support for this in the Map-based constructor
> * {{o.a.d.groovyldap.jndi.DirContextToMapObjectFactory}} should use these attributes
(they're passed as {{attrs}} to the {{getObjectInstance}} instance) instead of getting all
attributes from the current record.
> This would have two benefits:
> * a presumed performance gain ? (I've always assumed that's one of the reasons for passing
"returning attributes" to searches)
> * the ability to retrieve operational attributes such as 'createTimestamp' and 'modifyTimestamp'
which are not retrieved when not specified explicitly.
> I'll attach a patch that makes the following code work:
> {code}
> def LDAP ldap = LDAP.newInstance('ldap://localhost/dc=example,dc=com')
> ldap.search(
>         'base': 'ou=users',
>         'filter': '(objectClass=posixAccount)',
>         'attrs': ['uid','cn',
>                 'createTimestamp', 'creatorsName',
>                 'modifyTimestamp', 'modifiersName'
>         ]
> ).each {
>     println """${it.uid}: ${it.cn}
>     mod: ${it.modifyTimestamp} (${it.creatorsName})
>     cre: ${it.createTimestamp} (${it.modifiersName})"""
> }{code}
> (with the current groovyldap, the "mod" and "cre" lines print nulls)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message