01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/portal/tags/sakai_2-4-1/portal-portlet-tool/tool/src/java/org/sakaiproject/portal/portlet/PortletRenderEngine.java $
03: * $Id: PortletRenderEngine.java 19790 2006-12-20 15:48:31Z ian@caret.cam.ac.uk $
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.portlet;
21:
22: import java.io.Writer;
23:
24: import javax.portlet.RenderRequest;
25:
26: import org.sakaiproject.portal.portlet.velocity.VelocityPortletRenderEngine;
27:
28: /**
29: * Repesents the API used by the protal to comunicate with the RenderEngine
30: * implimentation.
31: *
32: * @author ieb
33: */
34: public interface PortletRenderEngine {
35:
36: /**
37: * the default render engine impliemtnation
38: */
39: public static final String DEFAULT_RENDER_ENGINE = VelocityPortletRenderEngine.class
40: .getName();
41:
42: /**
43: * Initialise the render engine
44: *
45: * @throws Exception
46: */
47: void init() throws Exception;
48:
49: /**
50: * generate a non thread safe render context for the current
51: * request/thread/operation
52: * @param request
53: *
54: * @return
55: */
56: PortletRenderContext newRenderContext(RenderRequest request);
57:
58: /**
59: * Render a PortalRenderContext against a template. The real template may be
60: * based on a skining name, out output will be send to the Writer
61: *
62: * @param template
63: * @param rcontext
64: * @param out
65: * @throws Exception
66: */
67: void render(String template, PortletRenderContext rcontext,
68: Writer out) throws Exception;
69:
70: }
|