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;
}
Aggregations