Skip to main content
sreenu539
Level 7
May 7, 2018 8:26 PM UTC
Question

Retrieve the name of a node

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.

4 replies

joerghoh
Adobe Employee
Adobe Employee
May 7, 2018 9:09 PM UTC

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

Translate
sreenu539
sreenu539Author
Level 7
May 7, 2018 9:24 PM UTC

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

Translate
Level 2
Jun 14, 2024 3:20 PM UTC

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

Translate
smacdonald2008
Level 10
May 8, 2018 1:11 PM UTC

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

Translate