Example usage for com.liferay.portal.kernel.portlet PortletLayoutListener onSetup

List of usage examples for com.liferay.portal.kernel.portlet PortletLayoutListener onSetup

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.portlet PortletLayoutListener onSetup.

Prototype

public void onSetup(String portletId, long plid) throws PortletLayoutListenerException;

Source Link

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);/*from ww  w  .  j av  a  2s .co  m*/

    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());
    }
}