Alex Karasulu wrote:
BTW I like the new modified syntax you now use below. I think I have to get Groovy :).

Thanks Alex.

I have added support for modify ops to my little prototype. I am still investigating on how a handy syntax for that would look like. As an impression: This currently works (con is an LDAPConnection object):

---

// Adding a single attribute
//
descr = [ description: 'a singer-songwriter' ]
con.modify('cn=Heather Nova,dc=example,dc=com', 'ADD', descr)

// performing two operations atomically with one modify op
//
mods = [
    [ 'REPLACE', [description: 'a singer-songwriter, born in Bermuda'] ],
    [ 'ADD', [userPassword: 'secret'] ]
]
con.modify('cn=Heather Nova,dc=example,dc=com', mods)

---

My approach generally tries to imitate the original LDAP C API, and is therefore not really OO style. But people familiar to LDAP will perhaps like it ...

I have updated the wiki page, for those who are interested. Feedback is highly appreciated, especially from Groovy confessors.

http://cwiki.apache.org/confluence/display/DIRxSBOX/Groovy+LDAP

Greetings from Hamburg,
    Stefan


Reply via email to