%--
- Licensed Materials - Property of IBM Corp.
- IBM AnthillPro
- (c) Copyright IBM Corporation 2011, 2013. All Rights Reserved.
-
- U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by
- GSA ADP Schedule Contract with IBM Corp.
--%>
<%@ page contentType="text/html" %>
<%@ page pageEncoding="UTF-8" %>
<%@ page import="com.urbancode.anthill3.help.*" %>
<%@ page import="com.urbancode.website.cms.*" %>
<%@ page import="com.urbancode.website.cms.tags.*" %>
<%@ page import="java.io.*" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="cms" prefix="cms" %>
<%
Resource resource = (Resource) request.getAttribute(Constants.RESOURCE);
DirResource parent = resource.getParent();
File parentFile = parent.getResourceFile();
File tocFile = new File(parentFile, "toc.xml");
Book book = BookFactory.getInstance().restore(tocFile);
Topic[] childArray = book.getChildArray();
for (int i = 0; i < childArray.length; i++) {
handleTopic(childArray[i], out, request);
}
%>
<%!
public void handleTopic(Topic topic, JspWriter out, HttpServletRequest request)
throws IOException, JspException {
Topic[] childArray = topic.getChildArray();
// print the
with id if we have a link
out.print("
");
// print container image if there are children
if (childArray.length > 0) {
out.print(" ");
}
// print link and name
if (topic.getUrl() != null) {
out.print("");
out.print(topic.getName());
out.print("");
}
else {
out.print(topic.getName());
}
// handle children
if (childArray.length > 0) {
out.println("
");
for (int i = 0; i < childArray.length; i++) {
handleTopic(childArray[i], out, request);
}
out.println("