You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

templates.vm 13 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. #*
  2. * ============================================================================
  3. * The Apache Software License, Version 1.1
  4. * ============================================================================
  5. *
  6. * Copyright (C) 2000-2003 The Apache Software Foundation. All
  7. * rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without modifica-
  10. * tion, are permitted provided that the following conditions are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright notice,
  13. * this list of conditions and the following disclaimer.
  14. *
  15. * 2. Redistributions in binary form must reproduce the above copyright notice,
  16. * this list of conditions and the following disclaimer in the documentation
  17. * and/or other materials provided with the distribution.
  18. *
  19. * 3. The end-user documentation included with the redistribution, if any, must
  20. * include the following acknowledgment: "This product includes software
  21. * developed by the Apache Software Foundation (http://www.apache.org/)."
  22. * Alternately, this acknowledgment may appear in the software itself, if
  23. * and wherever such third-party acknowledgments normally appear.
  24. *
  25. * 4. The names "Ant" and "Apache Software Foundation" must not be used to
  26. * endorse or promote products derived from this software without prior
  27. * written permission. For written permission, please contact
  28. * apache@apache.org.
  29. *
  30. * 5. Products derived from this software may not be called "Apache", nor may
  31. * "Apache" appear in their name, without prior written permission of the
  32. * Apache Software Foundation.
  33. *
  34. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  35. * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  36. * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  37. * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  38. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  39. * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  40. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  41. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  42. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  43. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  44. *
  45. * This software consists of voluntary contributions made by many individuals
  46. * on behalf of the Apache Software Foundation. For more information on the
  47. * Apache Software Foundation, please see <http://www.apache.org/>.
  48. *
  49. *#
  50. ## This is where the common macro's live
  51. #macro ( table $table)
  52. <table class="ForrestTable" cellspacing="1" cellpadding="4">
  53. #foreach ( $items in $table.getChildren() )
  54. #if ($items.getName().equals("tr"))
  55. #tr ($items)
  56. #end
  57. #end
  58. </table>
  59. #end
  60. #macro ( tr $tr)
  61. <tr>
  62. #foreach ( $items in $tr.getChildren() )
  63. #if ($items.getName().equals("td"))
  64. #td ($items)
  65. #elseif ($items.getName().equals("th"))
  66. #th ($items)
  67. #end
  68. #end
  69. </tr>
  70. #end
  71. #macro ( td $value)
  72. #if ($value.getAttributeValue("colspan"))
  73. #set ($colspan = $value.getAttributeValue("colspan"))
  74. #else
  75. #set ($colspan = 1)
  76. #end
  77. #if ($value.getAttributeValue("rowspan"))
  78. #set ($rowspan = $value.getAttributeValue("rowspan"))
  79. #else
  80. #set ($rowspan = 1)
  81. #end
  82. <td colspan="$!colspan" rowspan="$!rowspan"
  83. valign="top" align="left">
  84. #if ($value.getText().length() != 0 || $value.hasChildren())
  85. $xmlout.outputString($value, true)
  86. #else
  87. &nbsp;
  88. #end
  89. </td>
  90. #end
  91. #macro ( th $value)
  92. #if ($value.getAttributeValue("colspan"))
  93. #set ($colspan = $value.getAttributeValue("colspan"))
  94. #else
  95. #set ($colspan = 1)
  96. #end
  97. #if ($value.getAttributeValue("rowspan"))
  98. #set ($rowspan = $value.getAttributeValue("rowspan"))
  99. #else
  100. #set ($rowspan = 1)
  101. #end
  102. <th colspan="$!colspan" rowspan="$!rowspan"
  103. valign="top" align="left">
  104. #if ($value.getText().length() != 0 || $value.hasChildren())
  105. $xmlout.outputString($value, true)
  106. #else
  107. &nbsp;
  108. #end
  109. </th>
  110. #end
  111. #macro ( projectanchor $name $value )
  112. #if ($value.startsWith("http://"))
  113. <a href="$value">$name</a>
  114. #elseif ($value.startsWith("/site"))
  115. <a href="http://jakarta.apache.org$value">$name</a>
  116. #else
  117. <a href="$relativePath$value">$name</a>
  118. #end
  119. #end
  120. #macro ( metaauthor $author $email )
  121. <meta name="author" content="$author">
  122. <meta name="email" content="$email">
  123. #end
  124. #macro ( image $value )
  125. #if ($value.getAttributeValue("width"))
  126. #set ($width=$value.getAttributeValue("width"))
  127. #end
  128. #if ($value.getAttributeValue("height"))
  129. #set ($height=$value.getAttributeValue("height"))
  130. #end
  131. #if ($value.getAttributeValue("align"))
  132. #set ($align=$value.getAttributeValue("align"))
  133. #end
  134. #if ($value.getAttributeValue("alt"))
  135. #set ($align=$value.getAttributeValue("alt"))
  136. #end
  137. <img src="$relativePath$value.getAttributeValue("src")"
  138. width="$!width" height="$!height" align="$!align" alt="$!alt">
  139. #end
  140. #macro ( source $value)
  141. <pre class="code">$escape.getText($value.getText())</pre>
  142. #end
  143. #macro ( makeTabs )
  144. <div class="tab">
  145. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  146. <tr>
  147. #set ( $tabs = $project.getChild("body").getChildren("menusection"))
  148. #if ( $project.getChild("body").getChild("menusection") )
  149. #foreach ( $tab in $tabs )
  150. #set ($currentIndex = $root.getChild("properties").getChild("index").getAttributeValue("value") )
  151. #set ($index = $tab.getAttributeValue("index"))
  152. #set ($name = $tab.getAttributeValue("name"))
  153. #set ($link = $tab.getAttributeValue("href"))
  154. #if ( ($currentIndex && $currentIndex.trim().equals( $index )) || ((!$currentIndex) && $velocityCount == 1) )
  155. <td width="8"><img alt="" height="5" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  156. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  157. <tr>
  158. <td valign="top" width="5" bgcolor="$blue2"><img height="5" width="5" alt="" src="$relativePath/images/tabSel-left.gif"></td><td valign="middle" bgcolor="$blue2"><font color="$lightfg" size="2" face="Arial, Helvetica, Sans-serif"><b>$name</b></font></td><td valign="top" width="5" bgcolor="$blue2"><img height="5" width="5" alt="" src="$relativePath/images/tabSel-right.gif"></td>
  159. </tr>
  160. </table>
  161. </td>
  162. #else
  163. <td width="5"><img alt="" height="8" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  164. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  165. <tr>
  166. <td valign="top" width="5" bgcolor="$blue4"><img height="5" width="5" alt="" src="$relativePath/images/tab-left.gif"></td><td valign="middle" bgcolor="$blue4"><a href="$relativePath$link"><font size="2" face="Arial, Helvetica, Sans-serif">$name</font></a></td><td valign="top" width="5" bgcolor="$blue4"><img height="5" width="5" alt="" src="$relativePath/images/tab-right.gif"></td>
  167. </tr>
  168. </table>
  169. </td>
  170. #end
  171. #end
  172. #else
  173. <td width="8"><img alt="" height="5" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  174. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  175. <tr>
  176. <td valign="top" width="5" bgcolor="$blue2"><img height="5" width="5" alt="" src="$relativePath/images/tabSel-left.gif"></td><td valign="middle" bgcolor="$blue2"><font color="$lightfg" size="2" face="Arial, Helvetica, Sans-serif"><b>Home</b></font></td><td valign="top" width="5" bgcolor="$blue2"><img height="5" width="5" alt="" src="$relativePath/images/tabSel-right.gif"></td>
  177. </tr>
  178. </table>
  179. </td>
  180. #end
  181. </tr>
  182. </table>
  183. </div>
  184. #end
  185. #macro ( makeMainNavigation )
  186. #set ( $tabs = $project.getChild("body").getChildren("menusection"))
  187. #if ( $project.getChild("body").getChild("menusection") )
  188. #set ( $currentIndex = $root.getChild("properties").getChild("index").getAttributeValue("value") )
  189. #if ( $currentIndex )
  190. #foreach ( $tab in $tabs )
  191. #set ($index = $tab.getAttributeValue("index"))
  192. #if ( $currentIndex.trim().equals( $index ) )
  193. #set ($menus = $tab.getChildren("menu"))
  194. #end
  195. #end
  196. #else
  197. #set ($menus = $project.getChild("body").getChild("menusection").getChildren("menu"))
  198. #end
  199. #else
  200. #set ($menus = $project.getChild("body").getChildren("menu"))
  201. #end
  202. #makeProject ( $menus )
  203. #end
  204. #macro (makeProject $menus)
  205. <div class="menucontainer">
  206. <div class="menu">
  207. <ul>
  208. #foreach ( $menu in $menus )
  209. <li class="menuheader">$menu.getAttributeValue("name")
  210. <ul>
  211. #foreach ( $item in $menu.getChildren() )
  212. #set ($name = $item.getAttributeValue("name"))
  213. #set ($current = $root.getChild("properties").getChild("title").getText() )
  214. <li>
  215. #if ( $current.trim().equals( $name ) )
  216. <span class="sel">$name</span>
  217. #else
  218. #projectanchor($name $item.getAttributeValue("href"))
  219. #end
  220. </li>
  221. #end
  222. </ul>
  223. </li>
  224. #end
  225. </ul>
  226. </div>
  227. <img style="float: left" height="10" width="10" border="0" alt="" src="$relativePath/images/menu-left.gif">
  228. <img style="float: right" height="10" width="10" border="0" alt="" src="$relativePath/images/menu-right.gif">
  229. </div>
  230. #end
  231. #macro (header)
  232. <html lang="en">
  233. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  234. <head>
  235. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  236. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  237. <link type="text/css" href="$relativePath/page.css" rel="stylesheet">
  238. #set ($authors = $root.getChild("properties").getChildren("author"))
  239. #foreach ( $au in $authors )
  240. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  241. #end
  242. </head>
  243. <body>
  244. <p class="navpath">
  245. <script src="$relativePath/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  246. </p>
  247. <div class="logobar">
  248. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  249. <tr>
  250. <td align="left"><img border="0" alt="Apache Ant site" src="$relativePath/images/group-logo.gif"></td>
  251. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="$relativePath/images/project-logo.gif"></td>
  252. <td align="right">
  253. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  254. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="$blue2">
  255. <tr>
  256. <td colspan="3"><img height="10" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  257. </tr>
  258. <tr>
  259. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  260. <td nowrap="nowrap" class="searchcaption">
  261. <input name="q" type="hidden">
  262. <input size="15" id="query" type="text">
  263. <img height="1" width="5" alt="" src="$relativePath/images/spacer.gif">
  264. <input name="Search" value="Search" type="submit">
  265. <br>
  266. the Apache Ant site
  267. </td>
  268. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  269. </tr>
  270. <tr>
  271. <td><img alt="" border="0" height="10" width="9" src="$relativePath/images/search-left.gif"></td>
  272. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  273. <td><img alt="" border="0" height="10" width="9" src="$relativePath/images/search-right.gif"></td>
  274. </tr>
  275. </table>
  276. </form>
  277. </td>
  278. </tr>
  279. </table>
  280. </div>
  281. #makeTabs()
  282. <div class="bluebar"></div>
  283. #makeMainNavigation()
  284. <div class="lightbluebar">&nbsp;</div>
  285. #end
  286. #macro (footer)
  287. <p class="copyright">
  288. Copyright &copy; 2000-2003&nbsp;The Apache Software Foundation. All rights reserved.
  289. <script type="text/javascript" language="JavaScript"><!--
  290. document.write(" - "+"Last Published: " + document.lastModified);
  291. // -->
  292. </script>
  293. </p>
  294. </body>
  295. </html>
  296. #end