weaver      2005/01/12 09:20:54

  Modified:    portal/src/java/org/apache/jetspeed/aggregator/impl
                        RenderingJob.java PortletRendererImpl.java
  Log:
  removed redundant logic
  
  Revision  Changes    Path
  1.8       +11 -13    
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJob.java
  
  Index: RenderingJob.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/RenderingJob.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- RenderingJob.java 11 Jan 2005 20:02:00 -0000      1.7
  +++ RenderingJob.java 12 Jan 2005 17:20:53 -0000      1.8
  @@ -22,8 +22,6 @@
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.apache.jetspeed.PortalReservedParameters;
  -import org.apache.jetspeed.aggregator.ContentDispatcher;
  -import org.apache.jetspeed.aggregator.ContentDispatcherCtrl;
   import org.apache.jetspeed.aggregator.PortletContent;
   import org.apache.jetspeed.om.page.Fragment;
   import org.apache.jetspeed.request.RequestContext;
  @@ -47,24 +45,23 @@
       private PortletWindow window = null;
       private HttpServletRequest request = null;
       private HttpServletResponse response = null;
  -    private ContentDispatcherCtrl dispatcherCtrl = null;
  -    private ContentDispatcher dispatcher = null;
  +    
       private PortletContainer container = null;
       private Fragment fragment = null;
       private RequestContext requestContext = null;
   
       private PortletContent portletContent;
       
  -    public RenderingJob(PortletContainer container, ContentDispatcher 
dispatcher, Fragment fragment, HttpServletRequest request, HttpServletResponse 
response, RequestContext requestContext, PortletWindow window)
  +    public RenderingJob(PortletContainer container, PortletContent 
portletContent, Fragment fragment, HttpServletRequest request, 
HttpServletResponse response, RequestContext requestContext, PortletWindow 
window)
       {
           this.container = container;
  -        this.dispatcher = dispatcher;
  -        this.dispatcherCtrl = (ContentDispatcherCtrl) dispatcher;
  +        
           this.fragment = fragment;
           this.request = request;
           this.response = response;
           this.requestContext = requestContext; 
           this.window = window;
  +        this.portletContent = portletContent;     
           
       }
   
  @@ -76,6 +73,8 @@
       {       
           try
           {
  +            // A little baby hack to make sure the worker thread has 
PortletContent to write too.
  +            fragment.setPortletContent(portletContent);
               execute();                     
           }
           finally
  @@ -98,17 +97,16 @@
        */
       protected void execute()
       {
  -        portletContent = dispatcher.getPortletContent(fragment);
  +        
           try
  -        {
  +        {           
               log.debug("Rendering OID "+this.window.getId()+" "+ this.request 
+" "+this.response);            
               
this.request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, 
fragment);
               
this.request.setAttribute(PortalReservedParameters.PAGE_ATTRIBUTE, 
requestContext.getPage());
               
this.request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, 
requestContext);
  -            
this.request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE,dispatcher);
  +          //  
this.request.setAttribute(PortalReservedParameters.CONTENT_DISPATCHER_ATTRIBUTE,dispatcher);
               container.renderPortlet(this.window, this.request, 
this.response);               
  -            this.response.flushBuffer();             
  -            fragment.setPortletContent(portletContent);                      
  
  +            this.response.flushBuffer();                           
           }
           catch (Throwable t)
           {
  
  
  
  1.27      +10 -6     
jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java
  
  Index: PortletRendererImpl.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-jetspeed-2/portal/src/java/org/apache/jetspeed/aggregator/impl/PortletRendererImpl.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- PortletRendererImpl.java  11 Jan 2005 20:02:00 -0000      1.26
  +++ PortletRendererImpl.java  12 Jan 2005 17:20:53 -0000      1.27
  @@ -24,6 +24,7 @@
   import org.apache.jetspeed.aggregator.ContentDispatcher;
   import org.apache.jetspeed.aggregator.ContentDispatcherCtrl;
   import org.apache.jetspeed.aggregator.FailedToRenderFragmentException;
  +import org.apache.jetspeed.aggregator.PortletContent;
   import org.apache.jetspeed.aggregator.PortletRenderer;
   import org.apache.jetspeed.aggregator.UnknownPortletDefinitionException;
   import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
  @@ -234,17 +235,20 @@
   
           PortletWindow portletWindow = getPortletWindow(fragment);
           ContentDispatcherCtrl dispatcherCtrl = 
getDispatcherCtrl(requestContext, true);
  -        dispatcher = getDispatcher(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, 
request);
  -
  +        
request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, 
request);        
           request.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, 
fragment);
  -        return new RenderingJob(container, dispatcher, fragment, request, 
response, requestContext, portletWindow);
  +        
  +        PortletContent portletContent = 
dispatcher.getPortletContent(fragment);
  +        fragment.setPortletContent(portletContent);
  +        return new RenderingJob(container, portletContent, fragment, 
request, response, requestContext, portletWindow);
   
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to