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

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

Introduction

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

Prototype

public com.liferay.portal.kernel.portlet.PortletLayoutListener getPortletLayoutListenerInstance();

Source Link

Document

Returns the portlet layout listener instance of the portlet.

Usage

From source file:com.liferay.portlet.configuration.web.internal.portlet.PortletConfigurationPortlet.java

License:Open Source License

public void editConfiguration(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    Portlet portlet = ActionUtil.getPortlet(actionRequest);

    PortletConfig portletConfig = (PortletConfig) actionRequest
            .getAttribute(JavaConstants.JAVAX_PORTLET_CONFIG);

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

    String settingsScope = ParamUtil.getString(actionRequest, "settingsScope");

    PortletPreferences portletPreferences = getPortletPreferences(themeDisplay, portlet.getPortletId(),
            settingsScope);// w  ww  .  j av  a 2s  .  com

    actionRequest = ActionUtil.getWrappedActionRequest(actionRequest, portletPreferences);

    ConfigurationAction configurationAction = getConfigurationAction(portlet);

    if (configurationAction == null) {
        return;
    }

    configurationAction.processAction(portletConfig, actionRequest, actionResponse);

    Layout layout = themeDisplay.getLayout();

    PortletLayoutListener portletLayoutListener = portlet.getPortletLayoutListenerInstance();

    if (portletLayoutListener != null) {
        portletLayoutListener.onSetup(portlet.getPortletId(), layout.getPlid());
    }
}