Search in sources :

Example 1 with ConfigurationAction

use of com.liferay.portal.kernel.portlet.ConfigurationAction in project liferay-ide by liferay.

the class EditConfigurationAction method processAction.

@Override
public void processAction(ActionMapping actionMapping, ActionForm actionForm, PortletConfig portletConfig, ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {
    Portlet portlet = null;
    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);
}
Also used : Portlet(com.liferay.portal.model.Portlet) PrincipalException(com.liferay.portal.security.auth.PrincipalException) ConfigurationAction(com.liferay.portal.kernel.portlet.ConfigurationAction) ResourceServingConfigurationAction(com.liferay.portal.kernel.portlet.ResourceServingConfigurationAction)

Example 2 with ConfigurationAction

use of com.liferay.portal.kernel.portlet.ConfigurationAction in project liferay-ide by liferay.

the class EditConfigurationAction method render.

@Override
public ActionForward render(ActionMapping actionMapping, ActionForm actionForm, PortletConfig portletConfig, RenderRequest renderRequest, RenderResponse renderResponse) throws Exception {
    Portlet portlet = null;
    try {
        portlet = ActionUtil.getPortlet(renderRequest);
    } catch (PrincipalException pe) {
        SessionErrors.add(renderRequest, PrincipalException.class.getName());
        return actionMapping.findForward("portlet.portlet_configuration.error");
    }
    renderRequest = ActionUtil.getWrappedRenderRequest(renderRequest, null);
    renderResponse.setTitle(ActionUtil.getTitle(portlet, renderRequest));
    ConfigurationAction configurationAction = getConfigurationAction(portlet);
    if (configurationAction != null) {
        String path = configurationAction.render(portletConfig, renderRequest, renderResponse);
        if (_log.isDebugEnabled()) {
            _log.debug("Configuration action returned render path " + path);
        }
        if (Validator.isNotNull(path)) {
            renderRequest.setAttribute(WebKeys.CONFIGURATION_ACTION_PATH, path);
        } else {
            _log.error("Configuration action returned a null path");
        }
    }
    return actionMapping.findForward(getForward(renderRequest, "portlet.portlet_configuration.edit_configuration"));
}
Also used : Portlet(com.liferay.portal.model.Portlet) PrincipalException(com.liferay.portal.security.auth.PrincipalException) ConfigurationAction(com.liferay.portal.kernel.portlet.ConfigurationAction) ResourceServingConfigurationAction(com.liferay.portal.kernel.portlet.ResourceServingConfigurationAction)

Aggregations

ConfigurationAction (com.liferay.portal.kernel.portlet.ConfigurationAction)2 ResourceServingConfigurationAction (com.liferay.portal.kernel.portlet.ResourceServingConfigurationAction)2 Portlet (com.liferay.portal.model.Portlet)2 PrincipalException (com.liferay.portal.security.auth.PrincipalException)2