Package com.day.cq.dam.video
Class Scene7PresetRenditionPicker
- java.lang.Object
-
- com.day.cq.dam.video.Scene7PresetRenditionPicker
-
- All Implemented Interfaces:
RenditionPicker
public class Scene7PresetRenditionPicker extends java.lang.Object implements RenditionPicker
Rendition picker that 'picks' one according to the given S7 preset handle.
-
-
Constructor Summary
Constructors Constructor Description Scene7PresetRenditionPicker(java.lang.String presetHandle)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rendition
getRendition(Asset asset)
Returns the desired renditionRendition
if existing, otherwisenull
.
-
-
-
Method Detail
-
getRendition
public Rendition getRendition(Asset asset)
Description copied from interface:RenditionPicker
Returns the desired renditionRendition
if existing, otherwisenull
.Implementations are free to decide which rendition is chosen when this method is called.
The rendition shall be searched for within the given
Asset
.Example implementation:
... public Resource getRendition(Asset asset) { // 1. try to get a web enabled rendition List<Resource> renditions = asset.getRenditions(); for (Resource rendition: renditions) { if (Text.getName(rendition.getPath()).startsWith("cq5dam.web.")) { return rendition; } } // 2. return current rendition return asset.getCurrentOriginal(); } ...
- Specified by:
getRendition
in interfaceRenditionPicker
- Parameters:
asset
- TheAsset
within which to search the rendition.- Returns:
- the desired rendition if existing, otherwise
null
-
-