Skip to main content
Selva123
Level 2
Jun 29, 2016 5:02 PM UTC
Solved

Query to find renditions are present for an asset

Hi All,

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

Thanks,

Selva

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
GK-007
GK-007Accepted solution
Level 9
Jun 29, 2016 5:11 PM UTC

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

3 replies

GK-007
GK-007Accepted solution
Level 9
Jun 29, 2016 5:11 PM UTC

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

Translate
kautuk_sahni
Level 9
Jul 13, 2016 9:29 AM UTC

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

Translate
Kautuk Sahni
Level 2
Aug 4, 2016 7:46 PM UTC

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.

Translate