* @param finalLocation
* @param invocation
*/
protected void executeActionResult(String finalLocation, ActionInvocation invocation) throws Exception {
if (LOG.isDebugEnabled()) LOG.debug("Executing result in Event phase");
ActionResponse res = PortletActionContext.getActionResponse();
Map sessionMap = invocation.getInvocationContext().getSession();
if (LOG.isDebugEnabled()) LOG.debug("Setting event render parameter: " + finalLocation);
if (finalLocation.indexOf('?') != -1) {
convertQueryParamsToRenderParams(res, finalLocation.substring(finalLocation.indexOf('?') + 1));
finalLocation = finalLocation.substring(0, finalLocation.indexOf('?'));
}
if (finalLocation.endsWith(".action")) {
// View is rendered with a view action...luckily...
finalLocation = finalLocation.substring(0, finalLocation.lastIndexOf("."));
res.setRenderParameter(ACTION_PARAM, finalLocation);
} else {
// View is rendered outside an action...uh oh...
String namespace = invocation.getProxy().getNamespace();
if ( namespace != null && namespace.length() > 0 && !namespace.endsWith("/")) {
namespace += "/";
}
res.setRenderParameter(ACTION_PARAM, namespace + "renderDirect");
sessionMap.put(RENDER_DIRECT_LOCATION, finalLocation);
}
if(portletMode != null) {
res.setPortletMode(portletMode);
res.setRenderParameter(PortletActionConstants.MODE_PARAM, portletMode.toString());
}
else {
res.setRenderParameter(PortletActionConstants.MODE_PARAM, PortletActionContext.getRequest().getPortletMode()
.toString());
}
}