Query to find renditions are present for an asset | Community
Skip to main content
Selva123
Level 2
June 29, 2016
Solved

Query to find renditions are present for an asset

  • June 29, 2016
  • 3 replies
  • 3341 views

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.
Best answer by GK-007

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
June 29, 2016

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

kautuk_sahni
Community Manager
Community Manager
July 13, 2016

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
Level 2
August 4, 2016

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.