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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  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. ## start the processing
  46. #document()
  47. ## end the processing
  48. ## This is where the common page macro's live
  49. #macro ( isbn $isbn)
  50. <p><b>Available from:</b><br>
  51. <a href="http://www.amazon.com/exec/obidos/tg/detail/-/$!isbn/apachesoftwar-20/" target="_blank">Amazon.com</a>
  52. | <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>
  53. | <a href="http://www.booksense.com/product/info.jsp?affiliateId=Apache&amp;isbn=$!isbn" target="_blank">Book Sense</a>
  54. | <a href="http://www.powells.com/cgi-bin/biblio?isbn=$!isbn&amp;partner_id=29693" target="_blank">Powells.com</a>
  55. <br></p>
  56. #end
  57. #macro ( subsection $subsection)
  58. <h4 class="subsection">
  59. <a name="$escape.getText($subsection.getAttributeValue("name"))"></a>
  60. $subsection.getAttributeValue("name")
  61. </h4>
  62. #foreach ( $items in $subsection.getChildren() )
  63. #if ($items.getName().equals("img"))
  64. #image ($items)
  65. #elseif ($items.getName().equals("source"))
  66. #source ($items)
  67. #elseif ($items.getName().equals("table"))
  68. #table ($items)
  69. #elseif ($items.getName().equals("subsubsection"))
  70. #subsubsection ($items)
  71. #else
  72. $xmlout.outputString($items)
  73. #end
  74. #end
  75. #if ($subsection.getAttributeValue("isbn"))
  76. #set ($isbn = $subsection.getAttributeValue("isbn"))
  77. #isbn ($isbn)
  78. #end
  79. #end
  80. #macro ( subsubsection $subsubsection)
  81. <h5 class="subsection">
  82. <a name="$escape.getText($subsubsection.getAttributeValue("name"))"></a>
  83. *** $subsubsection.getAttributeValue("name") ***
  84. </h5>
  85. #foreach ( $items in $subsubsection.getChildren() )
  86. #if ($items.getName().equals("img"))
  87. #image ($items)
  88. #elseif ($items.getName().equals("source"))
  89. #source ($items)
  90. #elseif ($items.getName().equals("table"))
  91. #table ($items)
  92. #else
  93. $xmlout.outputString($items)
  94. #end
  95. #end
  96. #end
  97. #macro ( teamcity $teamcity)
  98. <table class="ContinuousBuild">
  99. <tr>
  100. <th>Title</th>
  101. <th>Description</th>
  102. <th>Build command</th>
  103. <th>When</th>
  104. <th>last build</th>
  105. <th>last success</th>
  106. </tr>
  107. #set ($viewLink = $teamcity.getAttributeValue("viewlog") )
  108. #foreach ($project in $teamcity.getChildren() )
  109. <tr><td colspan="6" class="title"><b>$project.getAttributeValue("name")</b></td></tr>
  110. #foreach ($configuration in $project.getChildren() )
  111. #configuration ($configuration $viewLink)
  112. #end
  113. #end
  114. </table>
  115. #end
  116. #macro ( configuration $conf $viewLink)
  117. #set ($id = $conf.getAttributeValue("id") )
  118. <tr>
  119. <td class="title">$conf.getAttributeValue("title")</td>
  120. <td class="description">$conf.getChild("description").getContent()</td>
  121. <td class="command">$conf.getAttributeValue("command")</td>
  122. #if ($conf.getChild("when"))
  123. <td class="when">$conf.getChild("when").getContent()</td>
  124. #else
  125. <td class="when">continuously</td>
  126. #end
  127. <td class="link"><a href="$viewLink?&buildTypeId=$id&buildId=lastFinished">last build</a></td>
  128. <td class="link"><a href="$viewLink?&buildTypeId=$id&buildId=lastSuccessful">last success</a></td>
  129. </tr>
  130. #end
  131. ## The hudson macro is based on the teamcity macro, but slightly different.
  132. ## Mainly in the need of another nested element (job instead of configuration).
  133. ## Maybe refactoring would ease that code ...
  134. #macro ( hudson $hudson)
  135. <table class="ContinuousBuild">
  136. <tr>
  137. <th>Title</th>
  138. <th>Description</th>
  139. <th>Build command</th>
  140. <th>When</th>
  141. <th>last build</th>
  142. <th>last success</th>
  143. </tr>
  144. #set ($base = $hudson.getAttributeValue("base") )
  145. #foreach ($project in $hudson.getChildren() )
  146. <tr><td colspan="6" class="title"><b>$project.getAttributeValue("name")</b></td></tr>
  147. #foreach ($job in $project.getChildren() )
  148. #job ($job $base)
  149. #end
  150. #end
  151. </table>
  152. #end
  153. ## The hudson::job macro is based on the teamcity::configuration macro, but slightly different.
  154. ## Mainly the links to the build results are different.
  155. #macro ( job $job $base)
  156. #set ($jobId = $job.getAttributeValue("id") )
  157. <tr>
  158. <td class="title">$job.getAttributeValue("title")</td>
  159. <td class="description">$job.getChild("description").getContent()</td>
  160. <td class="command">$job.getAttributeValue("command")</td>
  161. #if ($job.getChild("when"))
  162. <td class="when">$job.getChild("when").getContent()</td>
  163. #else
  164. <td class="when">continuously</td>
  165. #end
  166. <td class="link"><a href="$base/$jobId/lastBuild/">last build</a></td>
  167. <td class="link"><a href="$base/$jobId/lastSuccessfulBuild/">last success</a></td>
  168. </tr>
  169. #end
  170. #macro ( section $section)
  171. <h3 class="section">
  172. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  173. $section.getAttributeValue("name")
  174. </h3>
  175. #foreach ( $items in $section.getChildren() )
  176. #if ($items.getName().equals("img"))
  177. #image ($items)
  178. #elseif ($items.getName().equals("source"))
  179. #source ($items)
  180. #elseif ($items.getName().equals("table"))
  181. #table ($items)
  182. #elseif ($items.getName().equals("subsection"))
  183. #subsection ($items)
  184. #elseif ($items.getName().equals("teamcity"))
  185. #teamcity ($items)
  186. #elseif ($items.getName().equals("hudson"))
  187. #hudson ($items)
  188. #else
  189. $xmlout.outputString($items)
  190. #end
  191. #end
  192. #end
  193. ## This is where the FAQ specific macro's live
  194. #macro (toc $section)
  195. <h4 class="toc">$section.getAttributeValue("title")</h4>
  196. <ul>
  197. #foreach ($faq in $section.getChildren("faq") )
  198. #subtoc ($faq)
  199. #end
  200. </ul>
  201. #end
  202. #macro (subtoc $faq)
  203. #set ($id = $faq.getAttributeValue("id"))
  204. <li><a href="$pound$id">
  205. $xmlout.outputString($faq.getChild("question"), true)
  206. </a></li>
  207. #end
  208. #macro (answers $section)
  209. #foreach ($faq in $section.getChildren("faq") )
  210. #faq ($faq)
  211. #end
  212. #end
  213. #macro (faq $faq)
  214. #set ($id = $faq.getAttributeValue("id"))
  215. <p class="faq">
  216. <a name="$id"></a>
  217. $xmlout.outputString($faq.getChild("question"), true)
  218. </p>
  219. #foreach ($item in $faq.getChild("answer").getChildren())
  220. #if ($item.getName().equals("img"))
  221. #image ($item)
  222. #elseif ($item.getName().equals("source"))
  223. #source ($item)
  224. #elseif ($item.getName().equals("table"))
  225. #table ($item)
  226. #else
  227. $xmlout.outputString($item)
  228. #end
  229. #end
  230. #end
  231. #macro (document)
  232. #header()
  233. <div class="main">
  234. <div class="content">
  235. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  236. #set ($allSections = $root.getChild("body").getChildren("section"))
  237. #foreach ( $section in $allSections )
  238. #section ($section)
  239. #end
  240. #if ($root.getChildren("faqsection").size() > 0)
  241. #set ($allFaqSections = $root.getChildren("faqsection"))
  242. <h3 class="section">Questions</h3>
  243. #foreach ( $faqSection in $allFaqSections )
  244. #toc ($faqSection)
  245. #end
  246. <h3 class="section">Answers</h3>
  247. #foreach ( $faqSection in $allFaqSections )
  248. #answers ($faqSection)
  249. #end
  250. #end
  251. </div>
  252. </div>
  253. #footer()
  254. #end