Interface RenditionHandler

  • @ConsumerType
    public interface RenditionHandler
    The RenditionHandler interface defines the API for rendition handlers. Each RenditionHandler must be identifiable via a unique 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 Detail


        static final java.lang.String 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:
        Constant Field Values

        static final java.lang.String PROPERTY_RENDITION_MIME_TYPE
        This property constant defines a property key for the mime type. This can be used by the RenditionHandler or the API clients to define the mime type of the Rendition
            For 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:
        Constant Field Values
    • Method Detail

      • getRendition

        Rendition getRendition​(Resource resource)
        Get Rendition. Implementations are expected to type the given Resource to Rendition.
        resource - Rendition resource
        Rendition object of the given resource
      • setRendition

        Rendition setRendition​(Resource resource,
                               java.util.Map<java.lang.String,​java.lang.Object> map)
        Set Rendition. Implementations are free to define Resource data structure.
        resource - Rendition resource
        is - InputStream to create the rendition binary or null
        map - containing values needed by this handler.
        newly created or updated rendition
        AssetException - if Rendition cannot be set
      • deleteRendition

        void deleteRendition​(Resource resource)
        Delete the rendition resource. Implementations are free to decide the semantics of deletion.
        resource - To be deleted
        AssetException - if Rendition cannot be deleted