Search in sources :

Example 1 with ActionRequest

use of javax.portlet.ActionRequest in project liferay-ide by liferay.

the class SayHelloActionCommand method processCommand.

@Override
public boolean processCommand(PortletRequest portletRequest, PortletResponse portletResponse) throws PortletException {
    ActionRequest actionRequest = (ActionRequest) portletRequest;
    ActionResponse actionResponse = (ActionResponse) portletResponse;
    String name = ParamUtil.getString(actionRequest, "name");
    actionResponse.setRenderParameter("name", name);
    actionResponse.setRenderParameter("mvcPath", "/html/demoactioncommand/view.jsp");
    return true;
}
Also used : ActionRequest(javax.portlet.ActionRequest) ActionResponse(javax.portlet.ActionResponse)

Example 2 with ActionRequest

use of javax.portlet.ActionRequest in project uPortal by Jasig.

the class PortletAdministrationHelper method configModeAction.

public boolean configModeAction(ExternalContext externalContext, String fname) throws IOException {
    final ActionRequest actionRequest = (ActionRequest) externalContext.getNativeRequest();
    final ActionResponse actionResponse = (ActionResponse) externalContext.getNativeResponse();
    final IPortletWindowId portletWindowId = this.getDelegateWindowId(externalContext, fname);
    if (portletWindowId == null) {
        throw new IllegalStateException("Cannot execute configModeAciton without a delegate window ID in the session for key: " + RenderPortletTag.DEFAULT_SESSION_KEY_PREFIX + fname);
    }
    final PortletDelegationDispatcher requestDispatcher = this.portletDelegationLocator.getRequestDispatcher(actionRequest, portletWindowId);
    final DelegationActionResponse delegationResponse = requestDispatcher.doAction(actionRequest, actionResponse);
    final String redirectLocation = delegationResponse.getRedirectLocation();
    final DelegateState delegateState = delegationResponse.getDelegateState();
    if (redirectLocation != null || (delegationResponse.getPortletMode() != null && !IPortletRenderer.CONFIG.equals(delegationResponse.getPortletMode())) || !IPortletRenderer.CONFIG.equals(delegateState.getPortletMode())) {
        // The portlet sent a redirect OR changed it's mode away from CONFIG, assume it is done
        return true;
    }
    return false;
}
Also used : ActionRequest(javax.portlet.ActionRequest) PortletDelegationDispatcher(org.apereo.portal.api.portlet.PortletDelegationDispatcher) DelegateState(org.apereo.portal.api.portlet.DelegateState) ActionResponse(javax.portlet.ActionResponse) DelegationActionResponse(org.apereo.portal.api.portlet.DelegationActionResponse) IPortletWindowId(org.apereo.portal.portlet.om.IPortletWindowId) DelegationActionResponse(org.apereo.portal.api.portlet.DelegationActionResponse)

Aggregations

ActionRequest (javax.portlet.ActionRequest)2 ActionResponse (javax.portlet.ActionResponse)2 DelegateState (org.apereo.portal.api.portlet.DelegateState)1 DelegationActionResponse (org.apereo.portal.api.portlet.DelegationActionResponse)1 PortletDelegationDispatcher (org.apereo.portal.api.portlet.PortletDelegationDispatcher)1 IPortletWindowId (org.apereo.portal.portlet.om.IPortletWindowId)1