<#@ page import='com.caucho.web.*' import='com.caucho.vfs.*' import='com.caucho.server.http.*' import='javax.servlet.*' import='javax.servlet.jsp.*' import='javax.servlet.http.*' #> <#@ cache #> <#! String top = "/"; String title = null; Navigation nav = null; String topnav(Object a, Object b, Object c) { return ""; } void initNavigation(XslWriter out) throws IOException, SAXException { PageContext page = (PageContext) out.getProperty("caucho.page.context"); ServletContext app = page.getServletContext(); HttpServletRequest req = (HttpServletRequest) page.getRequest(); String url = ((CauchoRequest) req).getPageServletPath(); int p = url.lastIndexOf('/'); String base = url.substring(0, p); Path pwd = (Path) out.getProperty("caucho.pwd"); ArrayList paths = new ArrayList(); while (p >= 0) { String realPath = req.getRealPath(url.substring(0, p + 1)); Path path = 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"); if (top == null || top == "") top = "/"; } void writeFamilyNavigation(XslWriter out) throws IOException, SAXException { PageContext page = (PageContext) out.getProperty("caucho.page.context"); 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("tr"); out.pushElement("td"); out.setAttribute("colspan", "2"); out.pushElement("hr"); out.popElement(); out.popElement(); out.popElement(); } else { out.pushElement("tr"); out.pushElement("td"); out.pushElement("img"); out.setAttribute("alt", ""); out.setAttribute("width", "8"); out.setAttribute("height", "8"); out.setAttribute("name", "n" + i); out.setAttribute("src", top + "images/pixel.gif"); out.popElement(); out.popElement(); out.pushElement("td"); String link = child.getLink(); if (link.startsWith("/")); link = link.substring(1); out.pushElement("a"); out.setAttribute("class", "leftnav"); out.setAttribute("onMouseOut", "hide()"); out.setAttribute("onMouseover", "bullet_on('n" + i + "')"); out.setAttribute("href", top + link); out.println(child.getTitle()); out.popElement(); out.popElement(); out.popElement(); } } } void topnav(XslWriter out, String name, String href) throws IOException, SAXException { out.pushElement("img"); out.setAttribute("name", name); out.setAttribute("src", top + "images/pixel.gif"); out.setAttribute("alt", ""); out.setAttribute("width", "8"); out.setAttribute("height", "8"); out.popElement(); out.println(" "); out.pushElement("a"); out.setAttribute("class", "topnav"); out.setAttribute("onMouseover", "bullet_on('" + name + "')"); out.setAttribute("onMouseout", "hide()"); out.setAttribute("href", top + href); out.println(name); out.popElement(); } void printDescription(XslWriter out, Node node, int count) throws IOException, SAXException, XPathException { 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 == '<') cb.append("&"); 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 << <# 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 << <#= title #> >> <#= top #>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()); >> >> >> html/body << <#= top #>images/background.gif
<# writeFamilyNavigation(out); #>
caucho <#= top #>images/caucho.gif

Search
<#= top #>images/pixel.gif top navigation
<#= top #>images/hbleed.gif  
      <{.}>

      By <{.}>
 <# topnav(out, "Home", "index.xtp"); #>  <# topnav(out, "Site Map", "sitemap.xtp"); #>  <# topnav(out, "FAQ", "support/faq.xtp"); #>
 <# topnav(out, "Resin", "products/resin/index.xtp"); #>  <# topnav(out, "Download", "download/index.xtp"); #>  <# topnav(out, "Sales", "sales.xtp"); #>
<#= top #>images/pixel.gif

Home | Resin | Download | Sales | FAQ | Site Map
Copyright © 1998-2000 Caucho Technology. All rights reserved.
Copyright © 1998-2001 Caucho Technology, Inc. All rights reserved.
Resin is a registered trademark of Caucho Technology, Inc.
<#= top #>images/logo.gif
>>