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

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