Expand my Community achievements bar.

SOLVED

ACS Common Report Tool

Avatar

Level 7

Hi All,
I have a requirement where I need get the report of all the page which is under let say /content/project/websites/en-us/ and having template /conf/testing/settings/wcm/templates/wrapper-template and the value of content propery: 
example :

tushaar_srivastava_0-1673527030983.png

Now fetch all the pages with particular template and get the property value of content which is String[] under /content/project/website/en-us/test1/jcr:content/root/container/wrapper

tushaar_srivastava_1-1673527188786.png

 

 

I tried to do this using ACS Common Report tool where I wrote a query

SELECT * FROM [cq:Page] AS nodes WHERE (isdescendantnode('{{path}}')) AND nodes.[jcr:content/cq:template]='/conf/testing/settings/wcm/templates/wrapper-template' AND (nodes.[jcr:content/root/container/wrapper] ='' OR  nodes.[jcr:content/root/container/wrapper] IS NULL )

 

Can anyone please help here to correct me the query to get the property of string[] of content. because using this I am not able to get the multiple value of property inder /jcr:content/root/container/wrapper [content[]]

 

 

Thanks 

 

@kautuk_sahni  @arunpatidar  @BrianKasingli 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi,

You need to write a joined query

Example

SELECT child FROM [cq:Page] AS parent 
INNER JOIN [nt:unstructured] AS child ON ISCHILDNODE(child,parent) 
WHERE ISDESCENDANTNODE(parent, '{{path}}') AND parent.[jcr:content/cq:template]='/conf/testing/settings/wcm/templates/wrapper-template' AND child.[sling:resourceType] = 'migration/components/wrapper'

 



Arun Patidar

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi,

You need to write a joined query

Example

SELECT child FROM [cq:Page] AS parent 
INNER JOIN [nt:unstructured] AS child ON ISCHILDNODE(child,parent) 
WHERE ISDESCENDANTNODE(parent, '{{path}}') AND parent.[jcr:content/cq:template]='/conf/testing/settings/wcm/templates/wrapper-template' AND child.[sling:resourceType] = 'migration/components/wrapper'

 



Arun Patidar

Avatar

Level 7

Thank you @arunpatidar   this really helped me, and the issue was I need to read the multi value of a property content which is under node jcr:content/root/container/wrapper, I was passing Property payload wrong in report tool It was passing /jcr:content/root/container/wrapper instead of: 

tushaar_srivastava_1-1673594712577.png