Need to identify a query based on the property availability | Community
Skip to main content
samsundar23
Level 4
January 30, 2023
Solved

Need to identify a query based on the property availability

  • January 30, 2023
  • 2 replies
  • 1170 views

I'm using AEM 6.5.11. Can someone help me with a XPATH query that could give me the list of pages which has the particular property inside a particular node.

 

Below are details;

Page node: /content/sample-bank/personal/form
Type: cq:Page
property name: eventscript
property type: String

 

Please find the below screenshot - I want to get the list of pages under content path /content/sample-bank/personal/form, eventscript is one of the property in container node as shown below.

 

 

Note: There are 1000 of subpages under the cq:Page /content/sample-bank/personal/form which could have or don't have the property eventscript in the node /jcr:content/content/container

 

Kindly help. Thanks in advance.

 

Thanks
SHYAMSUNDAR TK

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Saravanan_Dharmaraj

I tried the similar sample query in we.retail also, its working for me.

type=cq:Page
path=/content/we-retail/us/en/products/men
property=@jcr:content/image/fileReference
property.operation=exists
p.hits=full
p.limit=-1

2 replies

Saravanan_Dharmaraj
Community Advisor
Community Advisor
January 30, 2023

Hi @samsundar23 

Could you please try this below query in debugger and see if brings the results. 

 

type=cq:Page
path=/content/sample-bank/personal/form
property=@jcr:content/content/container/eventscript
property.operation=exists
p.hits=full
p.limit=-1

samsundar23
Level 4
January 30, 2023

@saravanan_dharmaraj  - This is not giving me the list of pages bro. Basically, eventscript is available as one of the property in the container node as shown below.

 

 

 

Saravanan_Dharmaraj
Community Advisor
Saravanan_DharmarajCommunity AdvisorAccepted solution
Community Advisor
January 30, 2023

I tried the similar sample query in we.retail also, its working for me.

type=cq:Page
path=/content/we-retail/us/en/products/men
property=@jcr:content/image/fileReference
property.operation=exists
p.hits=full
p.limit=-1

DEBAL_DAS
January 30, 2023

Could you please one of the query below and let me know if it works -

Option:1

path=/content/we-retail/language-masters/en type=cq:Page property=jcr:content/content/container/eventscript property.operation=exists p.limit=-1 XPath query /jcr:root/content/we-retail/language-masters/en//element(*, cq:Page) [ (jcr:content/content/container/@eventscript) ]

 

Option2:

path=/content/we-retail/language-masters/en nodename=container property=eventscript property.operation=exists p.limit=-1

 

XPath query /jcr:root/content/we-retail/language-masters/en//* [ (fn:name() = 'container' and @eventscript) ]

 

Regards,

Debal