PageRenderTime 46ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/docs/stylesheets/site.vsl

#
text | 317 lines | 267 code | 50 blank | 0 comment | 0 complexity | 26e9f4746462d6874cf1ea5ffd548663 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  1. ## Licensed to the Apache Software Foundation (ASF) under one
  2. ## or more contributor license agreements. See the NOTICE file
  3. ## distributed with this work for additional information
  4. ## regarding copyright ownership. The ASF licenses this file
  5. ## to you under the Apache License, Version 2.0 (the
  6. ## "License"); you may not use this file except in compliance
  7. ## with 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,
  12. ## software distributed under the License is distributed on an
  13. ## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. ## KIND, either express or implied. See the License for the
  15. ## specific language governing permissions and limitations
  16. ## under the License.
  17. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  18. <!--
  19. Licensed to the Apache Software Foundation (ASF) under one
  20. or more contributor license agreements. See the NOTICE file
  21. distributed with this work for additional information
  22. regarding copyright ownership. The ASF licenses this file
  23. to you under the Apache License, Version 2.0 (the
  24. "License"); you may not use this file except in compliance
  25. with 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,
  28. software distributed under the License is distributed on an
  29. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  30. KIND, either express or implied. See the License for the
  31. specific language governing permissions and limitations
  32. under the License.
  33. -->
  34. <!-- start the processing -->
  35. #document()
  36. <!-- end the processing -->
  37. ## This is where the macro's live
  38. #macro ( table $table)
  39. <table>
  40. #foreach ( $items in $table.getChildren() )
  41. #if ($items.getName().equals("tr"))
  42. #tr ($items)
  43. #end
  44. #end
  45. </table>
  46. #end
  47. #macro ( tr $tr)
  48. <tr>
  49. #foreach ( $items in $tr.getChildren() )
  50. #if ($items.getName().equals("td"))
  51. #td ($items)
  52. #elseif ($items.getName().equals("th"))
  53. #th ($items)
  54. #end
  55. #end
  56. </tr>
  57. #end
  58. #macro ( td $value)
  59. #if ($value.getAttributeValue("colspan"))
  60. #set ($colspan = $value.getAttributeValue("colspan"))
  61. #end
  62. #if ($value.getAttributeValue("rowspan"))
  63. #set ($rowspan = $value.getAttributeValue("rowspan"))
  64. #end
  65. <td colspan="$!colspan" rowspan="$!rowspan">
  66. #foreach ( $items in $value.getContent() )
  67. #if($items.name)
  68. #display($items)
  69. #else
  70. $items.value
  71. #end
  72. #end
  73. </td>
  74. #end
  75. #macro ( th $value)
  76. #if ($value.getAttributeValue("colspan"))
  77. #set ($colspan = $value.getAttributeValue("colspan"))
  78. #end
  79. #if ($value.getAttributeValue("rowspan"))
  80. #set ($rowspan = $value.getAttributeValue("rowspan"))
  81. #end
  82. <th colspan="$!colspan" rowspan="$!rowspan">
  83. #foreach ( $items in $value.getContent() )
  84. #if($items.name)
  85. #display($items)
  86. #else
  87. $items.value
  88. #end
  89. #end
  90. </th>
  91. #end
  92. #macro ( projectanchor $name $value )
  93. #if ($value.startsWith("http://"))
  94. <a href="$value">$name</a>
  95. #elseif ($value.startsWith("https://"))
  96. <a href="$value">$name</a>
  97. #else
  98. <a href="$relativePath$value">$name</a>
  99. #end
  100. #end
  101. #macro ( metaauthor $author $email )
  102. <meta name="author" value="$author">
  103. <meta name="email" value="$email">
  104. #end
  105. #macro ( image $value )
  106. #if ($value.getAttributeValue("width"))
  107. #set ($width=$value.getAttributeValue("width"))
  108. #end
  109. #if ($value.getAttributeValue("height"))
  110. #set ($height=$value.getAttributeValue("height"))
  111. #end
  112. #if ($value.getAttributeValue("align"))
  113. #set ($align=$value.getAttributeValue("align"))
  114. #end
  115. <img src="$relativePath$value.getAttributeValue("src")" width="$!width" height="$!height" align="$!align">
  116. #end
  117. #macro ( source $value)
  118. <div class="source">$escape.getText($value.getText())</pre></div>
  119. #end
  120. ## need these to catch special macros within lists
  121. #macro(list $node)
  122. <$node.getName()>
  123. #foreach ( $items in $node.getChildren() )
  124. #listitem($items)
  125. #end
  126. </$node.getName()>
  127. #end
  128. #macro (listitem $node)
  129. <$node.getName()>
  130. ## use getContent instead of getChildren
  131. ## to include both text and nodes
  132. #foreach ( $items in $node.getContent() )
  133. #if($items.name)
  134. #display($items)
  135. #else
  136. $items.value
  137. #end
  138. #end
  139. </$node.getName()>
  140. #end
  141. ## # displays a basic node, calling macros if appropriate
  142. #macro ( display $node )
  143. #if ($node.getName().equals("img"))
  144. #image ($node)
  145. #elseif ($node.getName().equals("source"))
  146. #source ($node)
  147. #elseif ($node.getName().equals("table"))
  148. #table ($node)
  149. #elseif ($node.getName().equals("ul"))
  150. #list ($node)
  151. #elseif ($node.getName().equals("ol"))
  152. #list ($node)
  153. #else
  154. $node
  155. #end
  156. #end
  157. #macro ( section $section)
  158. <a name="#anchorName($section)"></a>
  159. <h1>$section.getAttributeValue("name")</h1>
  160. <div class="subsection">
  161. #foreach ( $items in $section.getChildren() )
  162. #if ($items.getName().equals("subsection"))
  163. #subsection ($items)
  164. #else
  165. #display($items)
  166. #end
  167. #end
  168. </div>
  169. #end
  170. #macro ( subsection $subsection)
  171. <a name="#anchorName($subsection)"></a>
  172. <h2>$subsection.getAttributeValue("name")</h2>
  173. <div class="subsection">
  174. #foreach ( $items in $subsection.getChildren() )
  175. #display($items)
  176. #end
  177. </div>
  178. #end
  179. #macro ( anchorName $section)
  180. #if ($section.getAttributeValue("href"))
  181. $section.getAttributeValue("href")##
  182. #else
  183. $section.getAttributeValue("name")##
  184. #end
  185. #end
  186. #macro ( makeProject )
  187. <!-- ============================================================ -->
  188. #set ($menus = $project.getChild("body").getChildren("menu"))
  189. #foreach ( $menu in $menus )
  190. <div class="menusection">
  191. <span class="menuheader">$menu.getAttributeValue("name")</span>
  192. <ul>
  193. #foreach ( $item in $menu.getChildren() )
  194. #set ($name = $item.getAttributeValue("name"))
  195. <li>#projectanchor($name $item.getAttributeValue("href"))</li>
  196. #end
  197. </ul>
  198. </div>
  199. #end
  200. #end
  201. #macro (getProjectImage)
  202. <div id="logo1">
  203. <a href="http://hadoop.apache.org/hive/"><img src="${relativePath}/images/hive-logo.jpg" border="0"/></a>
  204. </div>
  205. #if ($project.getChild("logo"))
  206. <div id="logo2">
  207. #set ( $logoString = $project.getChild("logo").getAttributeValue("href") )
  208. #if ( $logoString.startsWith("/") )
  209. <a href="$project.getAttributeValue("href")"><img src="$relativePath$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  210. #else
  211. <a href="$project.getAttributeValue("href")"><img src="$relativePath/$logoString" alt="$project.getChild("logo").getText()" border="0"/></a>
  212. #end
  213. </div>
  214. #end
  215. #end
  216. #macro (printMeta $metaElement)
  217. <meta #set ($attribs = $metaElement.getAttributes())
  218. #foreach ($a in $attribs) $a.getName()="$a.getValue()" #end />
  219. #end
  220. #macro (document)
  221. <!-- ====================================================================== -->
  222. <!-- GENERATED FILE, DO NOT EDIT, EDIT THE XML FILE IN xdocs INSTEAD! -->
  223. <!-- Main Page Section -->
  224. <!-- ====================================================================== -->
  225. <html>
  226. <head>
  227. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
  228. #set ($authors = $root.getChild("properties").getChildren("author"))
  229. #foreach ( $au in $authors )
  230. #metaauthor ( $au.getText() $au.getAttributeValue("email") )
  231. #end
  232. #set ($metas = $root.getChildren("meta"))
  233. ## Parse meta directives such as
  234. ## <meta name="keyword" content="apache, velocity, java"/>
  235. #foreach ($meta in $metas) #printMeta($meta) #end
  236. ## Support for <base> tags.
  237. #if ($root.getChild("properties").getChild("base"))
  238. #set ($url = $root.getChild("properties").getChild("base").getAttributeValue("href"))
  239. <base href="$url"/>
  240. #end
  241. <title>$project.getChild("title").getText() - $root.getChild("properties").getChild("title").getText()</title>
  242. ## use a relative CSS for when the page is displayed locally (will overwrite
  243. ## previous CSS settings)
  244. <link rel="stylesheet" href="${relativePath}/site.css" type="text/css">
  245. </head>
  246. <body>
  247. ## use a table in order to force footer to end of page
  248. <div id="container">
  249. <div id="header">
  250. #getProjectImage()
  251. </div>
  252. <div id="menu">
  253. #makeProject()
  254. </div>
  255. <div id="body">
  256. #set ($allSections = $root.getChild("body").getChildren("section"))
  257. #foreach ( $section in $allSections )
  258. #section ($section)
  259. #end
  260. </div>
  261. <div id="footer">
  262. Copyright &#169; 1999-2007, <a href="http://www.apache.org/">The Apache Software Foundation</a>.
  263. </div>
  264. </div>
  265. </body>
  266. </html>
  267. #end