Example usage for com.liferay.portal.kernel.model LayoutTypePortlet getLayoutTypeController

List of usage examples for com.liferay.portal.kernel.model LayoutTypePortlet getLayoutTypeController

Introduction

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

Prototype

public LayoutTypeController getLayoutTypeController();

Source Link

Usage

From source file:com.liferay.portlet.configuration.icon.maximize.internal.MaximizePortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    if (!GetterUtil.getBoolean(themeDisplay.getThemeSetting("show-maximize-minimize-application-links"))) {

        return false;
    }//from w  ww  .j  a  v a2  s .  c o  m

    Layout layout = themeDisplay.getLayout();

    if (!layout.isTypePortlet()) {
        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    LayoutTypeController layoutTypeController = layoutTypePortlet.getLayoutTypeController();

    if (layoutTypeController.isFullPageDisplayable()) {
        return false;
    }

    Portlet portlet = (Portlet) portletRequest.getAttribute(WebKeys.RENDER_PORTLET);

    if (!portlet.hasWindowState(portletRequest.getResponseContentType(), WindowState.MAXIMIZED)) {

        return false;
    }

    Group group = themeDisplay.getScopeGroup();

    if (!themeDisplay.isSignedIn() || (group.hasStagingGroup() && !group.isStagingGroup())
            || !hasUpdateLayoutPermission(themeDisplay)) {

        if (!PropsValues.LAYOUT_GUEST_SHOW_MAX_ICON) {
            return false;
        }
    }

    return true;
}

From source file:com.liferay.portlet.configuration.icon.minimize.internal.MinimizePortletConfigurationIcon.java

License:Open Source License

@Override
public boolean isShow(PortletRequest portletRequest) {
    ThemeDisplay themeDisplay = (ThemeDisplay) portletRequest.getAttribute(WebKeys.THEME_DISPLAY);

    if (!GetterUtil.getBoolean(themeDisplay.getThemeSetting("show-maximize-minimize-application-links"))) {

        return false;
    }/* w  w  w . j a  va 2  s .  com*/

    Layout layout = themeDisplay.getLayout();

    if (!layout.isTypePortlet()) {
        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    LayoutTypeController layoutTypeController = layoutTypePortlet.getLayoutTypeController();

    if (layoutTypeController.isFullPageDisplayable()) {
        return false;
    }

    Portlet portlet = (Portlet) portletRequest.getAttribute(WebKeys.RENDER_PORTLET);

    if (!portlet.hasWindowState(portletRequest.getResponseContentType(), WindowState.MINIMIZED)) {

        return false;
    }

    Group group = themeDisplay.getScopeGroup();

    if (!themeDisplay.isSignedIn() || (group.hasStagingGroup() && !group.isStagingGroup())
            || !hasUpdateLayoutPermission(themeDisplay)) {

        if (!PropsValues.LAYOUT_GUEST_SHOW_MIN_ICON) {
            return false;
        }
    }

    return true;
}

From source file:com.liferay.product.navigation.control.menu.web.internal.AddContentProductNavigationControlMenuEntry.java

License:Open Source License

@Override
public boolean isShow(HttpServletRequest request) throws PortalException {
    ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY);

    if (themeDisplay.isStateMaximized()) {
        return false;
    }//from  w  w  w  . ja  v  a  2s.  c o m

    Layout layout = themeDisplay.getLayout();

    if (!layout.isTypePortlet()) {
        return false;
    }

    if (_staging.isIncomplete(layout)) {
        return false;
    }

    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();

    LayoutTypeController layoutTypeController = layoutTypePortlet.getLayoutTypeController();

    if (layoutTypeController.isFullPageDisplayable()) {
        return false;
    }

    if (!hasAddContentOrApplicationPermission(themeDisplay)) {
        return false;
    }

    if (!(hasUpdateLayoutPermission(themeDisplay) || hasCustomizePermission(themeDisplay))) {

        return false;
    }

    return super.isShow(request);
}