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