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.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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. #else
  62. <a href="$relativePath$value">$name</a>
  63. #end
  64. #end
  65. #macro ( metaauthor $author $email )
  66. <meta name="author" value="$author">
  67. <meta name="email" value="$email">
  68. #end
  69. #macro ( image $value )
  70. #if ($value.getAttributeValue("width"))
  71. #set ($width=$value.getAttributeValue("width"))
  72. #end
  73. #if ($value.getAttributeValue("height"))
  74. #set ($height=$value.getAttributeValue("height"))
  75. #end
  76. #if ($value.getAttributeValue("align"))
  77. #set ($align=$value.getAttributeValue("align"))
  78. #end
  79. <img src="$relativePath$value.getAttributeValue("src")"
  80. width="$!width" height="$!height" align="$!align">
  81. #end
  82. #macro ( source $value)
  83. <div align="left">
  84. <table cellspacing="4" cellpadding="0" border="0">
  85. <tr>
  86. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  87. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  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. </tr>
  90. <tr>
  91. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  92. <td bgcolor="#ffffff"><pre>$escape.getText($value.getText())</pre></td>
  93. <td bgcolor="#023264" width="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  94. </tr>
  95. <tr>
  96. <td bgcolor="#023264" width="1" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  97. <td bgcolor="#023264" height="1"><img src="/images/void.gif" width="1" height="1" vspace="0" hspace="0" border="0"/></td>
  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. </tr>
  100. </table>
  101. </div>
  102. #end
  103. #macro ( makeProject )
  104. #set ($menus = $project.getChild("body").getChildren("menu"))
  105. #foreach ( $menu in $menus )
  106. <p><strong>$menu.getAttributeValue("name")</strong></p>
  107. <ul>
  108. #foreach ( $item in $menu.getChildren() )
  109. #set ($name = $item.getAttributeValue("name"))
  110. <li>#projectanchor($name $item.getAttributeValue("href"))</li>
  111. #end
  112. </ul>
  113. #end
  114. #end
  115. #macro (getProjectImage)
  116. <td colspan="2">
  117. #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
  118. #if ( $logoString.startsWith("/") )
  119. <a href="$project.getAttributeValue("href")"><img src="$relativePath$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  120. #else
  121. <a href="$project.getAttributeValue("href")"><img src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  122. #end
  123. </td>
  124. #end
  125. #macro (header)
  126. <html>
  127. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  128. <head>
  129. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  130. #set ($authors = $root.getChild("properties").getChildren("author"))
  131. #foreach ( $au in $authors )
  132. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  133. #end
  134. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  135. </head>
  136. <body bgcolor="$bodybg" text="$bodyfg" link="$bodylink">
  137. <table border="0" width="100%" cellspacing="0">
  138. <!-- TOP IMAGE -->
  139. <tr>
  140. #getProjectImage()
  141. </tr>
  142. </table>
  143. <table border="0" width="100%" cellspacing="4">
  144. <tr><td colspan="2">
  145. <hr noshade="" size="1"/>
  146. </td></tr>
  147. <tr>
  148. <!-- LEFT SIDE NAVIGATION -->
  149. <td valign="top" nowrap="true">
  150. #makeProject()
  151. </td>
  152. <td align="left" valign="top">
  153. #end
  154. #macro (footer)
  155. </td>
  156. </tr>
  157. <!-- FOOTER -->
  158. <tr><td colspan="2">
  159. <hr noshade="" size="1"/>
  160. </td></tr>
  161. <tr><td colspan="2">
  162. <div align="center"><font color="$bodylink" size="-1"><em>
  163. Copyright &#169; 2000-2002, Apache Software Foundation
  164. </em></font></div>
  165. </td></tr>
  166. </table>
  167. </body>
  168. </html>
  169. #end