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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  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 ( makeProject )
  106. #set ($menus = $project.getChild("body").getChildren("menu"))
  107. #foreach ( $menu in $menus )
  108. <p><strong>$menu.getAttributeValue("name")</strong></p>
  109. <ul>
  110. #foreach ( $item in $menu.getChildren() )
  111. #set ($name = $item.getAttributeValue("name"))
  112. <li>#projectanchor($name $item.getAttributeValue("href"))</li>
  113. #end
  114. </ul>
  115. #end
  116. #end
  117. #macro (getProjectImage)
  118. #if ($project.getChild("logo"))
  119. <td align="left">
  120. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" border="0"/></a>
  121. </td>
  122. <td align="center">
  123. <a href="http://www.javaworld.com"><img src="images/jw_ec_logo_winner2002.gif" border="0"/></a>
  124. </td>
  125. <td align="right">
  126. #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
  127. #if ( $logoString.startsWith("/") )
  128. <a href="$project.getAttributeValue("href")"><img src="$relativePath$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  129. #else
  130. <a href="$project.getAttributeValue("href")"><img src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  131. #end
  132. </td>
  133. #else
  134. <td colspan="2">
  135. <a href="http://jakarta.apache.org"><img src="http://jakarta.apache.org/images/jakarta-logo.gif" align="left" border="0"/></a>
  136. </td>
  137. #end
  138. #end
  139. #macro (header)
  140. <html>
  141. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  142. <head>
  143. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  144. #set ($authors = $root.getChild("properties").getChildren("author"))
  145. #foreach ( $au in $authors )
  146. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  147. #end
  148. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  149. </head>
  150. <body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">
  151. <table border="0" width="100%" cellspacing="0">
  152. <!-- TOP IMAGE -->
  153. <tr>
  154. #getProjectImage()
  155. </tr>
  156. </table>
  157. <table border="0" width="100%" cellspacing="4">
  158. <tr><td colspan="2">
  159. <hr noshade="" size="1"/>
  160. </td></tr>
  161. <tr>
  162. <!-- LEFT SIDE NAVIGATION -->
  163. <td valign="top" nowrap="true">
  164. #makeProject()
  165. </td>
  166. <td align="left" valign="top">
  167. #end
  168. #macro (footer)
  169. </td>
  170. </tr>
  171. <!-- FOOTER -->
  172. <tr><td colspan="2">
  173. <hr noshade="" size="1"/>
  174. </td></tr>
  175. <tr><td colspan="2">
  176. <div align="center"><font color="$bodylink" size="-1"><em>
  177. Copyright &#169; 2000-2002, Apache Software Foundation
  178. </em></font></div>
  179. </td></tr>
  180. </table>
  181. </body>
  182. </html>
  183. #end