cancel
Showing results for 
Search instead for 
Did you mean: 

CMIS query returns result from published site

mizage
Champ in-the-making
Champ in-the-making
Running this simple query from a class which extends SectionFactoryCmisImpl returns results from the Editorial and Live Stage.

select cmis:objectId from ws:section where ws:displayRSSFeedWidget={0}

Is there any way to avoid this and make the results stage specific?
2 REPLIES 2

bremmington
Champ on-the-rise
Champ on-the-rise
Yes. A ws:section node has a multi-valued property named ws:ancestorSections that contains the ids of all of its ancestor sections. You want to find the root section of the relevant website and constrain your query so it only returns sections that have the root section id as a value of their ws:ancestorSections property.

mizage
Champ in-the-making
Champ in-the-making
This seems to do the trick:

SELECT d.cmisSmiley SurprisedbjectId FROM ws:section AS d WHERE d.ws:displayRSSFeedWidget={0} AND in_tree(d,{1})

I pass in the root id.