Example usage for com.liferay.portal.kernel.model LayoutType isBrowsable

List of usage examples for com.liferay.portal.kernel.model LayoutType isBrowsable

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.model LayoutType isBrowsable.

Prototype

public boolean isBrowsable();

Source Link

Usage

From source file:com.liferay.site.navigation.site.map.web.internal.display.context.SiteNavigationSiteMapDisplayContext.java

License:Open Source License

private void _buildLayoutView(Layout layout, String cssClass, boolean useHtmlTitle, ThemeDisplay themeDisplay,
        StringBundler sb) throws Exception {

    String layoutURL = PortalUtil.getLayoutURL(layout, themeDisplay);
    String target = PortalUtil.getLayoutTarget(layout);

    sb.append("<a");

    LayoutType layoutType = layout.getLayoutType();

    if (layoutType.isBrowsable()) {
        sb.append(" href=\"");
        sb.append(layoutURL);/*from  w  w  w. j a v a 2  s .c o m*/
        sb.append("\" ");
        sb.append(target);
    }

    if (Validator.isNotNull(cssClass)) {
        sb.append(" class=\"");
        sb.append(cssClass);
        sb.append("\" ");
    }

    sb.append("> ");

    String layoutName = HtmlUtil.escape(layout.getName(themeDisplay.getLocale()));

    if (useHtmlTitle) {
        layoutName = HtmlUtil.escape(layout.getHTMLTitle(themeDisplay.getLocale()));
    }

    sb.append(layoutName);
    sb.append("</a>");
}