How to query all empty folders in AEM DAM? | Community
Skip to main content
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 arunpatidar
 

According to https://docs.jboss.org/author/display/MODE50/JCR-SQL2#JCR-SQL2-SinceModeShape4.0: it is not possible to query nodes with no children in JCR-SQL2.

You must write a simple groovy script to get all the folders node and check if there is a child node or not.

 

Although in SQL2 you can get nodes with children node using joins

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 7, 2023
 

According to https://docs.jboss.org/author/display/MODE50/JCR-SQL2#JCR-SQL2-SinceModeShape4.0: it is not possible to query nodes with no children in JCR-SQL2.

You must write a simple groovy script to get all the folders node and check if there is a child node or not.

 

Although in SQL2 you can get nodes with children node using joins

Arun Patidar
Manu_Mathew_
Community Advisor
Community Advisor
March 7, 2023

@jezwn You can probably use the Asset API- http://localhost:4502/api/assets.json

and traverse the nodes and look for properties(total). However, this may not be a go-to approach. Groovy would be better.