return;
}
try
{
PortletInstance portletInstance = window.getPortletInstance();
PortletConfig portletConfig = portletInstance.getConfig();
window.getPortletRequestContext().init(portletConfig, getServletContext(), request, response);
window.getPortletResponseContext().init(request, response);
FilterManager filterManager = (FilterManager) window.getAttribute(PortalReservedParameters.PORTLET_FILTER_MANAGER_ATTRIBUTE);
window.removeAttribute(PortalReservedParameters.PORTLET_FILTER_MANAGER_ATTRIBUTE);
if (PortletWindow.Action.ACTION.equals(window.getAction()))
{
ActionRequest actionRequest = (ActionRequest)window.getPortletRequest();
ActionResponse actionResponse = (ActionResponse)window.getPortletResponse();
if (filterManager != null)
{
filterManager.processFilter(actionRequest, actionResponse, portletInstance, portletConfig.getPortletContext());
}
else
{
portletInstance.processAction(actionRequest, actionResponse);
}
}
else if (PortletWindow.Action.RENDER.equals(window.getAction()))
{
RenderRequest renderRequest = (RenderRequest)window.getPortletRequest();
RenderResponse renderResponse = (RenderResponse)window.getPortletResponse();
if (filterManager != null)
{
filterManager.processFilter(renderRequest, renderResponse, portletInstance, portletConfig.getPortletContext());
}
else
{
portletInstance.render(renderRequest, renderResponse);
}
}
else if (PortletWindow.Action.EVENT.equals(window.getAction()))
{
EventRequest eventRequest = (EventRequest)window.getPortletRequest();
EventResponse eventResponse = (EventResponse)window.getPortletResponse();
if (filterManager != null)
{
filterManager.processFilter(eventRequest, eventResponse, portletInstance, portletConfig.getPortletContext());
}
else
{
portletInstance.processEvent(eventRequest, eventResponse);
}
}
else if (PortletWindow.Action.RESOURCE.equals(window.getAction()))
{
ResourceRequest resourceRequest = (ResourceRequest)window.getPortletRequest();
ResourceResponse resourceResponse = (ResourceResponse)window.getPortletResponse();
if (filterManager != null)
{
filterManager.processFilter(resourceRequest, resourceResponse, portletInstance, portletConfig.getPortletContext());
}
else
{
portletInstance.serveResource(resourceRequest, resourceResponse);
}
}
// if we get this far we are home free
return;