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

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

Introduction

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

Prototype

public void setStateMax(String stateMax);

Source Link

Usage

From source file:com.liferay.nested.portlets.web.internal.portlet.action.NestedPortletsConfigurationAction.java

License:Open Source License

protected void reorganizeNestedColumns(ActionRequest actionRequest, String portletResource,
        String newLayoutTemplateId, String oldLayoutTemplateId) throws PortalException {

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

    Layout layout = themeDisplay.getLayout();
    LayoutTypePortlet layoutTypePortlet = themeDisplay.getLayoutTypePortlet();
    Theme theme = themeDisplay.getTheme();

    LayoutTemplate newLayoutTemplate = _layoutTemplateLocalService.getLayoutTemplate(newLayoutTemplateId, false,
            theme.getThemeId());// w  ww . j a v  a  2 s  . co m

    List<String> newColumns = getColumnNames(newLayoutTemplate.getContent(), portletResource);

    LayoutTemplate oldLayoutTemplate = _layoutTemplateLocalService.getLayoutTemplate(oldLayoutTemplateId, false,
            theme.getThemeId());

    List<String> oldColumns = getColumnNames(oldLayoutTemplate.getContent(), portletResource);

    layoutTypePortlet.reorganizePortlets(newColumns, oldColumns);

    layoutTypePortlet.setStateMax(StringPool.BLANK);

    _layoutLocalService.updateLayout(layout.getGroupId(), layout.isPrivateLayout(), layout.getLayoutId(),
            layout.getTypeSettings());
}