protected RenderingJob buildRenderingJob( ContentFragment fragment, HttpServletRequest request,
HttpServletResponse response, RequestContext requestContext ) throws FailedToRetrievePortletWindow,
FailedToRenderFragmentException, PortletEntityNotStoredException
{
ContentDispatcher dispatcher = null;
PortletWindow portletWindow = getPortletWindow(fragment);
ContentDispatcherCtrl dispatcherCtrl = getDispatcherCtrl(requestContext, true);
dispatcher = getDispatcher(requestContext, true);
request = requestContext.getRequestForWindow(portletWindow);
response = dispatcherCtrl.getResponseForWindow(portletWindow, requestContext);
request.setAttribute(PortalReservedParameters.PAGE_ATTRIBUTE, requestContext.getPage());
request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment);
request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE, dispatcher);
request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, requestContext);
request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, fragment);
request.setAttribute(PortalReservedParameters.PATH_ATTRIBUTE, requestContext.getAttribute(PortalReservedParameters.PATH_ATTRIBUTE));
request.setAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE, portletWindow);
PortletContent portletContent = dispatcher.getPortletContent(fragment);
fragment.setPortletContent(portletContent);
return new RenderingJobImpl(container, portletContent, fragment, request, response, requestContext, portletWindow, statistics);
}