Hi Aaron,

I'm not sure why you want to do this with LDAP search filters. Can you clarify what you want to do here essentially abstracting it from your specific application. Meaning what additional feature are you expecting from a search filter?

Thanks,
Alex

Emmanuel Lecharny wrote:

On Thu, 2005-08-04 at 11:00 -0400, Aaron Hamid wrote:
Hi,

I am intending to write a small service which maintains a list of "task" entries which can be submitted, acknowledged, and searched. The entries are going to be a fairly simple flat data structure with things like 'submittor', 'recipient', 'submission date', 'message', etc. Although I could write a search API which searches on individual fields, or perhaps a slightly more robust API that searches on a union of fields with implicit AND/OR semantics, I think it would be much more elegant to provide something like rfc 2254 ldap search s-expressions. My question is: does anybody know of a searchable Java context implementation? I have tried MirrorCtx, and although it does have the nice feature of persistence, it does not implement a searchable API (DirContext). Actually I think there are several shallow "java" context implementations (ubiquitously seen in applications like Tomcat, etc.), but I have not found any that provide search functionality. I'm thinking something
s
imple like commons-beanutils property syntax, or OGNL property syntax.

e.g. dirctx.bind(name, bean, ...); dirctx.search("java:/", 
"(|(&(color=red)(price>2)))(shape=round)(name=*foo*)))");

It seems like a searchable java context implementation would be useful in many 
areas.

Don't know if it's really related to a LDAP filter as described in RFC
2254, but if you think that it is, you may look here :

http://svn.apache.org/viewcvs.cgi/directory/shared/ldap/trunk/common/src/antlr

where you will find the Filter parser and here :

http://svn.apache.org/viewcvs.cgi/directory/shared/ldap/trunk/common/

if you want to generate the java files and compile it.

You may use it as a basis for what you want to do.

However, I'm not sure that is what you want (was it you on IRC
yesturday?). Let us know !

Emmanuel Lécharny






Reply via email to