View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.aggregator;
18  
19  import java.util.List;
20  
21  import javax.servlet.http.HttpServletRequest;
22  import javax.servlet.http.HttpServletResponse;
23  
24  import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
25  import org.apache.jetspeed.om.page.ContentFragment;
26  import org.apache.jetspeed.request.RequestContext;
27  import org.apache.pluto.om.window.PortletWindow;
28  
29  /***
30   * <h4>PortletRendererService<br />
31   * Jetspeed-2 Rendering service.</h4>
32   * <p>This service process all portlet rendering requests and interfaces with the portlet
33   * container to generate the resulting markup</p>
34   *
35   * @author <a href="mailto:raphael@apache.org">Rapha?l Luta</a>
36   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
37   * @author <a>Woonsan Ko</a>
38   * @version $Id: PortletRenderer.java 591867 2007-11-05 02:20:06Z woonsan $
39   */
40  public interface PortletRenderer 
41  {
42      /***
43          Render the specified Page fragment.
44          Result is returned in the PortletResponse.
45       * @throws FailedToRenderFragmentException
46       * @throws FailedToRetrievePortletWindow
47       * @throws UnknownPortletDefinitionException
48       * @throws PortletAccessDeniedException
49       */
50      public void renderNow(ContentFragment fragment, RequestContext request) ;
51  
52      /***
53          Render the specified Page fragment.
54          Result is returned in the PortletResponse.
55       * @throws FailedToRenderFragmentException
56       * @throws FailedToRetrievePortletWindow
57       * @throws UnknownPortletDefinitionException
58       * @throws PortletAccessDeniedException
59       */
60      public void renderNow(ContentFragment fragment, HttpServletRequest request, HttpServletResponse response) ;
61  
62      /*** 
63       * 
64       * Render the specified Page fragment.
65       * The method returns before rendering is complete, rendered content can be
66       * accessed through the ContentDispatcher
67       * @return the asynchronous portlet rendering job to synchronize
68       * @deprecated
69       */
70      public RenderingJob render(ContentFragment fragment, RequestContext request);
71  
72      /*** 
73       * 
74       * Create a rendering job for the specified Page fragment.
75       * The method returns a rendering job which should be passed to 'processRenderingJob(RenderingJob job)' method.
76       * @return portlet rendering job to pass to render(RenderingJob job) method
77       * @throws FailedToRetrievePortletWindow
78       * @throws UnknownPortletDefinitionException
79       * @throws PortletAccessDeniedException
80       */
81      public RenderingJob createRenderingJob(ContentFragment fragment, RequestContext request);
82  
83      /*** 
84       * 
85       * Render the specified rendering job.
86       * The method returns before rendering is complete when the job is processed in parallel mode.
87       * When the job is not parallel mode, it returns after rendering is complete.
88       * @throws FailedToRenderFragmentException
89       */
90      public void processRenderingJob(RenderingJob job);
91          
92      /***
93       * Wait for all rendering jobs in the collection to finish successfully or otherwise. 
94       * @param renderingJobs the Collection of rendering job objects to wait for.
95       */
96      public void waitForRenderingJobs(List renderingJobs);
97      
98      /***
99       * Retrieve the ContentDispatcher for the specified request
100      */
101     public ContentDispatcher getDispatcher(RequestContext request, boolean isParallel);
102 
103     /***
104      * Notify that content completed by worker jobs 
105      * So that renderer can update its state
106      * 
107      * @param content
108      */
109     public void notifyContentComplete(PortletContent content);
110 
111     /***
112      * Set title of portlet window. 
113      * 
114      * @param portletWindow
115      * @param fragment
116      * @param request
117      * @param response
118      * @param dispatcher
119      * @param isCacheTitle
120      */
121     public void addTitleToHeader( PortletWindow portletWindow, ContentFragment fragment, 
122                                   HttpServletRequest request, HttpServletResponse response, 
123                                   ContentDispatcherCtrl dispatcher, boolean isCacheTitle );
124 
125     PortletTrackingManager getPortletTrackingManager();
126     
127 }