01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/help/tags/sakai_2-4-1/help-tool/src/java/org/sakaiproject/tool/help/TOCDisplayTool.java $
03: * $Id: TOCDisplayTool.java 7653 2006-04-12 12:10:02Z marquard@ched.uct.ac.za $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004 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.help;
21:
22: import javax.faces.context.FacesContext;
23: import javax.faces.el.VariableResolver;
24:
25: import org.sakaiproject.api.app.help.TableOfContents;
26:
27: /**
28: * toc display tool
29: * @version $Id: TOCDisplayTool.java 7653 2006-04-12 12:10:02Z marquard@ched.uct.ac.za $
30: */
31: public class TOCDisplayTool {
32: private TableOfContents tableOfContents;
33:
34: /**
35: * get table of contents
36: * @return Returns the tableOfContents.
37: */
38: public TableOfContents getTableOfContents() {
39: if (tableOfContents == null) {
40: FacesContext facesContext = FacesContext
41: .getCurrentInstance();
42: VariableResolver resolver = facesContext.getApplication()
43: .getVariableResolver();
44: tableOfContents = ((TableOfContentsTool) resolver
45: .resolveVariable(facesContext,
46: "TableOfContentsTool"))
47: .getTableOfContents();
48: }
49: return tableOfContents;
50: }
51:
52: }
|