Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How to query all empty folders in AEM DAM?

Avatar

Level 5

Is there a way to query all empty folders in AEM DAM.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor
 

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor
 

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

Avatar

Community Advisor

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