data.setMessage(message);
data.setStackTrace(org.apache.turbine.util.StringUtils.stackTrace(other), other);
return;
}
RequestContextComponent contextComponent = null;
RequestContext context = null;
try
{
HttpServletRequest request = data.getRequest();
HttpServletResponse response = data.getResponse();
NavigationalStateComponent nav = (NavigationalStateComponent)Jetspeed.getComponentManager().getComponent(NavigationalStateComponent.class);
//
// Handle Action Phase via Action Pipeline
//
// System.out.println("*** ACTION PARAM FOUND!!!!!!!!!!! ****");
ServletConfig config = data.getServletConfig();
Engine engine = Jetspeed.getEngine();
contextComponent = (RequestContextComponent)Jetspeed.getComponentManager().getComponent(RequestContextComponent.class);
context = contextComponent.create(request, response, config);
//
// Sync up navigational state for J1 Portlet Control decorators
//
//if (state.)
//String state[] = nav.parsePortalParameter(request, "_ns"); // TODO don't hard code
//if (state != null)
context.setAttribute(PortalReservedParameters.PIPELINE, PortalReservedParameters.ACTION_PIPELINE);
engine.service(context);
PortalURL url = context.getPortalURL();
if (url != null)
{
NavigationalState state = url.getNavigationalState();
PortletWindow actionWindow = state.getPortletWindowOfAction();
if (actionWindow == null)
{
Iterator windows = state.getWindowIdIterator();
while (windows.hasNext())
{
String windowId = (String)windows.next();
PortletMode mode = state.getMode(windowId);
WindowState wstate = state.getState(windowId);
if (wstate != null || mode != null)
{
String windowState = "";
if (wstate != null)
windowState = wstate.toString();
String portletMode = "";
if (mode != null)
portletMode = mode.toString();
Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets();
traverse(portlets, windowId, windowState, portletMode, (JetspeedRunData)data);
}
}
}
if (actionWindow != null)
{
String windowId = actionWindow.getId().toString();
//String windowId = nav.getWindowIdFromKey(state[0]);
//System.out.println("got token = " + state[0]+ ", window id = " + windowId + ", action = " + state[1]);
Portlets portlets = ((JetspeedRunData)data).getProfile().getDocument().getPortlets();
//traverse(portlets, windowId, state[1], (JetspeedRunData)data);
String windowState = state.getState(actionWindow).toString();
if (windowState == null)
{
windowState = "";
}
PortletMode mode = state.getMode(actionWindow);
String portletMode = "";
if (mode != null)
portletMode = mode.toString();
traverse(portlets, windowId, windowState, portletMode, (JetspeedRunData)data);
throwit = true;
}
}
}
catch (Throwable t)
{
t.printStackTrace();
log.error("error in fusion access controller", t);
}
finally
{
if (contextComponent != null && context != null)
{
contextComponent.release(context);
}
if (throwit)
throw new Exception("redirecting");
}
}