Is it possible to search for a rendition of an image based on the dimensions via QueryBuilder API

627 Views Asked by At

What I would like to achieve is the following. Based on the specified dimension and an asset title I would like to find all the asset renditions which correspond to the search criteria.

Currently, I am using the QueryBuilder API as I am not working in Java but it seems impossible that in just one call to the AEM I manage to get the wanted rendition.

What would be the best way for searching the image renditions?

Looking forward to your ideas!

1

There are 1 best solutions below

4
Saravana Prakash On

You can do with SQL2 JOIN query:

SELECT parent.* FROM [dam:AssetContent] AS parent INNER JOIN [nt:file] AS child ON ISDESCENDANTNODE(child,parent) WHERE ISDESCENDANTNODE(parent, '/content/dam') AND parent.[cq:name]='men_5.jpg' and name(child)='cq5dam.thumbnail.48.48.png'

parent looks for dam:AssetContent nodes with name=men_5.jpg and child looks for nt:file nodes under corresponding asset with nodename=cq5dam.thumbnail.48.48.png