Package com.adobe.granite.asset.api
Interface RenditionHandler
The
RenditionHandler interface defines the API for rendition handlers. Each RenditionHandler
must be identifiable via a unique ID 'rendition.handler.id'.
RenditionHandler is used by the Asset API to delegate Access, Creation & Deletion of Rendition.
Implementations of this interface must be registered as OSGi services.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteRendition(Resource resource) Delete the rendition resource.getRendition(Resource resource) Get Rendition.setRendition(Resource resource, InputStream is, Map<String, Object> map) SetRendition.
-
Field Details
-
PROPERTY_ID
PROPERTY_ID must be set by the implementation class as an OSGi service property This is used by the Asset API to identify RenditionHandler- See Also:
-
PROPERTY_RENDITION_MIME_TYPE
This property constant defines a property key for the mime type. This can be used by theRenditionHandleror the API clients to define the mime type of the RenditionFor example, if the rendition handler requires mime type: final Map<String, Object> map = new HashMap<String, Object>(); map.put(RenditionHandler.PROPERTY_RENDITION_MIME_TYPE, "image/gif"); .... asset.setRendition("image.gif", InputStream, map);- See Also:
-
-
Method Details
-
getRendition
Get Rendition. Implementations are expected to type the givenResourceto Rendition.- Parameters:
resource- Rendition resource- Returns:
- Rendition object of the given resource
-
setRendition
SetRendition. Implementations are free to define Resource data structure.- Parameters:
resource- Rendition resourceis- InputStream to create the rendition binary or nullmap- containing values needed by this handler.- Returns:
- newly created or updated rendition
- Throws:
AssetException- if Rendition cannot be set
-
deleteRendition
Delete the rendition resource. Implementations are free to decide the semantics of deletion.- Parameters:
resource- To be deleted- Throws:
AssetException- if Rendition cannot be deleted
-