Retrieve the name of a node | Community
Skip to main content
sreenu539
Level 7
May 7, 2018
Question

Retrieve the name of a node

  • May 7, 2018
  • 3 replies
  • 3759 views

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?

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

3 replies

joerghoh
Adobe Employee
Adobe Employee
May 7, 2018

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

sreenu539
sreenu539Author
Level 7
May 7, 2018

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

Level 2
June 14, 2024

@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.

smacdonald2008
Level 10
May 8, 2018

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 Manager Repository