final PortletResponse portletResponse = (PortletResponse) request.getAttribute(PortletInvokerService.PORTLET_RESPONSE);
final PortletRequestContext requestContext = (PortletRequestContext) portletRequest.getAttribute(PortletInvokerService.REQUEST_CONTEXT);
final PortletResponseContext responseContext = (PortletResponseContext) portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
final FilterManager filterManager = (FilterManager) request.getAttribute(PortletInvokerService.FILTER_MANAGER);
request.removeAttribute(PortletInvokerService.METHOD_ID);
request.removeAttribute(PortletInvokerService.PORTLET_REQUEST);
request.removeAttribute(PortletInvokerService.PORTLET_RESPONSE);
request.removeAttribute(PortletInvokerService.FILTER_MANAGER);
DriverPortletConfig portletConfig = portletConfigs.get(portletName);
requestContext.init(portletConfig, getServletContext(), request, response);
responseContext.init(request, response);
PortletWindow window = requestContext.getPortletWindow();
PortletInvocationEvent event = new PortletInvocationEvent(portletRequest, window, methodId.intValue());
notify(event, true, null);
// FilterManager filtermanager = (FilterManager) request.getAttribute(
// "filter-manager");
try {
// The requested method is RENDER: call Portlet.render(..)
if (methodId == PortletInvokerService.METHOD_RENDER) {
RenderRequest renderRequest = (RenderRequest) portletRequest;
RenderResponse renderResponse = (RenderResponse) portletResponse;
filterManager.processFilter(renderRequest, renderResponse,
portlet, portletContext);
}
// The requested method is RESOURCE: call
// ResourceServingPortlet.serveResource(..)
else if (methodId == PortletInvokerService.METHOD_RESOURCE) {
ResourceRequest resourceRequest = (ResourceRequest) portletRequest;
ResourceResponse resourceResponse = (ResourceResponse) portletResponse;
filterManager.processFilter(resourceRequest, resourceResponse,
resourceServingPortlet, portletContext);
}
// The requested method is ACTION: call Portlet.processAction(..)
else if (methodId == PortletInvokerService.METHOD_ACTION) {
ActionRequest actionRequest = (ActionRequest) portletRequest;
ActionResponse actionResponse = (ActionResponse) portletResponse;
filterManager.processFilter(actionRequest, actionResponse,
portlet, portletContext);
}
// The request methode is Event: call Portlet.processEvent(..)
else if (methodId == PortletInvokerService.METHOD_EVENT) {
EventRequest eventRequest = (EventRequest) portletRequest;
EventResponse eventResponse = (EventResponse) portletResponse;
filterManager.processFilter(eventRequest, eventResponse,
eventPortlet, portletContext);
}
// The requested method is ADMIN: call handlers.
else if (methodId == PortletInvokerService.METHOD_ADMIN) {
PortalAdministrationService pas = PlutoServices.getServices().getPortalAdministrationService();