qeury for multiple node types

This is a discussion on qeury for multiple node types within the Apache forums in Application Servers & Tools category; I want to look for nodes which are of a special node type and hace a mixin attribute, but the query fails: /jcr:root/okm:root//(element(*, mix:notification) and element(*, okm:folder)) There is another way to perform this query?...

Go Back   Application Development Forum > Application Servers & Tools > Apache

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-21-2008, 12:58 PM
pavila@git.es
Guest
 
Default qeury for multiple node types

I want to look for nodes which are of a special node type and hace a mixin
attribute, but the query fails:

/jcr:root/okm:root//(element(*, mix:notification) and element(*, okm:folder))

There is another way to perform this query?


Reply With Quote
  #2  
Old 07-22-2008, 03:55 AM
Marcel Reutegger
Guest
 
Default Re: qeury for multiple node types

Hi,

you can only use a single element() test per location step. if you want to
filter multiple types you need to do that manually by checking jcrrimaryType
and jcr:mixinTypes properties. e.g.:

/jcr:root/okm:root//*[jcr:mixinTypes = 'mix:notification' and jcrrimaryType =
'okm:folder']

please note that this does not take the node type hierarchy into account. if you
also want to include sub types of okm:folder you need to explicitly specify that.

regards
marcel

pavila@git.es wrote:
> I want to look for nodes which are of a special node type and hace a mixin
> attribute, but the query fails:
>
> /jcr:root/okm:root//(element(*, mix:notification) and element(*, okm:folder))
>
> There is another way to perform this query?
>
>



Reply With Quote
  #3  
Old 07-22-2008, 05:21 AM
Paco Avila
Guest
 
Default Re: qeury for multiple node types

Ok, thanks!

The query can be re-written as:

/jcr:root/okm:root//element(*,
mix:notification)[@jcrrimaryType='okm:folder']

On Tue, Jul 22, 2008 at 9:55 AM, Marcel Reutegger <marcel.reutegger@gmx.net>
wrote:

> Hi,
>
> you can only use a single element() test per location step. if you want to
> filter multiple types you need to do that manually by checking
> jcrrimaryType and jcr:mixinTypes properties. e.g.:
>
> /jcr:root/okm:root//*[jcr:mixinTypes = 'mix:notification' and
> jcrrimaryType = 'okm:folder']
>
> please note that this does not take the node type hierarchy into account.
> if you also want to include sub types of okm:folder you need to explicitly
> specify that.
>
> regards
> marcel
>
> pavila@git.es wrote:
>
>> I want to look for nodes which are of a special node type and hace a mixin
>> attribute, but the query fails:
>>
>> /jcr:root/okm:root//(element(*, mix:notification) and element(*,
>> okm:folder))
>>
>> There is another way to perform this query?
>>
>>
>>

>


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:06 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.