01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/tool/tags/sakai_2-4-1/tool-api/api/src/java/org/sakaiproject/tool/api/ActiveToolManager.java $
03: * $Id: ActiveToolManager.java 27663 2007-03-22 19:50:10Z bkirschn@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 java.util.List;
23:
24: import java.io.File;
25: import java.io.InputStream;
26:
27: import javax.servlet.ServletContext;
28:
29: import org.w3c.dom.Document;
30:
31: /**
32: * <p>
33: * Extension API for ToolManager that introduces Servlet API specific activity.
34: * </p>
35: */
36: public interface ActiveToolManager extends ToolManager {
37: /**
38: * Add this tool to the registry.
39: * @param tool The Tool to register.
40: */
41: void register(Tool tool, ServletContext config);
42:
43: /**
44: * Add tools in this XML DOM to the registry, using the Tool XML schema.
45: * @param toolXml The parsed XML DOM in which tools to be added to the registry are to be found.
46: */
47: void register(Document toolXml, ServletContext config);
48:
49: /**
50: * Add tools in this file of Tool XML schema to the registry.
51: * @param toolXmlFile The file of Tool schema XML in which tools to be added to the registry are to be found.
52: */
53: void register(File toolXmlFile, ServletContext config);
54:
55: /**
56: * Add tools in this stream of Tool XML schema to the registry.
57: * @param toolXmlFile The file of Tool schema XML in which tools to be added to the registry are to be found.
58: */
59: void register(InputStream toolXmlStream, ServletContext config);
60:
61: /**
62: * Parse a registration file and return a list of Tool Registrations
63: * @param toolXmlFile The file of Tool schema XML in which tools to be added to the registry are to be found.
64: */
65: List<Tool> parseTools(File toolXmlFile);
66:
67: /**
68: * Parse a registration file and return a list of Tool Registrations
69: * @param toolXmlFile The file of Tool schema XML in which tools to be added to the registry are to be found.
70: */
71: List<Tool> parseTools(Document toolXml);
72:
73: /**
74: * Find a tool with this well known id in the registry.
75: * @param id The tool's well known id.
76: * @return The Tool object that has this id, or null if not found.
77: */
78: ActiveTool getActiveTool(String id);
79:
80: /**
81: * Get the localized property of a tool
82: * @param toolId The fully qualified id of a sakai tool.
83: * @param key The name of the property, for example title or description.
84: * @return The tool property, null if tool id is invalid.
85: */
86: String getLocalizedToolProperty(String toolId, String key);
87: }
|