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 12 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  1. #*
  2. * Copyright 2000-2006 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. *#
  17. ## This is where the common macro's live
  18. #macro ( table $table)
  19. #if ($table.getAttributeValue("class"))
  20. #set ($class = $table.getAttributeValue("class"))
  21. #else
  22. #set ($class = "ForrestTable")
  23. #end
  24. <table class="$!class" cellspacing="1" cellpadding="4">
  25. #foreach ( $items in $table.getChildren() )
  26. #if ($items.getName().equals("tr"))
  27. #tr ($items)
  28. #end
  29. #end
  30. #if ($table.getParent().getAttributeValue("isbn"))
  31. #set ($isbn = $table.getParent().getAttributeValue("isbn"))
  32. <tr><th>ISBN:</th><td>$!isbn</td></tr>
  33. #end
  34. </table>
  35. #end
  36. #macro ( tr $tr)
  37. <tr>
  38. #foreach ( $items in $tr.getChildren() )
  39. #if ($items.getName().equals("td"))
  40. #td ($items)
  41. #elseif ($items.getName().equals("th"))
  42. #th ($items)
  43. #end
  44. #end
  45. </tr>
  46. #end
  47. #macro ( td $value)
  48. #if ($value.getAttributeValue("colspan"))
  49. #set ($colspan = $value.getAttributeValue("colspan"))
  50. #else
  51. #set ($colspan = 1)
  52. #end
  53. #if ($value.getAttributeValue("rowspan"))
  54. #set ($rowspan = $value.getAttributeValue("rowspan"))
  55. #else
  56. #set ($rowspan = 1)
  57. #end
  58. <td colspan="$!colspan" rowspan="$!rowspan"
  59. valign="top" align="left">
  60. #if ($value.getText().length() != 0 || $value.hasChildren())
  61. $xmlout.outputString($value, true)
  62. #else
  63. &nbsp;
  64. #end
  65. </td>
  66. #end
  67. #macro ( th $value)
  68. #if ($value.getAttributeValue("colspan"))
  69. #set ($colspan = $value.getAttributeValue("colspan"))
  70. #else
  71. #set ($colspan = 1)
  72. #end
  73. #if ($value.getAttributeValue("rowspan"))
  74. #set ($rowspan = $value.getAttributeValue("rowspan"))
  75. #else
  76. #set ($rowspan = 1)
  77. #end
  78. <th colspan="$!colspan" rowspan="$!rowspan"
  79. valign="top" align="left">
  80. #if ($value.getText().length() != 0 || $value.hasChildren())
  81. $xmlout.outputString($value, true)
  82. #else
  83. &nbsp;
  84. #end
  85. </th>
  86. #end
  87. #macro ( projectanchor $name $value )
  88. #if ($value.startsWith("http://"))
  89. <a href="$value">$name</a>
  90. #elseif ($value.startsWith("/site"))
  91. <a href="http://jakarta.apache.org$value">$name</a>
  92. #else
  93. <a href="$relativePath$value">$name</a>
  94. #end
  95. #end
  96. #macro ( metaauthor $author $email )
  97. <meta name="author" content="$author">
  98. <meta name="email" content="$email">
  99. #end
  100. #macro ( image $value )
  101. #if ($value.getAttributeValue("width"))
  102. #set ($width=$value.getAttributeValue("width"))
  103. #end
  104. #if ($value.getAttributeValue("height"))
  105. #set ($height=$value.getAttributeValue("height"))
  106. #end
  107. #if ($value.getAttributeValue("align"))
  108. #set ($align=$value.getAttributeValue("align"))
  109. #end
  110. #if ($value.getAttributeValue("alt"))
  111. #set ($align=$value.getAttributeValue("alt"))
  112. #end
  113. <img src="$relativePath$value.getAttributeValue("src")"
  114. width="$!width" height="$!height" align="$!align" alt="$!alt">
  115. #end
  116. #macro ( source $value)
  117. <pre class="code">$escape.getText($value.getText())</pre>
  118. #end
  119. #macro ( makeTabs )
  120. <div class="tab">
  121. <table summary="tab bar" border="0" cellpadding="0" cellspacing="0">
  122. <tr>
  123. #set ( $tabs = $project.getChild("body").getChildren("menusection"))
  124. #if ( $project.getChild("body").getChild("menusection") )
  125. #foreach ( $tab in $tabs )
  126. #set ($currentIndex = $root.getChild("properties").getChild("index").getAttributeValue("value") )
  127. #set ($index = $tab.getAttributeValue("index"))
  128. #set ($name = $tab.getAttributeValue("name"))
  129. #set ($link = $tab.getAttributeValue("href"))
  130. #if ( ($currentIndex && $currentIndex.trim().equals( $index )) || ((!$currentIndex) && $velocityCount == 1) )
  131. <td width="8"><img alt="" height="5" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  132. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  133. <tr>
  134. <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>
  135. </tr>
  136. </table>
  137. </td>
  138. #else
  139. <td width="5"><img alt="" height="8" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  140. <table summary="non selected tab" style="height: 1.4em" border="0" cellpadding="0" cellspacing="0">
  141. <tr>
  142. <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>
  143. </tr>
  144. </table>
  145. </td>
  146. #end
  147. #end
  148. #else
  149. <td width="8"><img alt="" height="5" width="8" src="$relativePath/images/spacer.gif"></td><td valign="bottom">
  150. <table summary="selected tab" style="height: 1.5em" border="0" cellpadding="0" cellspacing="0">
  151. <tr>
  152. <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>
  153. </tr>
  154. </table>
  155. </td>
  156. #end
  157. </tr>
  158. </table>
  159. </div>
  160. #end
  161. #macro ( makeMainNavigation )
  162. #set ( $tabs = $project.getChild("body").getChildren("menusection"))
  163. #if ( $project.getChild("body").getChild("menusection") )
  164. #set ( $currentIndex = $root.getChild("properties").getChild("index").getAttributeValue("value") )
  165. #if ( $currentIndex )
  166. #foreach ( $tab in $tabs )
  167. #set ($index = $tab.getAttributeValue("index"))
  168. #if ( $currentIndex.trim().equals( $index ) )
  169. #set ($menus = $tab.getChildren("menu"))
  170. #end
  171. #end
  172. #else
  173. #set ($menus = $project.getChild("body").getChild("menusection").getChildren("menu"))
  174. #end
  175. #else
  176. #set ($menus = $project.getChild("body").getChildren("menu"))
  177. #end
  178. #makeProject ( $menus )
  179. #end
  180. #macro (makeProject $menus)
  181. <div class="menucontainer">
  182. #* <div align="center">
  183. <a href="http://ApacheCon.Com/"><img width="125" height="125"
  184. border="0" style="background-color: white"
  185. src="http://www.apache.org/images/ac2005us_blue_125x125.jpg"
  186. alt="ApacheCon!" title="Come to ApacheCon!"/></a>
  187. </div> *#
  188. <div class="menu">
  189. <ul>
  190. #foreach ( $menu in $menus )
  191. <li class="menuheader">$menu.getAttributeValue("name")
  192. <ul>
  193. #foreach ( $item in $menu.getChildren() )
  194. #set ($name = $item.getAttributeValue("name"))
  195. #set ($current = $root.getChild("properties").getChild("title").getText() )
  196. <li>
  197. #if ( $current.trim().equals( $name ) )
  198. <span class="sel">$name</span>
  199. #else
  200. #projectanchor($name $item.getAttributeValue("href"))
  201. #end
  202. </li>
  203. #end
  204. </ul>
  205. </li>
  206. #end
  207. </ul>
  208. </div>
  209. <img style="float: left" height="10" width="10" border="0" alt="" src="$relativePath/images/menu-left.gif">
  210. <img style="float: right" height="10" width="10" border="0" alt="" src="$relativePath/images/menu-right.gif">
  211. </div>
  212. #end
  213. #macro (header)
  214. <html lang="en">
  215. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  216. <head>
  217. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  218. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  219. <link type="text/css" href="$relativePath/page.css" rel="stylesheet">
  220. #set ($authors = $root.getChild("properties").getChildren("author"))
  221. #foreach ( $au in $authors )
  222. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  223. #end
  224. </head>
  225. <body>
  226. <p class="navpath">
  227. <script src="$relativePath/breadcrumbs.js" language="JavaScript" type="text/javascript"></script>
  228. </p>
  229. <div class="logobar">
  230. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  231. <tr>
  232. <td align="left"><img border="0" alt="Apache Ant site" src="$relativePath/images/group-logo.gif"></td>
  233. <td align="center" width="100%"><img alt="Apache Ant logo" border="0" src="$relativePath/images/project-logo.gif"></td>
  234. <td align="right">
  235. <form target="_blank" onsubmit="q.value = query.value + ' site:ant.apache.org'" action="http://www.google.com/search" method="get">
  236. <table summary="search" border="0" cellspacing="0" cellpadding="0" bgcolor="$blue2">
  237. <tr>
  238. <td colspan="3"><img height="10" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  239. </tr>
  240. <tr>
  241. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  242. <td nowrap="nowrap" class="searchcaption">
  243. <input name="q" type="hidden">
  244. <input size="15" id="query" type="text">
  245. <img height="1" width="5" alt="" src="$relativePath/images/spacer.gif">
  246. <input name="Search" value="Search" type="submit">
  247. <br>
  248. the Apache Ant site
  249. </td>
  250. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  251. </tr>
  252. <tr>
  253. <td><img alt="" border="0" height="10" width="9" src="$relativePath/images/search-left.gif"></td>
  254. <td><img height="1" width="1" alt="" src="$relativePath/images/spacer.gif"></td>
  255. <td><img alt="" border="0" height="10" width="9" src="$relativePath/images/search-right.gif"></td>
  256. </tr>
  257. </table>
  258. </form>
  259. </td>
  260. </tr>
  261. </table>
  262. </div>
  263. #makeTabs()
  264. <div class="bluebar"></div>
  265. #makeMainNavigation()
  266. <div class="lightbluebar">&nbsp;</div>
  267. #end
  268. #macro (footer)
  269. <p class="copyright">
  270. Copyright &copy; 2000-2006&nbsp;The Apache Software Foundation. All rights reserved.
  271. <script type="text/javascript" language="JavaScript"><!--
  272. document.write(" - "+"Last Published: " + document.lastModified);
  273. // -->
  274. </script>
  275. </p>
  276. </body>
  277. </html>
  278. #end