directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grégory Joseph (JIRA) <>
Subject [jira] Updated: (DIRGROOVY-7) Support for "returning attributes" in searches
Date Thu, 15 Apr 2010 17:47:49 GMT


Grégory Joseph updated DIRGROOVY-7:

    Attachment: DIRGROOVY-7.patch

Here's the patch.

It does one additional thing: the keys of the map returned by {{o.a.d.g.jndi.DirContextToMapObjectFactory#getObjectInstance}}
are NOT lowercased anymore; I found it very confusing to request the {{modifyTimestamp}} attribute
but have to use {{modifytimestamp}} on my search results. Granted, now, if one requests {{modifytimestamp}},
they'll have to use {{modifyTimestamp}} too. The best would probably to do what ldap does,
ie ignore the case of attribute names.

ps: can't edit my own issue to fix the layout of the description, sorry. (I assumed the wiki-like
syntax was enabled, apparently it's not)

> Support for "returning attributes" in searches
> ----------------------------------------------
>                 Key: DIRGROOVY-7
>                 URL:
>             Project: Directory Groovy LDAP
>          Issue Type: Improvement
>            Reporter: Grégory Joseph
>            Assignee: Stefan Zoerner
>         Attachments: 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')
>         'base': 'ou=users',
>         'filter': '(objectClass=posixAccount)',
>         'attrs': ['uid','cn',
>                 'createTimestamp', 'creatorsName',
>                 'modifyTimestamp', 'modifiersName'
>         ]
> ).each {
>     println """${it.uid}: ${}
>     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.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message