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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #*
  2. * Copyright 2001-2005 The Apache Software Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. *
  16. *#
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  18. ## Content Stylesheet for Site
  19. ## Defined variables
  20. #set ($lightbg = "#ffffff")
  21. #set ($lightfg = "#ffffff")
  22. #set ($darkfg = "#000000")
  23. #set ($active = "#ffcc00")
  24. #set ($blue4 = "#B2C4E0")
  25. #set ($blue3 = "#294563")
  26. #set ($blue2 = "#4C6C8F")
  27. #set ($blue1 = "#CFDCED")
  28. #set ($sourceborder = "#023264")
  29. #set ($pound = "#" )
  30. ## start the processing
  31. #document()
  32. ## end the processing
  33. ## This is where the common page macro's live
  34. #macro ( isbn $isbn)
  35. <p><b>Available from:</b><br>
  36. <a href="http://www.amazon.com/exec/obidos/tg/detail/-/$!isbn/apachesoftwar-20/" target="_blank">Amazon.com</a>
  37. | <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>
  38. | <a href="http://www.booksense.com/product/info.jsp?affiliateId=Apache&amp;isbn=$!isbn" target="_blank">Book Sense</a>
  39. | <a href="http://www.powells.com/cgi-bin/biblio?isbn=$!isbn&amp;partner_id=29693" target="_blank">Powells.com</a>
  40. <br></p>
  41. #end
  42. #macro ( subsection $subsection)
  43. <h4 class="subsection">
  44. <a name="$escape.getText($subsection.getAttributeValue("name"))"></a>
  45. $subsection.getAttributeValue("name")
  46. </h4>
  47. #foreach ( $items in $subsection.getChildren() )
  48. #if ($items.getName().equals("img"))
  49. #image ($items)
  50. #elseif ($items.getName().equals("source"))
  51. #source ($items)
  52. #elseif ($items.getName().equals("table"))
  53. #table ($items)
  54. #elseif ($items.getName().equals("subsubsection"))
  55. #subsubsection ($items)
  56. #else
  57. $xmlout.outputString($items)
  58. #end
  59. #end
  60. #if ($subsection.getAttributeValue("isbn"))
  61. #set ($isbn = $subsection.getAttributeValue("isbn"))
  62. #isbn ($isbn)
  63. #end
  64. #end
  65. #macro ( subsubsection $subsubsection)
  66. <h5 class="subsection">
  67. <a name="$escape.getText($subsubsection.getAttributeValue("name"))"></a>
  68. *** $subsubsection.getAttributeValue("name") ***
  69. </h5>
  70. #foreach ( $items in $subsubsection.getChildren() )
  71. #if ($items.getName().equals("img"))
  72. #image ($items)
  73. #elseif ($items.getName().equals("source"))
  74. #source ($items)
  75. #elseif ($items.getName().equals("table"))
  76. #table ($items)
  77. #else
  78. $xmlout.outputString($items)
  79. #end
  80. #end
  81. #end
  82. #macro ( section $section)
  83. <h3 class="section">
  84. <a name="$escape.getText($section.getAttributeValue("name"))"></a>
  85. $section.getAttributeValue("name")
  86. </h3>
  87. #foreach ( $items in $section.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. #elseif ($items.getName().equals("subsection"))
  95. #subsection ($items)
  96. #else
  97. $xmlout.outputString($items)
  98. #end
  99. #end
  100. #end
  101. ## This is where the FAQ specific macro's live
  102. #macro (toc $section)
  103. <h4 class="toc">$section.getAttributeValue("title")</h4>
  104. <ul>
  105. #foreach ($faq in $section.getChildren("faq") )
  106. #subtoc ($faq)
  107. #end
  108. </ul>
  109. #end
  110. #macro (subtoc $faq)
  111. #set ($id = $faq.getAttributeValue("id"))
  112. <li><a href="$pound$id">
  113. $xmlout.outputString($faq.getChild("question"), true)
  114. </a></li>
  115. #end
  116. #macro (answers $section)
  117. #foreach ($faq in $section.getChildren("faq") )
  118. #faq ($faq)
  119. #end
  120. #end
  121. #macro (faq $faq)
  122. #set ($id = $faq.getAttributeValue("id"))
  123. <p class="faq">
  124. <a name="$id"></a>
  125. $xmlout.outputString($faq.getChild("question"), true)
  126. </p>
  127. #foreach ($item in $faq.getChild("answer").getChildren())
  128. #if ($item.getName().equals("img"))
  129. #image ($item)
  130. #elseif ($item.getName().equals("source"))
  131. #source ($item)
  132. #elseif ($item.getName().equals("table"))
  133. #table ($item)
  134. #else
  135. $xmlout.outputString($item)
  136. #end
  137. #end
  138. #end
  139. #macro (document)
  140. #header()
  141. <div class="main">
  142. <div class="content">
  143. <h1 class="title">$root.getChild("properties").getChild("title").getText()</h1>
  144. #set ($allSections = $root.getChild("body").getChildren("section"))
  145. #foreach ( $section in $allSections )
  146. #section ($section)
  147. #end
  148. #if ($root.getChildren("faqsection").size() > 0)
  149. #set ($allFaqSections = $root.getChildren("faqsection"))
  150. <h3 class="section">Questions</h3>
  151. #foreach ( $faqSection in $allFaqSections )
  152. #toc ($faqSection)
  153. #end
  154. <h3 class="section">Answers</h3>
  155. #foreach ( $faqSection in $allFaqSections )
  156. #answers ($faqSection)
  157. #end
  158. #end
  159. </div>
  160. </div>
  161. #footer()
  162. #end