Example usage for com.liferay.portal.kernel.model Portlet getControlPanelEntryCategory

List of usage examples for com.liferay.portal.kernel.model Portlet getControlPanelEntryCategory

Introduction

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

Prototype

public String getControlPanelEntryCategory();

Source Link

Document

Returns the name of the category of the Control Panel where the portlet will be shown.

Usage

From source file:com.liferay.application.list.BasePanelApp.java

License:Open Source License

protected Group getGroup(HttpServletRequest request) {
    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    Group group = themeDisplay.getScopeGroup();

    if (!group.isControlPanel()) {
        return null;
    }/*w w w . j av  a2 s. c  o  m*/

    Portlet portlet = getPortlet();

    String controlPanelEntryCategory = portlet.getControlPanelEntryCategory();

    if (Validator.isNull(controlPanelEntryCategory)
            || !controlPanelEntryCategory.startsWith(PortletCategoryKeys.SITE_ADMINISTRATION)) {

        return null;
    }

    if (groupProvider == null) {
        return null;
    }

    return groupProvider.getGroup(request);
}