<#@ page import='com.caucho.web.*' import='com.caucho.vfs.*' import='com.caucho.server.http.*' #> <#@ cache #> <#! String top = "/"; String title = null; String section = ""; Navigation nav = null; String topnav(Object a, Object b, Object c) { return ""; } void initNavigation(XslWriter out) throws IOException { PageContext page = (PageContext) out.getProperty("caucho.page.context"); ServletContext app = page.getServletContext(); HttpServletRequest req = (HttpServletRequest) page.getRequest(); String url = req.getRequestURI(); int p = url.lastIndexOf('/'); String base = url.substring(0, p); ArrayList paths = new ArrayList(); while (p >= 0) { String prefix = url.substring(0, p + 1); CauchoApplication subapp = (CauchoApplication) app.getContext(prefix); String rel = prefix.substring(subapp.getContextPath().length()); String realPath = subapp.getRealPath(rel); Path path = ((Path) out.getProperty("caucho.pwd")).lookupNative(realPath); paths.add(path); if (path.lookup("toc.xml").exists()) out.addCacheDepend(path.lookup("toc.xml")); p = url.lastIndexOf('/', p - 1); } nav = Navigation.createNested(paths, base); if (nav == null) nav = new Navigation(); top = nav.getAttribute("top"); top = req.getContextPath() + top; if (! top.endsWith("/")) top = top + "/"; } void writeFamilyNavigation(XslWriter out) throws IOException, SAXException, XPathException { PageContext page = out.getPage(); HttpServletRequest req = (HttpServletRequest) page.getRequest(); NavItem item = nav.findURL(req.getRequestURI()); ArrayList list = null; if (item != null) list = item.familyNavigation(); if (list == null || list.size() == 0) return; for (int i = 0; i < list.size(); i++) { NavItem child = (NavItem) list.get(i); if (child == null) { out.pushElement("hr"); out.popElement(); } else { String link = child.getLink(); if (link.startsWith("/")); link = link.substring(1); out.pushElement("a"); out.setAttribute("class", "leftnav"); out.setAttribute("href", top + link); out.println(child.getTitle()); out.popElement(); out.pushElement("br"); out.popElement(); } } } void writeThreaded(XslWriter out, boolean allowComments) throws IOException, SAXException, XPathException { PageContext page = out.getPage(); HttpServletRequest req = (HttpServletRequest) page.getRequest(); NavItem item = nav.findURL(req.getRequestURI()); if (item == null) return; out.pushElement("table"); out.setAttribute("border", "0"); out.setAttribute("cellspacing", "0"); out.setAttribute("width", "100%"); out.pushElement("tr"); out.pushElement("td"); NavItem prev = item.getPreviousPreorder(); if (prev == null) out.print(" "); else { out.pushElement("a"); out.setAttribute("href", prev.getLink()); out.print(prev.getTitle()); out.popElement(); } out.popElement(); if (allowComments && ! nav.getAttribute("comment").equals("")) { out.pushElement("td"); out.setAttribute("width", "100%"); out.pushElement("jsp:scriptlet"); out.print("String headerUrl = request.getContextPath() + request.getServletPath();"); out.popElement(); out.pushElement("center"); out.pushElement("a"); out.setAttribute("href", "/quercus/comment/commentServlet?cmd=add_comment&comment_url=<%= headerUrl %>"); out.print("add documentation note"); out.popElement(); out.popElement(); out.popElement(); } else if (item.getParent() != null) { NavItem parent = item.getParent(); out.pushElement("td"); out.setAttribute("width", "100%"); out.pushElement("center"); out.pushElement("a"); out.setAttribute("href", parent.getLink()); out.print(parent.getTitle()); out.popElement(); out.popElement(); out.popElement(); } else { out.pushElement("td"); out.setAttribute("width", "100%"); out.print(" "); out.popElement(); } out.pushElement("td"); out.setAttribute("align", "right"); NavItem next = item.getNextPreorder(); if (next == null) out.print(" "); else { out.pushElement("a"); out.setAttribute("href", next.getLink()); out.print(next.getTitle()); out.popElement(); } out.popElement(); out.popElement(); out.popElement(); } void topnav(XslWriter out, String name, String href) throws IOException, SAXException, XPathException { out.pushElement("a"); out.setAttribute("class", "topnav"); out.setAttribute("href", "/" + href); out.println(name); out.popElement(); } void printDescription(XslWriter out, Node node, int count) throws IOException, SAXException, XPathException { if (node == null) return; CharBuffer cb = CharBuffer.allocate(); Iterator iter = XPath.select(".//text()|.//resin|.//resintm", node); while (iter.hasNext()) { Node subnode = (Node) iter.next(); if (subnode.getNodeName().equals("#text")) { String str = subnode.getNodeValue(); for (int i = 0; i < str.length(); i++) { char ch = str.charAt(i); if (ch == '<' && i + 1 < str.length() && str.charAt(i + 1) == '%') { for (; i + 1 < str.length(); i++) { if (str.charAt(i) == '%' && str.charAt(i + 1) == '>') { i += 1; break; } } } else if (ch == '<') cb.append("<"); else if (ch == '>') cb.append(">"); else if (ch == '&') cb.append("&"); else if (Character.isWhitespace(ch) && i < 0 && Character.isWhitespace(str.charAt(i - 1))) { } else if (ch != '"' && ch != '\'') cb.append(ch); } } else if (subnode.getNodeName().equals("resin")) cb.append("Resin"); else if (subnode.getNodeName().equals("resintm")) cb.append("Resin(tm)"); if (cb.length() >= count) break; } if (cb.length() > count) cb.setLength(count); if (cb.length() > 0) { out.pushElement("meta"); out.setAttribute("name", "description"); out.setAttribute("content", cb.close()); out.popElement(); } } #> html << $apply-templates(head/ct:prefix/node()); <# initNavigation(out); title = XPath.evalString("head/title", node); if (title == null) title = ""; #> $if (head/title/@browser-title) << $(head/title/@browser-title) >> $else $if (head/title/@section) << $(head/title/@section)<#= title #> >> $else << <#= section + title #> >> /css/default.css $if (head/title/@description) << >> $else $if (head/meta[@name="description"]) << >> $else <# printDescription(out, XPath.find("/html/body", node), 256); #> $for-each(head/meta) << $copy << $apply-templates(@*|node()); >> >> $if (head/title/@keywords) << >> >> html[body/s1] << $apply-templates(head/ct:prefix/node()); <# initNavigation(out); title = XPath.evalString("if(body/s1/title,body/s1/title,body/s1/@title)", node); if (title == null) title = ""; #> $if (body/s1/@browser-title) << $(body/s1/@browser-title) >> $else $if (body/s1/@section) << $(body/s1/@section)<#= title #> >> $else << <#= section + title #> >> /css/default.css $if (body/s1/@description) << >> $else $if (body/s1[@name="description"]) << >> $else <# printDescription(out, XPath.find("body/s1", node), 256); #> $for-each(head/meta) << $copy << $apply-templates(@*|node()); >> >> $if (body/s1/@keywords) << >> >> html/body << /images/background.gif
caucho /images/caucho.gif
Search
<# writeFamilyNavigation(out); #>
/images/pixel.gif top navigation
/images/hbleed.gif      
      <{.}>

      <{.}>

      

      

      By <{.}>

      By <{.}>
  <# topnav(out, "Home", "index.xtp"); #>   <# topnav(out, "Site Map", "sitemap.xtp"); #>   <# topnav(out, "FAQ", "quercus/faq/overview.xtp"); #>
  <# topnav(out, "Products", "products/"); #>   <# topnav(out, "Download", "download/"); #>   <# topnav(out, "Sales", "sales/"); #>
/images/pixel.gif
<# if (nav != null && nav.getAttribute("threaded").equals("true")) { writeThreaded(out, false); out.pushElement("hr"); out.popElement(); } #> <# if (nav != null && ! nav.getAttribute("comment").equals("")) { #> <% try { ServletContext root = application.getContext("/"); RequestDispatcher disp; disp = root.getRequestDispatcher("/quercus/comment/list.xtp"); disp.include(request, response); } catch (Exception e) { application.log("comment error", e); } %> <# } #>
<# if (nav != null && nav.getAttribute("threaded").equals("true")) writeThreaded(out, true); #>
Home | Resin | Resin Enterprise | Download | Sales | FAQ | Site Map | Contact Caucho
Copyright © 1998-2002 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark, and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc.
/images/logo.gif
>>