Expand my Community achievements bar.

SOLVED

Get List of locally created pages from local country site which are not rolled out from language-master

Avatar

Level 2

I have a MSM website, wherein I have a local country site under this path(/content/cognizant-dot-com/).

I want to list of locally created pages from "/content/cognizant-dot-com/ae/en", not coming from the master.

Can anyone share the Xpath query to review the results.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Hi @prachimathur 

You can group multiple properties like this and last line will help negate it

type=cq:PageContent
path=/content/sherwin/tag/aem-main
group.1_property=jcr:mixinTypes
group.1_property.value=%cq:LiveRelationship%
group.1_property.operation=like
group.2_property=cq:lastReplicationAction
group.2_property.value=Activate
group.p.not=true

 

View solution in original post

10 Replies

Avatar

Level 2

Hi @prachimathur 

You can try this SQL2 query using lastRolledout property. 

SELECT * FROM [nt:unstructured] AS s WHERE (ISDESCENDANTNODE([/content/*])) AND s.[sling:resourceType] = '<your page component resourceType' AND s.[cq:lastRolledout] IS NULL

 

replace your content node and resourceType accordingly

Avatar

Community Advisor

Hi @prachimathur 
I am not sure if you can list down those pages with just query.

If you are using groovy then simply write a scipt to crawl all the pages within tree and check the reliationshipStatus.



Arun Patidar

Avatar

Level 2

I'm using this query

/jcr:root/content/cognizant-dot-com//element(*, cq:Page)[jcr:content/jcr:mixinTypes and (not(jcr:like(jcr:content/jcr:mixinTypes, 'cq:LiveRelationship')))]  

but this give me result for all pages but I want for specific country

Avatar

Level 2

Hi @prachimathur 

In your query replace '/content/cognizant-dot-com/' with your country specific  node path '/content/cognizant-dot-com/ae/en'.

 

If that doesn't work you can try this query -

/jcr:root/content/cognizant-dot-com/ae/en//element(*, cq:PageContent)
[
not(jcr:like(@jcr:mixinTypes, '%cq:LiveRelationship%'))
]

Avatar

Level 2

Is there any way to use queryBuilder in this. Like how to apply this query in queryBuilder?

 

Avatar

Level 2

@prachimathur Somthing like this - 

type=cq:PageContent
path=/content/cognizant-dot-com/ae/en
group.property=jcr:mixinTypes
group.property.value=%cq:LiveRelationship%
group.property.operation=like
group.p.not=true

 

Avatar

Level 2

Hi,

If I want to apply one more property which is mentioned below in the same query then how to apply the and condition with not.

property=jcr:content/cq:lastReplicationAction
property.value=Activate

 

Avatar

Correct answer by
Level 2

Hi @prachimathur 

You can group multiple properties like this and last line will help negate it

type=cq:PageContent
path=/content/sherwin/tag/aem-main
group.1_property=jcr:mixinTypes
group.1_property.value=%cq:LiveRelationship%
group.1_property.operation=like
group.2_property=cq:lastReplicationAction
group.2_property.value=Activate
group.p.not=true

 

Avatar

Community Advisor

Hi @prachimathur 
You have to take care of broken live copy relationships yes well, so make sure either you exclude or include those based on your use case.



Arun Patidar

Avatar

Administrator

@prachimathur Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!



Kautuk Sahni