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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. ## Content Stylesheet for Site
  20. ## Defined variables
  21. #set ($lightbg = "#ffffff")
  22. #set ($lightfg = "#ffffff")
  23. #set ($darkfg = "#000000")
  24. #set ($active = "#ffcc00")
  25. #set ($blue4 = "#B2C4E0")
  26. #set ($blue3 = "#294563")
  27. #set ($blue2 = "#4C6C8F")
  28. #set ($blue1 = "#CFDCED")
  29. #set ($sourceborder = "#023264")
  30. #set ($pound = "#" )
  31. ## start the processing
  32. #document()
  33. ## end the processing
  34. ## This is where the common page macro's live
  35. #macro ( isbn $isbn)
  36. <p><b>Available from:</b><br>
  37. <a href="http://www.amazon.com/exec/obidos/tg/detail/-/$!isbn/apachesoftwar-20/" target="_blank">Amazon.com</a>
  38. | <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>
  39. | <a href="http://www.booksense.com/product/info.jsp?affiliateId=Apache&amp;isbn=$!isbn" target="_blank">Book Sense</a>
  40. | <a href="http://www.powells.com/cgi-bin/biblio?isbn=$!isbn&amp;partner_id=29693" target="_blank">Powells.com</a>
  41. <br></p>
  42. #end
  43. #macro ( subsection $subsection)
  44. <h4 class="subsection">
  45. <a name="$escape.getText($subsection.getAttributeValue("name"))"></a>
  46. $subsection.getAttributeValue("name")
  47. </h4>
  48. #foreach ( $items in $subsection.getChildren() )
  49. #if ($items.getName().equals("img"))
  50. #image ($items)
  51. #elseif ($items.getName().equals("source"))
  52. #source ($items)
  53. #elseif ($items.getName().equals("table"))
  54. #table ($items)
  55. #elseif ($items.getName().equals("subsubsection"))
  56. #subsubsection ($items)
  57. #else
  58. $xmlout.outputString($items)
  59. #end
  60. #end
  61. #if ($subsection.getAttributeValue("isbn"))
  62. #set ($isbn = $subsection.getAttributeValue("isbn"))
  63. #isbn ($isbn)
  64. #end
  65. #end
  66. #macro ( subsubsection $subsubsection)
  67. <h5 class="subsection">
  68. <a name="$escape.getText($subsubsection.getAttributeValue("name"))"></a>
  69. *** $subsubsection.getAttributeValue("name") ***
  70. </h5>
  71. #foreach ( $items in $subsubsection.getChildren() )
  72. #if ($items.getName().equals("img"))
  73. #image ($items)
  74. #elseif ($items.getName().equals("source"))
  75. #source ($items)
  76. #elseif ($items.getName().equals("table"))
  77. #table ($items)
  78. #else
  79. $xmlout.outputString($items)
  80. #end
  81. #end
  82. #end
  83. #macro ( section $section)
  84. <h3 class="section">
  85. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  86. $section.getAttributeValue("name")
  87. </h3>
  88. #foreach ( $items in $section.getChildren() )
  89. #if ($items.getName().equals("img"))
  90. #image ($items)
  91. #elseif ($items.getName().equals("source"))
  92. #source ($items)
  93. #elseif ($items.getName().equals("table"))
  94. #table ($items)
  95. #elseif ($items.getName().equals("subsection"))
  96. #subsection ($items)
  97. #else
  98. $xmlout.outputString($items)
  99. #end
  100. #end
  101. #end
  102. ## This is where the FAQ specific macro's live
  103. #macro (toc $section)
  104. <h4 class="toc">$section.getAttributeValue("title")</h4>
  105. <ul>
  106. #foreach ($faq in $section.getChildren("faq") )
  107. #subtoc ($faq)
  108. #end
  109. </ul>
  110. #end
  111. #macro (subtoc $faq)
  112. #set ($id = $faq.getAttributeValue("id"))
  113. <li><a href="$pound$id">
  114. $xmlout.outputString($faq.getChild("question"), true)
  115. </a></li>
  116. #end
  117. #macro (answers $section)
  118. #foreach ($faq in $section.getChildren("faq") )
  119. #faq ($faq)
  120. #end
  121. #end
  122. #macro (faq $faq)
  123. #set ($id = $faq.getAttributeValue("id"))
  124. <p class="faq">
  125. <a name="$id"></a>
  126. $xmlout.outputString($faq.getChild("question"), true)
  127. </p>
  128. #foreach ($item in $faq.getChild("answer").getChildren())
  129. #if ($item.getName().equals("img"))
  130. #image ($item)
  131. #elseif ($item.getName().equals("source"))
  132. #source ($item)
  133. #elseif ($item.getName().equals("table"))
  134. #table ($item)
  135. #else
  136. $xmlout.outputString($item)
  137. #end
  138. #end
  139. #end
  140. #macro (document)
  141. #header()
  142. <div class="main">
  143. <div class="content">
  144. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  145. #set ($allSections = $root.getChild("body").getChildren("section"))
  146. #foreach ( $section in $allSections )
  147. #section ($section)
  148. #end
  149. #if ($root.getChildren("faqsection").size() > 0)
  150. #set ($allFaqSections = $root.getChildren("faqsection"))
  151. <h3 class="section">Questions</h3>
  152. #foreach ( $faqSection in $allFaqSections )
  153. #toc ($faqSection)
  154. #end
  155. <h3 class="section">Answers</h3>
  156. #foreach ( $faqSection in $allFaqSections )
  157. #answers ($faqSection)
  158. #end
  159. #end
  160. </div>
  161. </div>
  162. #footer()
  163. #end