Interface MediaTemplatePolicyFilter

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String getMediaTemplatePath​(java.lang.String mediaTemplatePath, 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 mediaTemplatePath, java.lang.String templateName, java.lang.String mediaPath, java.lang.String mediaContentType)
      Retrieve the path of the JSP suitable to display the specified media.
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Method Detail

      • getMediaTemplatePath

        java.lang.String getMediaTemplatePath​(java.lang.String mediaTemplatePath,
                                              java.lang.String templateName,
                                              java.lang.String mediaPath,
                                              java.lang.String mediaContentType)
        Retrieve the path of the JSP suitable to display the specified media.

        FileDocument can be retrieved with mediaPath using:

         FileDocument fileDocument = FileDocument.getFileDocumentFromFilename(mediaPath);
         
        Parameters:
        mediaTemplatePath - proposed media template path (or path already overrided by other MediaTemplatePolicyFilter)
        templateName - the name of the template to retrieve
        mediaPath - the path of the media to display, relative to the webapp root (eg. upload/docs/myfile.ext) can also be 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)
        Returns:
        the relative path of the Media JSP template to use to display the specified media, may return null if no suitable template was find for the media
      • getMediaTemplatePath

        java.lang.String getMediaTemplatePath​(java.lang.String mediaTemplatePath,
                                              java.lang.String templateName,
                                              Data data)
        Retrieve the path of the JSP suitable to display the specified Data.
        Parameters:
        mediaTemplatePath - proposed media template path (or path already overrided by other MediaTemplatePolicyFilter)
        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