Ejemplo n.º 1
0
  public static void addPortletBreadcrumbEntries(
      long folderId, HttpServletRequest request, RenderResponse renderResponse) throws Exception {

    if (folderId != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {
      Folder folder = DLAppLocalServiceUtil.getFolder(folderId);

      if (folder.getFolderId() != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {

        addPortletBreadcrumbEntries(folder, request, renderResponse);
      }
    }
  }
Ejemplo n.º 2
0
  public static void addPortletBreadcrumbEntries(
      FileEntry fileEntry, HttpServletRequest request, RenderResponse renderResponse)
      throws Exception {

    Folder folder = fileEntry.getFolder();

    if (folder.getFolderId() != DLFolderConstants.DEFAULT_PARENT_FOLDER_ID) {

      addPortletBreadcrumbEntries(folder, request, renderResponse);
    }

    PortletURL portletURL = renderResponse.createRenderURL();

    portletURL.setParameter("struts_action", "/document_library/view_file_entry");
    portletURL.setParameter("fileEntryId", String.valueOf(fileEntry.getFileEntryId()));

    PortalUtil.addPortletBreadcrumbEntry(request, fileEntry.getTitle(), portletURL.toString());
  }
Ejemplo n.º 3
0
  public static void addPortletBreadcrumbEntries(
      Folder folder, HttpServletRequest request, LiferayPortletResponse liferayPortletResponse)
      throws Exception {

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

    PortletURL portletURL = liferayPortletResponse.createRenderURL();

    portletURL.setParameter("struts_action", "/document_library/view");
    portletURL.setParameter("viewEntries", Boolean.TRUE.toString());
    portletURL.setParameter("viewFolders", Boolean.TRUE.toString());

    Map<String, Object> data = new HashMap<String, Object>();

    data.put("folder-id", _getDefaultFolderId(request));

    PortalUtil.addPortletBreadcrumbEntry(
        request, themeDisplay.translate("home"), portletURL.toString(), data);

    addPortletBreadcrumbEntries(folder, request, portletURL);
  }
Ejemplo n.º 4
0
  public static void addPortletBreadcrumbEntries(
      Folder folder, HttpServletRequest request, RenderResponse renderResponse) throws Exception {

    String strutsAction = ParamUtil.getString(request, "struts_action");

    long groupId = ParamUtil.getLong(request, "groupId");

    PortletURL portletURL = renderResponse.createRenderURL();

    if (strutsAction.equals("/journal/select_document_library")
        || strutsAction.equals("/document_library/select_file_entry")
        || strutsAction.equals("/document_library/select_folder")
        || strutsAction.equals("/document_library_display/select_folder")
        || strutsAction.equals("/image_gallery_display/select_folder")) {

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

      portletURL.setWindowState(LiferayWindowState.POP_UP);

      portletURL.setParameter("struts_action", strutsAction);
      portletURL.setParameter("groupId", String.valueOf(groupId));

      Map<String, Object> data = new HashMap<String, Object>();

      data.put("folder-id", _getDefaultFolderId(request));
      data.put("view-entries", Boolean.TRUE.toString());
      data.put("view-folders", Boolean.TRUE.toString());

      PortalUtil.addPortletBreadcrumbEntry(
          request, themeDisplay.translate("home"), portletURL.toString(), data);
    } else {
      portletURL.setParameter("struts_action", "/document_library/view");
    }

    addPortletBreadcrumbEntries(folder, request, portletURL);
  }