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