01: /*
02: * $Id: ViewHandler.java,v 1.2 2003/09/14 05:36:48 jonesde Exp $
03: *
04: * Copyright (c) 2002-2003 The Open For Business Project - www.ofbiz.org
05: *
06: * Permission is hereby granted, free of charge, to any person obtaining a
07: * copy of this software and associated documentation files (the "Software"),
08: * to deal in the Software without restriction, including without limitation
09: * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10: * and/or sell copies of the Software, and to permit persons to whom the
11: * Software is furnished to do so, subject to the following conditions:
12: *
13: * The above copyright notice and this permission notice shall be included
14: * in all copies or substantial portions of the Software.
15: *
16: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17: * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18: * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19: * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20: * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
21: * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
22: * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23: *
24: */
25: package org.ofbiz.content.webapp.view;
26:
27: import javax.servlet.*;
28: import javax.servlet.http.*;
29:
30: /**
31: * ViewHandler - View Handler Interface
32: *
33: * @author <a href="mailto:jaz@ofbiz.org">Andy Zeneski</a>
34: * @version $Revision: 1.2 $
35: * @since 2.0
36: */
37: public interface ViewHandler {
38:
39: /**
40: * Initializes the handler. Since handlers use the singleton pattern this method should only be called
41: * the first time the handler is used.
42: * @param context ServletContext This may be needed by the handler in order to lookup properties or XML
43: * definition files for rendering pages or handler options.
44: * @throws ViewHandlerException
45: */
46: public void init(ServletContext context)
47: throws ViewHandlerException;
48:
49: /**
50: * Render the page.
51: * @param name The name of the view.
52: * @param page The source of the view; could be a page, url, etc depending on the type of handler.
53: * @param info An info string attached to this view
54: * @param request The HttpServletRequest object used when requesting this page.
55: * @param response The HttpServletResponse object to be used to present the page.
56: * @throws ViewHandlerException
57: */
58: public void render(String name, String page, String info,
59: String contentType, String encoding,
60: HttpServletRequest request, HttpServletResponse response)
61: throws ViewHandlerException;
62:
63: }
|