@Override
  public String getThumbnailPath(PortletRequest portletRequest) throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    return themeDisplay.getPathThemeImages() + "/file_system/large/bookmark.png";
  }
  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;
  }
 @Override
 public String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages()
       + "/file_system/small/"
       + _fileEntry.getIcon()
       + ".png";
 }
Beispiel #4
0
  private static String[] _findThreadPriority(
      double value, ThemeDisplay themeDisplay, String[] priorities) {

    for (int i = 0; i < priorities.length; i++) {
      String[] priority = StringUtil.split(priorities[i]);

      try {
        String priorityName = priority[0];
        String priorityImage = priority[1];
        double priorityValue = GetterUtil.getDouble(priority[2]);

        if (value == priorityValue) {
          if (!priorityImage.startsWith(Http.HTTP)) {
            priorityImage = themeDisplay.getPathThemeImages() + priorityImage;
          }

          return new String[] {priorityName, priorityImage};
        }
      } catch (Exception e) {
        _log.error("Unable to determine thread priority", e);
      }
    }

    return null;
  }
Beispiel #5
0
  public static String replaceMessageBodyPaths(ThemeDisplay themeDisplay, String messageBody) {

    return StringUtil.replace(
        messageBody,
        new String[] {ThemeConstants.TOKEN_THEME_IMAGES_PATH, "href=\"/", "src=\"/"},
        new String[] {
          themeDisplay.getPathThemeImages(),
          "href=\"" + themeDisplay.getURLPortal() + "/",
          "src=\"" + themeDisplay.getURLPortal() + "/"
        });
  }
Beispiel #6
0
  public static String replaceMessageBodyPaths(ThemeDisplay themeDisplay, String messageBody) {

    return StringUtil.replace(
        messageBody,
        new String[] {"@theme_images_path@", "href=\"/", "src=\"/"},
        new String[] {
          themeDisplay.getPathThemeImages(),
          "href=\"" + themeDisplay.getURLPortal() + "/",
          "src=\"" + themeDisplay.getURLPortal() + "/"
        });
  }
  public static String getFileEntryImage(FileEntry fileEntry, ThemeDisplay themeDisplay) {

    StringBundler sb = new StringBundler(5);

    sb.append("<img style=\"border-width: 0; text-align: left;\" src=\"");
    sb.append(themeDisplay.getPathThemeImages());
    sb.append("/file_system/small/");
    sb.append(fileEntry.getIcon());
    sb.append(".png\">");

    return sb.toString();
  }
  @Override
  public String getThumbnailPath(PortletRequest portletRequest) throws Exception {

    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    String thumbnailSrc = _article.getArticleImageURL(themeDisplay);

    if (Validator.isNotNull(thumbnailSrc)) {
      return thumbnailSrc;
    }

    return themeDisplay.getPathThemeImages() + "/file_system/large/article.png";
  }
  @Override
  public String getIconURL(ThemeDisplay themeDisplay) {
    String iconURL = themeDisplay.getPathThemeImages() + "/common/";

    if (isCompany()) {
      iconURL = iconURL.concat("global.png");
    } else if (isLayout()) {
      iconURL = iconURL.concat("page.png");
    } else if (isOrganization()) {
      iconURL = iconURL.concat("organization_icon.png");
    } else if (isUser()) {
      iconURL = iconURL.concat("user_icon.png");
    } else {
      iconURL = iconURL.concat("site_icon.png");
    }

    return iconURL;
  }
Beispiel #10
0
  protected String getImageSrc(
      FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, String queryString)
      throws Exception {

    StringBundler sb = new StringBundler(4);

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

    String thumbnailSrc = sb.toString();

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

    return thumbnailSrc;
  }
Beispiel #11
0
  @Override
  public int doStartTag() {
    HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();

    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    if (_direction == null) {
      if (_align.equals("left")) {
        _direction = "right";
      } else {
        _direction = "left";
      }
    }

    if (_icon == null) {
      _icon = themeDisplay.getPathThemeImages() + "/common/tool.png";
    }

    if (Validator.isNull(_id)) {
      String randomKey = PortalUtil.generateRandomKey(request, IconMenuTag.class.getName());

      _id = randomKey + StringPool.UNDERLINE + "menu";
    } else {
      PortletDisplay portletDisplay = themeDisplay.getPortletDisplay();

      String namespace = portletDisplay.getNamespace();

      _id = namespace.concat(_id);
    }

    request.setAttribute("liferay-ui:icon-menu:icon-count", new IntegerWrapper());
    request.setAttribute(
        "liferay-ui:icon-menu:showWhenSingleIcon", String.valueOf(_showWhenSingleIcon));

    return EVAL_BODY_BUFFERED;
  }
 public String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/common/page.png";
 }
 protected String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/common/user_icon.png";
 }
 @Override
 protected String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/common/folder.png";
 }
 @Override
 public String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/ratings/star_hover.png";
 }
 @Override
 protected String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/trees/page.png";
 }
 protected String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/blogs/blogs.png";
 }
 @Override
 public String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/common/conversation.png";
 }
 protected String getIconPath(ThemeDisplay themeDisplay) {
   return themeDisplay.getPathThemeImages() + "/file_system/small/bmp.png";
 }