Class MediaManager


  • public class MediaManager
    extends java.lang.Object
    Manager for Medias.
    Since:
    jcms-9.0.5
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static MediaManager getInstance()
      Get the manager.
      java.lang.String getMediaTemplatePath​(java.lang.String templateName, Data data)
      Retrieve the path of the JSP suitable to display the specified Data.
      java.lang.String getMediaTemplatePath​(java.lang.String templateName, java.lang.String mediaSource, java.lang.String mediaContentType)
      Retrieve the path of the JSP suitable to display the specified media.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getInstance

        public static MediaManager getInstance()
        Get the manager.
        Returns:
        MediaManager the singleton instance
      • getMediaTemplatePath

        public java.lang.String getMediaTemplatePath​(java.lang.String templateName,
                                                     java.lang.String mediaSource,
                                                     java.lang.String mediaContentType)
        Retrieve the path of the JSP suitable to display the specified media.
        Parameters:
        templateName - the name of the template to retrieve
        mediaSource - the source of the media to display, can be a Data id, a path relative to the webapp root (eg. upload/docs/myfile.ext) or an URL such as https://www.youtube.com/watch?v=abc (if supported in template declarations)
        mediaContentType - the content type of the media to display (eg. image/jpeg). This value is ignored if a Data id was specified
        Returns:
        the relative path of the Media JSP template to use to display the specified media, may return null if no suitable template was found for the media
        Since:
        jcms-9.0.5
        See Also:
        getMediaTemplatePath(String, Data)
      • getMediaTemplatePath

        public java.lang.String getMediaTemplatePath​(java.lang.String templateName,
                                                     Data data)
        Retrieve the path of the JSP suitable to display the specified Data.
        Parameters:
        templateName - the name of the template to retrieve
        data - the Data to display
        Returns:
        the relative path of the Media JSP template to use to display the specified Data
        Since:
        jcms-9.0.5
        See Also:
        getMediaTemplatePath(String, String, String)