Class MediaManager

java.lang.Object
com.jalios.jcms.media.MediaManager

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

    • getInstance

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

      public String getMediaTemplatePath(String templateName, String mediaSource, 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

      public String getMediaTemplatePath(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: