Example usage for com.liferay.portal.kernel.util PortalUtil addPortletBreadcrumbEntry

List of usage examples for com.liferay.portal.kernel.util PortalUtil addPortletBreadcrumbEntry

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util PortalUtil addPortletBreadcrumbEntry.

Prototype

public static void addPortletBreadcrumbEntry(HttpServletRequest httpServletRequest, String title, String url,
        Map<String, Object> data, boolean portletBreadcrumbEntry) 

Source Link

Document

Adds an entry to the portlet breadcrumbs for the page in the request.

Usage

From source file:com.liferay.asset.taglib.internal.util.AssetCategoryUtil.java

License:Open Source License

public static void addPortletBreadcrumbEntries(long assetCategoryId, HttpServletRequest request,
        PortletURL portletURL, boolean portletBreadcrumbEntry) throws Exception {

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

    AssetCategory assetCategory = AssetCategoryLocalServiceUtil.getCategory(assetCategoryId);

    List<AssetCategory> ancestorCategories = assetCategory.getAncestors();

    Collections.reverse(ancestorCategories);

    for (AssetCategory ancestorCategory : ancestorCategories) {
        portletURL.setParameter("categoryId", String.valueOf(ancestorCategory.getCategoryId()));

        PortalUtil.addPortletBreadcrumbEntry(request, ancestorCategory.getTitle(themeDisplay.getLocale()),
                portletURL.toString(), null, portletBreadcrumbEntry);
    }/*from   www .  j av a  2  s .c  o m*/

    portletURL.setParameter("categoryId", String.valueOf(assetCategoryId));

    PortalUtil.addPortletBreadcrumbEntry(request, assetCategory.getTitle(themeDisplay.getLocale()),
            portletURL.toString(), null, portletBreadcrumbEntry);
}