public static String getThumbnailSrc(
      FileEntry fileEntry, DLFileShortcut fileShortcut, ThemeDisplay themeDisplay)
      throws Exception {

    FileVersion fileVersion = fileEntry.getFileVersion();

    StringBundler sb = new StringBundler(4);

    sb.append(themeDisplay.getPathThemeImages());
    sb.append("/file_system/large/");
    sb.append(DLUtil.getGenericName(fileEntry.getExtension()));
    sb.append(".png");

    String thumbnailSrc = sb.toString();

    if (fileShortcut == null) {
      String thumbnailQueryString = null;

      if (ImageProcessorUtil.hasImages(fileVersion)) {
        thumbnailQueryString = "&imageThumbnail=1";
      } else if (PDFProcessorUtil.hasImages(fileVersion)) {
        thumbnailQueryString = "&documentThumbnail=1";
      } else if (VideoProcessorUtil.hasVideo(fileVersion)) {
        thumbnailQueryString = "&videoThumbnail=1";
      }

      if (Validator.isNotNull(thumbnailQueryString)) {
        thumbnailSrc = getPreviewURL(fileEntry, fileVersion, themeDisplay, thumbnailQueryString);
      }
    }

    return thumbnailSrc;
  }
Exemple #2
0
  @Override
  public String getImagePreviewURL(
      FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay) throws Exception {

    String previewQueryString = null;

    if (PropsValues.DL_FILE_ENTRY_THUMBNAIL_ENABLED) {
      if (ImageProcessorUtil.hasImages(fileVersion)) {
        previewQueryString = "&imagePreview=1";
      } else if (PDFProcessorUtil.hasImages(fileVersion)) {
        previewQueryString = "&previewFileIndex=1";
      } else if (VideoProcessorUtil.hasVideo(fileVersion)) {
        previewQueryString = "&videoThumbnail=1";
      }
    }

    return getImageSrc(fileEntry, fileVersion, themeDisplay, previewQueryString);
  }
Exemple #3
0
  @Override
  public String getThumbnailSrc(
      FileEntry fileEntry,
      FileVersion fileVersion,
      DLFileShortcut dlFileShortcut,
      ThemeDisplay themeDisplay)
      throws Exception {

    String thumbnailQueryString = null;

    if (PropsValues.DL_FILE_ENTRY_THUMBNAIL_ENABLED) {
      if (ImageProcessorUtil.hasImages(fileVersion)) {
        thumbnailQueryString = "&imageThumbnail=1";
      } else if (PDFProcessorUtil.hasImages(fileVersion)) {
        thumbnailQueryString = "&documentThumbnail=1";
      } else if (VideoProcessorUtil.hasVideo(fileVersion)) {
        thumbnailQueryString = "&videoThumbnail=1";
      }
    }

    return getImageSrc(fileEntry, fileVersion, themeDisplay, thumbnailQueryString);
  }