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.

site.vsl 9.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  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. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  19. <!--
  20. Licensed to the Apache Software Foundation (ASF) under one or more
  21. contributor license agreements. See the NOTICE file distributed with
  22. this work for additional information regarding copyright ownership.
  23. The ASF licenses this file to You under the Apache License, Version 2.0
  24. (the "License"); you may not use this file except in compliance with
  25. the License. You may obtain a copy of the License at
  26. http://www.apache.org/licenses/LICENSE-2.0
  27. Unless required by applicable law or agreed to in writing, software
  28. distributed under the License is distributed on an "AS IS" BASIS,
  29. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  30. See the License for the specific language governing permissions and
  31. limitations under the License.
  32. -->
  33. ## Content Stylesheet for Site
  34. ## Defined variables
  35. #set ($lightbg = "#ffffff")
  36. #set ($lightfg = "#ffffff")
  37. #set ($darkfg = "#000000")
  38. #set ($active = "#ffcc00")
  39. #set ($blue4 = "#B2C4E0")
  40. #set ($blue3 = "#294563")
  41. #set ($blue2 = "#4C6C8F")
  42. #set ($blue1 = "#CFDCED")
  43. #set ($sourceborder = "#023264")
  44. #set ($pound = "#" )
  45. #set ($ssi = "include virtual=")
  46. #set ($adsurl = "/ads/buttonbar.html")
  47. ## start the processing
  48. #document()
  49. ## end the processing
  50. ## This is where the common page macro's live
  51. #macro ( isbn $isbn)
  52. <p><b>Available from:</b><br>
  53. <a href="http://www.amazon.com/exec/obidos/tg/detail/-/$!isbn/apachesoftwar-20/" target="_blank">Amazon.com</a>
  54. | <a href="http://service.bfast.com/bfast/click?bfmid=2181&amp;bfmtype=book&amp;sourceid=41462544&amp;bfpid=$!isbn" target="_blank">Barnes &amp; Noble</a>
  55. | <a href="http://www.booksense.com/product/info.jsp?affiliateId=Apache&amp;isbn=$!isbn" target="_blank">Book Sense</a>
  56. | <a href="http://www.powells.com/cgi-bin/biblio?isbn=$!isbn&amp;partner_id=29693" target="_blank">Powells.com</a>
  57. <br></p>
  58. #end
  59. #macro ( subsection $subsection)
  60. <h4 class="subsection">
  61. <a name="$escape.getText($subsection.getAttributeValue("name"))"></a>
  62. $subsection.getAttributeValue("name")
  63. </h4>
  64. #foreach ( $items in $subsection.getChildren() )
  65. #if ($items.getName().equals("img"))
  66. #image ($items)
  67. #elseif ($items.getName().equals("source"))
  68. #source ($items)
  69. #elseif ($items.getName().equals("table"))
  70. #table ($items)
  71. #elseif ($items.getName().equals("subsubsection"))
  72. #subsubsection ($items)
  73. #else
  74. $xmlout.outputString($items)
  75. #end
  76. #end
  77. #if ($subsection.getAttributeValue("isbn"))
  78. #set ($isbn = $subsection.getAttributeValue("isbn"))
  79. #isbn ($isbn)
  80. #end
  81. #end
  82. #macro ( subsubsection $subsubsection)
  83. <h5 class="subsection">
  84. <a name="$escape.getText($subsubsection.getAttributeValue("name"))"></a>
  85. *** $subsubsection.getAttributeValue("name") ***
  86. </h5>
  87. #foreach ( $items in $subsubsection.getChildren() )
  88. #if ($items.getName().equals("img"))
  89. #image ($items)
  90. #elseif ($items.getName().equals("source"))
  91. #source ($items)
  92. #elseif ($items.getName().equals("table"))
  93. #table ($items)
  94. #else
  95. $xmlout.outputString($items)
  96. #end
  97. #end
  98. #end
  99. #macro ( teamcity $teamcity)
  100. <table class="ContinuousBuild">
  101. <tr>
  102. <th>Title</th>
  103. <th>Description</th>
  104. <th>Build command</th>
  105. <th>When</th>
  106. <th>last build</th>
  107. <th>last success</th>
  108. </tr>
  109. #set ($viewLink = $teamcity.getAttributeValue("viewlog") )
  110. #foreach ($project in $teamcity.getChildren() )
  111. <tr><td colspan="6" class="title"><b>$project.getAttributeValue("name")</b></td></tr>
  112. #foreach ($configuration in $project.getChildren() )
  113. #configuration ($configuration $viewLink)
  114. #end
  115. #end
  116. </table>
  117. #end
  118. #macro ( configuration $conf $viewLink)
  119. #set ($id = $conf.getAttributeValue("id") )
  120. <tr>
  121. <td class="title">$conf.getAttributeValue("title")</td>
  122. <td class="description">$conf.getChild("description").getContent()</td>
  123. <td class="command">$conf.getAttributeValue("command")</td>
  124. #if ($conf.getChild("when"))
  125. <td class="when">$conf.getChild("when").getContent()</td>
  126. #else
  127. <td class="when">continuously</td>
  128. #end
  129. <td class="link"><a href="$viewLink?&buildTypeId=$id&buildId=lastFinished">last build</a></td>
  130. <td class="link"><a href="$viewLink?&buildTypeId=$id&buildId=lastSuccessful">last success</a></td>
  131. </tr>
  132. #end
  133. ## The hudson macro is based on the teamcity macro, but slightly different.
  134. ## Mainly in the need of another nested element (job instead of configuration).
  135. ## Maybe refactoring would ease that code ...
  136. #macro ( hudson $hudson)
  137. <table class="ContinuousBuild">
  138. <tr>
  139. <th>Title</th>
  140. <th>Description</th>
  141. <th>Build command</th>
  142. <th>When</th>
  143. <th>last build</th>
  144. <th>last success</th>
  145. </tr>
  146. #set ($base = $hudson.getAttributeValue("base") )
  147. #foreach ($project in $hudson.getChildren() )
  148. <tr><td colspan="6" class="title"><b>$project.getAttributeValue("name")</b></td></tr>
  149. #foreach ($job in $project.getChildren() )
  150. #job ($job $base)
  151. #end
  152. #end
  153. </table>
  154. #end
  155. ## The hudson::job macro is based on the teamcity::configuration macro, but slightly different.
  156. ## Mainly the links to the build results are different.
  157. #macro ( job $job $base)
  158. #set ($jobId = $job.getAttributeValue("id") )
  159. <tr>
  160. <td class="title">$job.getAttributeValue("title")</td>
  161. <td class="description">$job.getChild("description").getContent()</td>
  162. <td class="command">$job.getAttributeValue("command")</td>
  163. #if ($job.getChild("when"))
  164. <td class="when">$job.getChild("when").getContent()</td>
  165. #else
  166. <td class="when">continuously</td>
  167. #end
  168. <td class="link"><a href="$base/$jobId/lastBuild/">last build</a></td>
  169. <td class="link"><a href="$base/$jobId/lastSuccessfulBuild/">last success</a></td>
  170. </tr>
  171. #end
  172. #macro ( section $section)
  173. <h3 class="section">
  174. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  175. $section.getAttributeValue("name")
  176. </h3>
  177. #foreach ( $items in $section.getChildren() )
  178. #if ($items.getName().equals("img"))
  179. #image ($items)
  180. #elseif ($items.getName().equals("source"))
  181. #source ($items)
  182. #elseif ($items.getName().equals("table"))
  183. #table ($items)
  184. #elseif ($items.getName().equals("subsection"))
  185. #subsection ($items)
  186. #elseif ($items.getName().equals("teamcity"))
  187. #teamcity ($items)
  188. #elseif ($items.getName().equals("hudson"))
  189. #hudson ($items)
  190. #else
  191. $xmlout.outputString($items)
  192. #end
  193. #end
  194. #end
  195. ## This is where the FAQ specific macro's live
  196. #macro (toc $section)
  197. <h4 class="toc">$section.getAttributeValue("title")</h4>
  198. <ul>
  199. #foreach ($faq in $section.getChildren("faq") )
  200. #subtoc ($faq)
  201. #end
  202. </ul>
  203. #end
  204. #macro (subtoc $faq)
  205. #set ($id = $faq.getAttributeValue("id"))
  206. <li><a href="$pound$id">
  207. $xmlout.outputString($faq.getChild("question"), true)
  208. </a></li>
  209. #end
  210. #macro (answers $section)
  211. #foreach ($faq in $section.getChildren("faq") )
  212. #faq ($faq)
  213. #end
  214. #end
  215. #macro (faq $faq)
  216. #set ($id = $faq.getAttributeValue("id"))
  217. <p class="faq">
  218. <a name="$id"></a>
  219. $xmlout.outputString($faq.getChild("question"), true)
  220. </p>
  221. #foreach ($item in $faq.getChild("answer").getChildren())
  222. #if ($item.getName().equals("img"))
  223. #image ($item)
  224. #elseif ($item.getName().equals("source"))
  225. #source ($item)
  226. #elseif ($item.getName().equals("table"))
  227. #table ($item)
  228. #else
  229. $xmlout.outputString($item)
  230. #end
  231. #end
  232. #end
  233. #macro (document)
  234. #header()
  235. <div class="main">
  236. <div class="content">
  237. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  238. #set ($allSections = $root.getChild("body").getChildren("section"))
  239. #foreach ( $section in $allSections )
  240. #section ($section)
  241. #end
  242. #if ($root.getChildren("faqsection").size() > 0)
  243. #set ($allFaqSections = $root.getChildren("faqsection"))
  244. <h3 class="section">Questions</h3>
  245. #foreach ( $faqSection in $allFaqSections )
  246. #toc ($faqSection)
  247. #end
  248. <h3 class="section">Answers</h3>
  249. #foreach ( $faqSection in $allFaqSections )
  250. #answers ($faqSection)
  251. #end
  252. #end
  253. </div>
  254. </div>
  255. #footer()
  256. #end