Search in sources :

Example 1 with ActionResponse

use of javax.portlet.ActionResponse 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)1 ActionResponse (javax.portlet.ActionResponse)1 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