public void execute(Event<UIPortlet<S, C>> event) throws Exception { UIPortlet<S, C> uiPortlet = event.getSource(); PortalRequestContext prcontext = (PortalRequestContext) event.getRequestContext(); // set the public render parameters from the request before creating the invocation HttpServletRequest request = prcontext.getRequest(); setupPublicRenderParams(uiPortlet, request.getParameterMap()); // set the navigational state String navState = prcontext.getRequestParameter(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME); if (navState != null) { uiPortlet.setNavigationalState(ParametersStateString.create(navState)); } // ActionInvocation actionInvocation = uiPortlet.create(ActionInvocation.class, prcontext); if (actionInvocation == null) { return; } // PortletInvocationResponse portletResponse = uiPortlet.invoke(actionInvocation); // deal with potential portlet context modifications ExoPortletInstanceContext instanceCtx = (ExoPortletInstanceContext) actionInvocation.getInstanceContext(); if (instanceCtx.getModifiedContext() != null) { StatefulPortletContext<C> updatedCtx = (StatefulPortletContext<C>) instanceCtx.getModifiedContext(); C portletState = uiPortlet.getModifiedState(updatedCtx); uiPortlet.update(portletState); } else { // todo: fix me as this shouldn't probably be done only for the WSRP case PortletContext clonedContext = instanceCtx.getClonedContext(); if (clonedContext != null) { C state = uiPortlet.getClonedState(clonedContext); uiPortlet.update(state); } } if (portletResponse instanceof UpdateNavigationalStateResponse) { handleUpdateNavigationalStateResponse( (UpdateNavigationalStateResponse) portletResponse, uiPortlet, prcontext); } else if (portletResponse instanceof HTTPRedirectionResponse) { handleRedirectionResponse( (HTTPRedirectionResponse) portletResponse, prcontext.getResponse()); prcontext.setResponseComplete(true); } else if (portletResponse instanceof ErrorResponse) { handleErrorResponse((ErrorResponse) portletResponse); } else if (portletResponse instanceof SecurityResponse) { handleSecurityResponse((SecurityResponse) portletResponse); } else { throw new Exception( "Unexpected response type [" + portletResponse + "]. Expected an UpdateNavigationResponse" + ", a HTTPRedirectionResponse or an ErrorResponse."); } }