01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/tool/tags/sakai_2-4-1/tool-api/api/src/java/org/sakaiproject/tool/api/ActiveTool.java $
03: * $Id: ActiveTool.java 9285 2006-05-11 03:16:35Z ggolden@umich.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.tool.api;
21:
22: import javax.servlet.http.HttpServletRequest;
23: import javax.servlet.http.HttpServletResponse;
24:
25: /**
26: * <p>
27: * Extension to tool to introduce Servlet API specific tool activity.
28: * </p>
29: */
30: public interface ActiveTool extends Tool {
31: /** A tool session attribute where the placement's current destination (URL path) is stored. */
32: final static String TOOL_ATTR_CURRENT_DESTINATION = "sakai:tool:current_destination";
33:
34: /**
35: * Invoke the tool to handle the complete request
36: *
37: * @param req
38: * The request.
39: * @param res
40: * The response.
41: * @param placement
42: * The tool placement for this request.
43: * @param toolContext
44: * The (optional) servlet context path that is given to the tool.
45: * @param toolPath
46: * The (optional) servlet pathInfo that is given to the tool.
47: * @throws ToolException
48: * if there's any trouble running the tool.
49: */
50: void forward(HttpServletRequest req, HttpServletResponse res,
51: Placement placement, String toolContext, String toolPath)
52: throws ToolException;
53:
54: /**
55: * Invoke the tool to handle the request by producing a fragment
56: *
57: * @param req
58: * The request.
59: * @param res
60: * The response.
61: * @param placement
62: * The tool placement for this request.
63: * @param toolContext
64: * The (optional) servlet context path that is given to the tool.
65: * @param toolPath
66: * The (optional) servlet pathInfo that is given to the tool.
67: * @throws ToolException
68: * if there's any trouble running the tool.
69: */
70: void include(HttpServletRequest req, HttpServletResponse res,
71: Placement placement, String toolContext, String toolPath)
72: throws ToolException;
73:
74: /**
75: * Invoke the tool to handle the complete request as a helper. Note, the placement is shared between invoker and invoked.
76: *
77: * @param req
78: * The request.
79: * @param res
80: * The response.
81: * @param toolContext
82: * The (optional) servlet context path that is given to the tool.
83: * @param toolPath
84: * The (optional) servlet pathInfo that is given to the tool.
85: * @throws ToolException
86: * if there's any trouble running the tool.
87: */
88: void help(HttpServletRequest req, HttpServletResponse res,
89: String toolContext, String toolPath) throws ToolException;
90: }
|