Example usage for com.liferay.portal.kernel.portlet ConfigurationAction processAction

List of usage examples for com.liferay.portal.kernel.portlet ConfigurationAction processAction

Introduction

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

Prototype

public void processAction(PortletConfig portletConfig, ActionRequest actionRequest,
            ActionResponse actionResponse) throws Exception;

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);//  ww w. j  a  v a2 s .  c om

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

From source file:com.liferay.portlet.portletconfiguration.action.EditConfigurationAction.java

License:Open Source License

@Override
public void processAction(ActionMapping actionMapping, ActionForm actionForm, PortletConfig portletConfig,
        ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    Portlet portlet = null;/*  w w  w . ja  va  2s .c o  m*/

    try {
        portlet = ActionUtil.getPortlet(actionRequest);
    } catch (PrincipalException pe) {
        SessionErrors.add(actionRequest, PrincipalException.class.getName());

        setForward(actionRequest, "portlet.portlet_configuration.error");

        return;
    }

    actionRequest = ActionUtil.getWrappedActionRequest(actionRequest, null);

    ConfigurationAction configurationAction = getConfigurationAction(portlet);

    if (configurationAction == null) {
        return;
    }

    configurationAction.processAction(portletConfig, actionRequest, actionResponse);
}