jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Zdila <m.zd...@mwaysolutions.com>
Subject Re: XPath ignoring predicate
Date Tue, 06 May 2008 19:43:29 GMT
Thanks for the helpful reply, Jukka.

I also think that for unsupported constructs an appropriate exception should  
be thrown.

I hope that in the JCR 2 specifications the query language will be required to 
be more powerful as this is really a key in many usecases.

Just if you are interested, my usecase is to store ACL in the nodes in the 
node hierarchy:

/my-node1 (someProperty = ...)
    /owner (username = ...)
          /sid (nodeType = userSid, username = ...)

For my-node listing purposes it is necessary for query engine to support:
- query nodes that can be accessed by current user
- apply user filter (applied to node and its subnode properties)
- sorting
- pagination (limit offset)

I am not 100% sure, but AFAIK child-axis predicates were not supported in some 
near previous version (at least they didn't work for me). Now it seems that 
they work sufficiently to support child axis filtering, which is also kind of 
superset of ACL matching. And I am also glad that sorting and proprietary 
Jackrabbit's implementation dependent pagination is supported.


On Tue 6. May 2008 20:21:53 Jukka Zitting wrote:
> Hi,
> On Mon, May 5, 2008 at 9:57 AM, Martin Zdila <m.zdila@mwaysolutions.com> 
> >  I have nodes named "aaa" and if I execute XPath query
> > "//aaa[nonexistingnode] then all "aaa" nodes are returned regardless if
> > they contain nonexisting node or not. Is that a bug?
> The JCR spec doesn't require support for such queries, and though we
> have added some support for the child axis within predicates (see for
> example JCR-247), there still are a number of cases like this that
> don't work.
> You can file a feature request for such child node existence
> predicates, or a bug report for the fact that such unsupported queries
> are not rejected by the Jackrabbit query manager.
> >  Second strange thing: //*[name() = 'aaa'] returns nothing even I have
> > nodes named "aaa" in my repository.
> Try //*[fn:name() = 'aaa'], see JCR-857.
> Again, Jackrabbit should reject queries with functions or other
> constructs that are not supported.
> >  Third strange thing: if I execute //*[aaa] query, then
> > nodeIterator.getSize() returns -1. Another bug?
> A feature. RangeIterator.getSize() is allowed to return -1 in case the
> size of the collection is unknown.
> BR,
> Jukka Zitting

Martin Zdila 

M-Way Solutions Slovakia s.r.o.
Letna 27, 040 01 Kosice

xmpp:zdila@jabbim.sk (Jabber)

View raw message