So what I know is that to create a Dynamic media scene7 URL for an asset is :
Views
Replies
Total Likes
You can try it like this.
import com.adobe.granite.asset.api.Asset;
import com.adobe.granite.asset.api.Rendition;
// Assuming you have the assetPath and renditionName available
// Get the asset using the assetPath
Asset asset = assetManager.getAsset(assetPath);
// Get the rendition using the renditionName
Rendition rendition = asset.getRendition(renditionName);
// Get the rendition title
String renditionTitle = rendition.getProperties().get("jcr:title", String.class);
// Get the rendition scene7 URL
String scene7URL = rendition.getPath();
// Example usage
String dynamicURL = "https://<scene7_domain_name>/is/image/<company_name>/<asset_name>?$" + renditionTitle + "$";
Well, this does not really work,
rendition.getProperties().get("jcr:title", String.class);
rendition.getProperties does not exist, renditions .getValueMap does. and jcr:title is null there.
Also,
rendition.getName()
........
So you see these are the title of renditions in bold in above image, which is different from the node title in jcr.
What i need is a way to get this title in bold.
When I click on the URL I get this
Now I need to create this URL by getting this title of the rendition.
When a URL is uploaded to the DAM the static renditions (you have mentioned below in crx under renditions folder). In UI you will notice this as below
When the Image is synced with S7 the Dynamic renditions as you have shared in the below screenshot would be generated (under heading DYNAMIC) and those can be fetched using <scene7domain>/is/image/accountname/image filename?$imagepresetname$
You cannot fetch the static rendition generated by AEM OOB (DAM update asset workflow) using the Scene7 URL and the recommendation is to use create corresponding preset/smart crop rendition and render it on the web page using the S7 URL rather leveraging static renditions. Hope this helps!
Dynamic Media documentation : https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/assets/dynamicmedia...
Yes, Thanks for the reply this does give me a direction. Although any idea how can I fetch the image preset names?
Hi @Anuj31005349h74z ,
Please find below the link for creating Dynamic Media Image presets and the configuration
Example - For Hero component, If the ask is to use a specific Preset, in the hero component sling model construct the url as below to fetch it accordingly.
<scene7domain>/is/image/accountname/image filename?$heroimagepreset$
Hi @Anil_Chennapragada The question is In sling java class how do I get the name "heroimagepreset"?
hi @Anuj1 , It should be hardcoded. Construct the whole DM url and hardcode the preset that needs to be used on the component
Or if you want to keep it dynamic. Add a data page or a generic list and have key , value pair like <componentName, preset name> and read the preset name in the sling model from the data page/ generic list. With this option there will be an option to change the preset needed for a component at any time by authoring it accordingly
the correct way to get the preset is
Resource presetsFolderResource = resourceResolver.getResource(S7damConstants.IMAGE_PRESETS);
now the children of this resource will be presets and getting the name will give you Names.
Views
Replies
Total Likes
the correct way to get the dynamic media preset is
Resource presetsFolderResource = resourceResolver.getResource(S7damConstants.IMAGE_PRESETS);
now the children of this resource will be presets and getting the name will give you Names of the preset.
to create the URL use this formula: <scene7domain>/is/image/<accountname>/<image_filename>?$imagepresetname$
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies