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 javax.servlet.http.HttpServletRequest;
20  import javax.servlet.http.HttpServletResponse;
21  
22  import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
23  import org.apache.jetspeed.om.page.ContentFragment;
24  import org.apache.jetspeed.request.RequestContext;
25  import org.apache.pluto.om.window.PortletWindow;
26  
27  /***
28   * <h4>PortletRendererService<br />
29   * Jetspeed-2 Rendering service.</h4>
30   * <p>This service process all portlet rendering requests and interfaces with the portlet
31   * container to generate the resulting markup</p>
32   *
33   * @author <a href="mailto:raphael@apache.org">Rapha?l Luta</a>
34   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
35   * @author <a>Woonsan Ko</a>
36   * @version $Id: PortletRenderer.java 536245 2007-05-08 16:35:31Z taylor $
37   */
38  public interface PortletRenderer 
39  {
40      /***
41          Render the specified Page fragment.
42          Result is returned in the PortletResponse.
43       * @throws FailedToRenderFragmentException
44       * @throws FailedToRetrievePortletWindow
45       * @throws UnknownPortletDefinitionException
46       * @throws PortletAccessDeniedException
47       */
48      public void renderNow(ContentFragment fragment, RequestContext request) ;
49  
50      /***
51          Render the specified Page fragment.
52          Result is returned in the PortletResponse.
53       * @throws FailedToRenderFragmentException
54       * @throws FailedToRetrievePortletWindow
55       * @throws UnknownPortletDefinitionException
56       * @throws PortletAccessDeniedException
57       */
58      public void renderNow(ContentFragment fragment, HttpServletRequest request, HttpServletResponse response) ;
59  
60      /*** 
61       * 
62       * Render the specified Page fragment.
63       * The method returns before rendering is complete, rendered content can be
64       * accessed through the ContentDispatcher
65       * @return the asynchronous portlet rendering job to synchronize
66       * @deprecated
67       */
68      public RenderingJob render(ContentFragment fragment, RequestContext request);
69  
70      /*** 
71       * 
72       * Create a rendering job for the specified Page fragment.
73       * The method returns a rendering job which should be passed to 'processRenderingJob(RenderingJob job)' method.
74       * @return portlet rendering job to pass to render(RenderingJob job) method
75       * @throws FailedToRetrievePortletWindow
76       * @throws UnknownPortletDefinitionException
77       * @throws PortletAccessDeniedException
78       */
79      public RenderingJob createRenderingJob(ContentFragment fragment, RequestContext request);
80  
81      /*** 
82       * 
83       * Render the specified rendering job.
84       * The method returns before rendering is complete when the job is processed in parallel mode.
85       * When the job is not parallel mode, it returns after rendering is complete.
86       * @throws FailedToRenderFragmentException
87       */
88      public void processRenderingJob(RenderingJob job);
89          
90      /***
91       * Retrieve the ContentDispatcher for the specified request
92       */
93      public ContentDispatcher getDispatcher(RequestContext request, boolean isParallel);
94  
95      /***
96       * Notify that content completed by worker jobs 
97       * So that renderer can update its state
98       * 
99       * @param content
100      */
101     public void notifyContentComplete(PortletContent content);
102 
103     /***
104      * Set title of portlet window. 
105      * 
106      * @param portletWindow
107      * @param fragment
108      * @param request
109      * @param response
110      * @param dispatcher
111      * @param isCacheTitle
112      */
113     public void addTitleToHeader( PortletWindow portletWindow, ContentFragment fragment, 
114                                   HttpServletRequest request, HttpServletResponse response, 
115                                   ContentDispatcherCtrl dispatcher, boolean isCacheTitle );
116 
117     PortletTrackingManager getPortletTrackingManager();
118     
119 }