Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Query to find renditions are present for an asset

Avatar

Level 3

Hi All,

Is there any way to write a query and find the assets which are not having any renditions. 

Thanks,

Selva

1 Accepted Solution

Avatar

Correct answer by
Level 9

Generally for any dam asset rendition are existed under jcr:content node.

/content/dam/XXXX/global/Images/inline_images/gx_hc_aging2.jpg/jcr:content/renditions

You can validate if there are any node is existed with redntions node then you can say rendtions are existed.

I have provided more of theory ,you can frame SQL query.

Thanks,

Kishore

View solution in original post

3 Replies

Avatar

Correct answer by
Level 9

Generally for any dam asset rendition are existed under jcr:content node.

/content/dam/XXXX/global/Images/inline_images/gx_hc_aging2.jpg/jcr:content/renditions

You can validate if there are any node is existed with redntions node then you can say rendtions are existed.

I have provided more of theory ,you can frame SQL query.

Thanks,

Kishore

Avatar

Administrator

Hi

Can you please look at the answer posted and let us know if this worked for you or not.

If you have devised another way to resolve the issue, please post it in the community for communities benefit.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 2

Can anyone provide more detail on the solution? Example, I'm trying to test an SQL query using the CRXDE query tool:

SELECT * FROM [dam:Asset] AS s
WHERE ISDESCENDANTNODE(s,[/content/dam/bla/])
AND [s].[jcr:content/renditions/cq5dam.web.1280.1280.png/jcr:createdBy] IS NULL

This spins for a bit and throws "Query execution resulted in an error!". I tried pulling up DEBUG logs for the query and I don't see any error in the logs.

I also tried variations, example:

AND [s].[jcr:content/renditions/cq5dam.web.1280.1280.png] IS NULL

also gives an error. I verify that the nodes I'm looking for do exist in CRX. Just to prove I know what I'm doing I can successfully run:

SELECT * FROM [dam:Asset] AS s WHERE ISDESCENDANTNODE(s,[/content/dam/bla/])
AND [s].[jcr:content/metadata/property_im_checking] IS NOT NULL

...and that works every time.