Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Retrieve the name of a node

Avatar

Level 7

i am working on aem 6.3 and would like to get page name

SELECT * FROM [cq:Page] WHERE ISDESCENDANTNODE("/content/Product/Silhouettes/Accessories/Bands/Headband")

If I need to retrieve name of the nodes using sql-2 , how do I achieve it?

4 Replies

Avatar

Employee Advisor

If your query is that simple, traversing the content tree is probably faster :-)

if you use JCR query, you have a QueryResult object; on this you can execute "getNodes" to retrieve a NodeIterator object. Use this to get the actual nodes, and on the node you can call .getName().

Node (Content Repository for Java Technology API Version 2.0)

Jörg

Avatar

Level 7

I am using ACS-COMMONS page report tool page to generate a report for pages. It is great and I need a new column there which is "NAME" of page.

I tried various values for property value of text column to display the name but not successful.

Following are the text column property values I tried : name, name(), name(s), name(*), jcr:name, jcr:content/jcr:name, jcr:content/metadata/jcr:name, NAME, NAME(), NAME(*), NAME(s)

Any help ?

Business wants report of all pages with specific information in csv format

Avatar

Level 2

@sreenu539 were you able to find a solution for your problem? I am also interested in finding a solution to reporting on the page or node "name".

I can successfully report on the page title using:

jcr:content/jcr:title

But I'm unable to find a way to report on the page name.

Avatar

Level 10

If you want to get Page information from the AEM JCR - you should be using the com.day.cq.wcm.api.Page API - see com.day.cq.wcm.api.Page

Here is an older AEM Community article that can help you get up and running with this API -- Adobe Experience Manager Help | Using Sling APIs to retrieve content from the Adobe Experience Manag...