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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. ## This is where the common macro's live
  2. #macro ( table $table)
  3. <table>
  4. #foreach ( $items in $table.getChildren() )
  5. #if ($items.getName().equals("tr"))
  6. #tr ($items)
  7. #end
  8. #end
  9. </table>
  10. #end
  11. #macro ( tr $tr)
  12. <tr>
  13. #foreach ( $items in $tr.getChildren() )
  14. #if ($items.getName().equals("td"))
  15. #td ($items)
  16. #elseif ($items.getName().equals("th"))
  17. #th ($items)
  18. #end
  19. #end
  20. </tr>
  21. #end
  22. #macro ( td $value)
  23. #if ($value.getAttributeValue("colspan"))
  24. #set ($colspan = $value.getAttributeValue("colspan"))
  25. #end
  26. #if ($value.getAttributeValue("rowspan"))
  27. #set ($rowspan = $value.getAttributeValue("rowspan"))
  28. #end
  29. <td bgcolor="$tabletdbg" colspan="$!colspan" rowspan="$!rowspan"
  30. valign="top" align="left">
  31. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  32. #if ($value.getText().length() != 0 || $value.hasChildren())
  33. $xmlout.outputString($value, true)
  34. #else
  35. &nbsp;
  36. #end
  37. </font>
  38. </td>
  39. #end
  40. #macro ( th $value)
  41. #if ($value.getAttributeValue("colspan"))
  42. #set ($colspan = $value.getAttributeValue("colspan"))
  43. #end
  44. #if ($value.getAttributeValue("rowspan"))
  45. #set ($rowspan = $value.getAttributeValue("rowspan"))
  46. #end
  47. <td bgcolor="$tablethbg" colspan="$!colspan" rowspan="$!rowspan"
  48. valign="top" align="left">
  49. <font color="#000000" size="-1" face="arial,helvetica,sanserif">
  50. #if ($value.getText().length() != 0 || $value.hasChildren())
  51. $xmlout.outputString($value, true)
  52. #else
  53. &nbsp;
  54. #end
  55. </font>
  56. </td>
  57. #end
  58. #macro ( projectanchor $name $value )
  59. #if ($value.startsWith("http://"))
  60. <a href="$value">$name</a>
  61. #elseif ($value.startsWith("/site"))
  62. <a href="http://jakarta.apache.org$value">$name</a>
  63. #else
  64. <a href="$relativePath$value">$name</a>
  65. #end
  66. #end
  67. #macro ( metaauthor $author $email )
  68. <meta name="author" value="$author">
  69. <meta name="email" value="$email">
  70. #end
  71. #macro ( image $value )
  72. #if ($value.getAttributeValue("width"))
  73. #set ($width=$value.getAttributeValue("width"))
  74. #end
  75. #if ($value.getAttributeValue("height"))
  76. #set ($height=$value.getAttributeValue("height"))
  77. #end
  78. #if ($value.getAttributeValue("align"))
  79. #set ($align=$value.getAttributeValue("align"))
  80. #end
  81. <img src="$relativePath$value.getAttributeValue("src")"
  82. width="$!width" height="$!height" align="$!align">
  83. #end
  84. #macro ( source $value)
  85. <div align="left">
  86. <table cellspacing="4" cellpadding="0" border="0">
  87. <tr>
  88. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  89. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  90. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  91. </tr>
  92. <tr>
  93. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  94. <td bgcolor="#ffffff"><pre>$escape.getText($value.getText())</pre></td>
  95. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  96. </tr>
  97. <tr>
  98. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  99. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  100. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  101. </tr>
  102. </table>
  103. </div>
  104. #end
  105. #macro ( box $value)
  106. <div align="left">
  107. <table cellspacing="4" cellpadding="0" border="0">
  108. <tr>
  109. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  110. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  111. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  112. </tr>
  113. <tr>
  114. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  115. <td bgcolor="#ffffff">
  116. #if ($value.getText().length() != 0 || $value.hasChildren())
  117. $xmlout.outputString($value, true)
  118. #else
  119. &nbsp;
  120. #end
  121. </td>
  122. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  123. </tr>
  124. <tr>
  125. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  126. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  127. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  128. </tr>
  129. </table>
  130. </div>
  131. #end
  132. #macro ( makeProject )
  133. #set ($menus = $project.getChild("body").getChildren("menu"))
  134. #foreach ( $menu in $menus )
  135. <p><strong>$menu.getAttributeValue("name")</strong></p>
  136. <ul>
  137. #foreach ( $item in $menu.getChildren() )
  138. #set ($name = $item.getAttributeValue("name"))
  139. <li>#projectanchor($name $item.getAttributeValue("href"))</li>
  140. #end
  141. </ul>
  142. #end
  143. #end
  144. #macro (getProjectImage)
  145. #if ($project.getChild("logo"))
  146. <td align="left">
  147. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
  148. </td>
  149. <td align="right">
  150. #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
  151. #if ( $logoString.startsWith("/") )
  152. <a href="$project.getAttributeValue("href")"><img src="$relativePath$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  153. #else
  154. <a href="$project.getAttributeValue("href")"><img src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  155. #end
  156. </td>
  157. #else
  158. <td colspan="2">
  159. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
  160. </td>
  161. #end
  162. #end
  163. #macro (header)
  164. <html>
  165. <head>
  166. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  167. #set ($authors = $root.getChild("properties").getChildren("author"))
  168. #foreach ( $au in $authors )
  169. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  170. #end
  171. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  172. </head>
  173. <body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">
  174. <table border="0" width="100%" cellspacing="0">
  175. <!-- TOP IMAGE -->
  176. <tr>
  177. #getProjectImage()
  178. </tr>
  179. </table>
  180. <table border="0" width="100%" cellspacing="4">
  181. <tr><td colspan="2">
  182. <hr noshade="" size="1"/>
  183. </td></tr>
  184. <tr>
  185. <!-- LEFT SIDE NAVIGATION -->
  186. <td valign="top" nowrap="true">
  187. #makeProject()
  188. </td>
  189. <td align="left" valign="top">
  190. #end
  191. #macro (footer)
  192. </td>
  193. </tr>
  194. <!-- FOOTER -->
  195. <tr><td colspan="2">
  196. <hr noshade="" size="1"/>
  197. </td></tr>
  198. <tr><td colspan="2">
  199. <div align="center"><font color="$bodylink" size="-1"><em>
  200. Copyright &#169; 2002, Apache Software Foundation
  201. </em></font></div>
  202. </td></tr>
  203. </table>
  204. </body>
  205. </html>
  206. #end