From: Graham Barr <gbarr@po...> - 2001-07-24 23:18:43
----- Forwarded message from Christoph Neumann <enigma@...> -----
Date: Fri, 20 Jul 2001 16:18:28 -0700 (PDT)
To: Graham Barr <gbarr@...>
From: Christoph Neumann <enigma@...>
Subject: Expression to Filter Conversion
I would appreciate if I could get your opinion. I created a library that
translates traditional boolean style expressions into the LDAP filter
syntax. When I need to construct a query based on user input, I find it
easier to construct the boolean expressions than the LDAP filters. The
nested nature of the LDAP filter makes them difficult to read and
construct. Also, the LDAP design choice to minimize the set of comparison
operators is annoying.
Expression: cn = *Neumann && uid = e*
Filter : (&(cn=*Neumann)(uid=e*))
The library supports operator precidence and parenthetical grouping. Also,
it handles translating comparison operators that LDAP does not support into
their logical eqivalents.
Expression: uid >= E && uid < F
Filter : (&(uid>=E)(!(uid>=F)))
It supports the ! operator too.
Expression: cn >= C && cn < D || ! ( uid = t* && uid != test* )
Filter : (|(&(cn>=C)(!(cn>=D)))(!(&(uid=t*)(!(uid=test*)))))
Do you know of any other publically available libraries to do this? I
couldn't find any. Do you think this is something that would be nice to
incorporate into the Net::LDAP suite? Maybe something like
"Net::LDAP::Filter::Expression"? Do you have any recommendations for
- Christoph Neumann
Database and Directory Services Administrator
Azusa Pacific University
----- End forwarded message -----
Get latest updates about Open Source Projects, Conferences and News.