Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

Get all dynamic media renditions and fetch scene7 URL from Asset

Avatar

Level 1

Why is the asset.getRenditions() function in AEM only returning Static / Original renditions and not Dynamic renditions, even though I can confirm the presence of Dynamic renditions for the asset in the AEM Asset manager?

 

Code Snap: 

private static void getDynamicRenditions(Asset asset) {

    List<Rendition> renditions = asset.getRenditions();

    for (Rendition rendition : renditions) {

      String renditionPath = rendition.getPath();

      String renditionName = rendition.getName();

    }

  }

 

Asset Renditions: We are only getting Static Renditions and original rendition but not Dynamic Rendition.

amchauha_0-1701874091394.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@amchauha getrenditions() method gets only renditions which are static/stored in aem.. while DM renditions are dynamic in nature and will get stored except in its own CDN cache..

 

So have write your business logic to get DM renditions..

https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w...

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

@amchauha getrenditions() method gets only renditions which are static/stored in aem.. while DM renditions are dynamic in nature and will get stored except in its own CDN cache..

 

So have write your business logic to get DM renditions..

https://github.com/adobe/aem-core-wcm-components/blob/main/bundles/core/src/main/java/com/adobe/cq/w...

Avatar

Community Advisor

Just extending to @Shashi_Mulugu suggestions. The Image WCM Core component uses both the Adaptive Image and the DM delivery.

It uses both Preset and Smart Crop.

 

You might want to extract whats needed for you. Preferably create it as a separate Service. 

DM delivery feature might not be available for all WCM core components, so separate service would help, incase you need it 


Aanchal Sikka