From: Graham B. <gb...@po...> - 2001-07-24 23:18:43
|
----- Forwarded message from Christoph Neumann <en...@ap...> ----- Date: Fri, 20 Jul 2001 16:18:28 -0700 (PDT) To: Graham Barr <gb...@po...> From: Christoph Neumann <en...@ap...> Subject: Expression to Filter Conversion In-Reply-To: <200...@po...> Graham, 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. Examples: 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 features? - Christoph Neumann Database and Directory Services Administrator Azusa Pacific University ----- End forwarded message ----- |