jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Fwd: Searching repository content
Date Fri, 23 Sep 2005 08:46:37 GMT
Christophe Lombart wrote:
> Is it possible to search on multiple primary node types and/or  mixin
> node types ?
> If I understand, it can differ from one JCR implementation to another.
> What is the implementation choice in Jackrabbit ?

With the current implementation this is not possible in general, because 
only one element() node test is supported per path step. However the 
XPath syntax defines a union operator for such a use case:

//(element(*, nt:file) | element(*, nt:folder))

this would return all that are either nt:file or nt:folder nodes *or* of 
any subtype of nt:file or nt:folder.
But as I said, this is currently not supported by Jackrabbit.

What you may use already is the following:

//*[@jcr:primaryType = 'nt:file' or @jcr:primaryType = 'nt:folder']

however, this will only return nodes of type nt:file or nt:folder but no 
nodes of subtypes.

To sum up: there is currently no convenient way to search on multiple 
node / mixin types, but with the help of the NodeTypeManager you are 
still able to search multiple node type hierarchy trees, by creating an 
or expression that covers all types you are interested in.

regards
  marcel

Mime
View raw message