01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/portal/tags/sakai_2-4-1/portal-api/api/src/java/org/sakaiproject/portal/api/PortalRenderEngine.java $
03: * $Id: PortalRenderEngine.java 29143 2007-04-19 01:10:38Z ajpoland@iupui.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.portal.api;
21:
22: import java.io.Writer;
23:
24: import javax.servlet.http.HttpServletRequest;
25: import javax.servlet.http.HttpServletResponse;
26:
27: import org.sakaiproject.tool.api.Placement;
28:
29: /**
30: * Repesents the API used by the protal to comunicate with the RenderEngine
31: * implimentation.
32: *
33: * @author ieb
34: * @since Sakai 2.4
35: * @version $Rev: 29143 $
36: *
37: */
38: public interface PortalRenderEngine {
39:
40: /**
41: * Initialise the render engine
42: *
43: * @throws Exception
44: */
45: void init() throws Exception;
46:
47: /**
48: * generate a non thread safe render context for the current
49: * request/thread/operation
50: *
51: * @param request
52: * @return
53: */
54: PortalRenderContext newRenderContext(HttpServletRequest request);
55:
56: /**
57: * Render a PortalRenderContext against a template. The real template may be
58: * based on a skining name, out output will be send to the Writer
59: *
60: * @param template
61: * @param rcontext
62: * @param out
63: * @throws Exception
64: */
65: void render(String template, PortalRenderContext rcontext,
66: Writer out) throws Exception;
67:
68: /**
69: * prepare for a forward operation in the render engine, this might include
70: * modifying the request attributes.
71: *
72: * @param req
73: * @param res
74: * @param p
75: * @param skin
76: */
77: void setupForward(HttpServletRequest req, HttpServletResponse res,
78: Placement p, String skin);
79:
80: }
|