jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject [OCM] Add simple query API
Date Fri, 31 Aug 2007 13:13:16 GMT
Hi all,

In our day-to-day use of JCR and the OCM, we discovered, that often
times we have a simple requirement to shoot a query at the repository
and just get the nodes returned. This contrasts the full-blown query
support available through the JCR QueryManager. Likewise, the OCM has
its own QueryManager with its Filter interface and mechanism. Here, too,
often times, it seems easier to just shoot a known query and get the
objects back that to build a filter to execute.

For this reason, Betrand and I propose the following addition to the
ObjectContentManager interface:

     Iterator getObjects(String queryExpression, String language) throws
            OCMInvalidSyntaxException, ObjectContentMappingException;

     OCMInvalidSyntaxException extends ObjectContentMappingException
            wrapping the JCR InvalidSyntaxException

The intent is to get an Iterator of objects mapped from the nodes
returned by the queryExpression given in the query language. The
queryExpression and language are used to create the JCR Query from whose
result the mapped objects are retrieved.

We know, that this is just kind of a utility function but nonetheless a
often used one.

What do you think of this addition ? If there is enough interest - at
least we are interested as well as some Sling-based applications might
be - we have a patch handy to implement this.

Any feedback is welcome.


View raw message