Updated documentation
[hibernate4-maven-plugin] / src / site / template.vm
1 <!DOCTYPE html>
2 <!-- Generated by Apache Maven Doxia Site Renderer#if( $doxiaSiteRendererVersion ) $doxiaSiteRendererVersion#end at $dateFormat.format( $currentDate ) -->
3 ## Datenstrukturen für die Navigation (Breadcrumbs und Menü) vorbereiten
4 #set ( $crumbs = $project.getClass().forName('java.util.LinkedList').newInstance() )
5 #set ( $parents = $project.getClass().forName('java.util.LinkedList').newInstance() )
6 #set ( $active = 'index.html' )
7 #set ( $skiplist = [ 'index.html' ] )
8 #macro ( searchBreadcrumbTrail $items )
9   #if ( $breadcrumbs )
10     ## Der zuerst gefundene Pfad gilt (denn dieser liegt im selbst erzeugten Menü)
11   #else
12     #foreach ( $item in $items )
13       #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
14       #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
15       #if ( $alignedFileName == $currentItemHref )
16         ## Sonderfall abfangen :/
17         #if ( $alignedFileName == 'index.html' )
18           #set ( $breadcrumbs = [] )
19           #set ( $path = [ 'index.html' ] )
20         #else
21           #set ( $breadcrumbs = $crumbs.clone() )
22           ## Den Titel der Seite korrigieren!
23           #set ( $title = "$project.name - $item.name" )
24           #set ( $shortTitle = $item.name )
25           ## Pfad für die Identifizierung sichtbarer Menüeinträge aufbauen
26           #set ( $path = [ 'index.html' ] )
27           #foreach ( $crumb in $crumbs )
28             #set ( $currentItemHref = $PathTool.calculateLink( $crumb.href, $relativePath ) )
29             #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
30             #set ( $sinkhole = $path.add( $currentItemHref ) )
31           #end
32           #set ( $sinkhole = $path.add( $alignedFileName ) )
33         #end
34       #else
35         #if ( !$item.items.empty )
36           #set ( $sinkhole = $crumbs.push( $item ) )
37           #searchBreadcrumbTrail ( $item.items )
38           #set ( $sinkhole = $crumbs.pop() )
39         #end
40       #end
41     #end
42   #end
43 #end
44 #macro ( buildSkiplist $item )
45   #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
46   #set ( $sinkhole = $skiplist.add( $currentItemHref.replaceAll( '\\', '/' ) ) )
47   #foreach ( $item in $item.items )
48     #buildSkiplist ( $item )
49   #end
50 #end
51 #macro ( findActive $item $skip)
52   #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
53   #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
54   #set ( $doskip = false )
55   #if ( $skip )
56     #foreach ( $toskip in $skiplist )
57       #if ( $currentItemHref == $toskip )
58         #set ( $doskip = true )
59       #end
60     #end
61   #end
62   #if ( !$doskip )
63     #if ( $alignedFileName == $currentItemHref )
64       #if ( $item.items.size() > 0 )
65         #set ( $active = $alignedFileName )
66       #else
67         #set ( $active = $parents.peek() )
68       #end
69     #end
70     #set ( $sinkhole = $parents.push( $currentItemHref ) )
71     #foreach ( $item in $item.items )
72       #findActive ( $item $skip )
73     #end
74     #set ( $sinkhole = $parents.pop() )
75   #end
76 #end
77 #foreach ( $menu in $decoration.body.menus )
78   ## Breadcrumb-Pfad suchen
79   #searchBreadcrumbTrail ( $menu.items )
80   ## Bestimmen, welche Pfade in dem selbst definierten Menü liegen
81   #set ( $sinkhole = $parents.push( 'index.html' ) )
82   #if ( !$menu.name )
83     #foreach ( $item in $menu.items )
84       #buildSkiplist( $item )
85     #end
86     ## Aktives (Unter-)Menü bestimmen (und dabei nichts überspringen)
87     #foreach ( $item in $menu.items )
88       #findActive( $item false)
89     #end
90   #else
91     ## Aktives (Unter-)Menü bestimmen (und dabei Einträge aus dem selbst
92     ## definierten Menü überspringen)
93     #foreach ( $item in $menu.items )
94       #findActive( $item true)
95     #end
96   #end
97   #set ( $sinkhole = $parents.pop() )
98   ## Sonderbehandlung der Einträge im selbst angelegten Menü
99   ## Das Menü wird daran erkannt, das der Name leer ist!
100 #end
101 <!-- Current: $alignedFileName -->
102 <!-- Active: $active -->
103 <!-- Path: $path -->
104 <!-- Skiplist: $skiplist -->
105 ##
106 #macro ( link $href $name $class )
107   #set ( $linkTitle = ' title="' + $name + '"' )
108   #if ( $href.toLowerCase().startsWith("http:/") || $href.toLowerCase().startsWith("https:/") ||
109     $href.toLowerCase().startsWith("ftp:/") || $href.toLowerCase().startsWith("mailto:") ||
110     $href.toLowerCase().startsWith("file:/") || ($href.toLowerCase().indexOf("://") != -1) )
111     #set ( $linkClass = ' class="external ' + $class + '"' )
112   #else
113     #set ( $linkClass = ' class="' + $class + '"' )
114   #end
115   <a href="$href"$linkClass$linkTitle>$name</a>
116 #end
117 ##
118 #macro ( menuItem $item $parent $skip)
119   #set ( $currentItemHref = $PathTool.calculateLink( $item.href, $relativePath ) )
120   #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
121   #set ( $doskip = false )
122   #if ( $skip )
123     #foreach ( $toskip in $skiplist )
124       #if ( $currentItemHref == $toskip )
125         #set ( $doskip = true )
126       #end
127     #end
128   #end
129 ##
130   #if ( !$doskip )
131     #set ( $onPath = false )
132     #set ( $parentActive = false )
133     #set ( $off = '' )
134     #set ( $sub = '' )
135     #set ( $cssClass = 's' )
136     #foreach ( $entry in $path )
137       #if ( $entry == $currentItemHref )
138         #set ( $onPath = true )
139         #set ( $cssClass = 's selected' )
140       #end
141       #if ( $entry == $parent && $parent == $active )
142         #set ( $parentActive = true )
143       #end
144     #end
145     #if ( $item.items.size() > 0 )
146       #set ( $sub = ' sub' )
147     #end
148     #if ( !$onPath && !$parentActive )
149       #set ( $off = ' off' )
150     #end
151     <li class="s$sub$off">
152       #if ( $alignedFileName == $currentItemHref )
153         <strong class="s">$item.name</strong>
154       #else
155         #link( $currentItemHref $item.name $cssClass )
156       #end
157       #if ( $item.items.size() > 0 && ( $currentItemHref == $active || $onPath ) )
158         #set ( $newparent = $currentItemHref )
159         <ul class="s#if ( $active == $currentItemHref ) active#end">
160           #foreach( $item in $item.items )
161             #menuItem( $item $newparent $skip )
162           #end
163         </ul>
164       #end
165     </li>
166   #end
167 #end
168 ##
169 #macro ( copyright )
170   #if ( $project )
171    #set ( $currentYear = ${currentDate.year} + 1900 )
172 ##
173     #if ( ${project.inceptionYear} && ( ${project.inceptionYear} != ${currentYear.toString()} ) )
174       ${project.inceptionYear}-${currentYear}
175     #else
176       ${currentYear}
177     #end
178   #end
179 #end
180 ##
181 <html>
182   <head>
183     <title>juplo - $title</title>
184     <meta http-equiv="Content-Type" content="text/html; charset=${outputEncoding}" />
185     <link rel="canonical" href="$project.url/$alignedFileName"/>
186     <meta name="viewport" content="width=device-width, initial-scale=1" />
187     <link rel="stylesheet" type="text/css" href="/css/base.css" />
188     <style type="text/css">
189       @import '/css/screen.css' screen;
190     </style>
191     <script src="/js/prettify.js"></script>
192     <!--[if lt IE 9]>
193       <script src="/js/html5shiv.js"></script>
194     <![endif]-->
195     <!--[if IE 8]>
196       <link rel="stylesheet" type="text/css" href="/css/ie8.css" />
197     <![endif]-->
198 #foreach( $author in $authors )
199     <meta name="author" content="$author" />
200 #end
201 #if ( $dateCreation )
202       <meta name="author" content="$author" />
203 #end
204     #if ( $decoration.body.head )
205       #foreach( $item in $decoration.body.head.getChildren() )
206         ## Workaround for DOXIA-150 due to a non-desired behaviour in p-u
207         ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toString()
208         ## @see org.codehaus.plexus.util.xml.Xpp3Dom#toUnescapedString()
209         #set ( $documentHeader = '<?xml version="1.0" encoding="UTF-8"?>' )
210         #if ( $item.name == "script" )
211           $StringUtils.replace( $item.toUnescapedString(), $documentHeader, "" )
212         #else
213           $StringUtils.replace( $item.toString(), $documentHeader, "" )
214         #end
215       #end
216     #end
217     $headContent
218   </head>
219   <body class="menu" onload="prettyPrint()">
220     <div id="page" class="cf">
221       <header id="header">
222         <h1 id="logo"><a href="/" title="Home" class="l">juplo</a></h1>
223         <span id="slogan"><strong>Java</strong> bits from nerds for nerds</span>
224         <hr class="h" />
225       </header>
226       <div id="breadcrumb">
227         <strong class="b title">You are here:</strong>
228         <ol class="b">
229           <li class="b"><a class="b" href="/">Home</a></li>
230           <li class="b"><a class="b" href="/projects.html">Projects</a></li>
231           #if ( $alignedFileName == 'index.html' )
232             <li class="b"><strong class="b">$project.name</strong></li>
233           #else
234             <li class="b"><a class="b" href="$relativePath/index.html">$project.name</a></li>
235             #foreach( $crumb in $breadcrumbs )
236               #set ( $currentItemHref = $PathTool.calculateLink( $crumb.href, $relativePath ) )
237               #set ( $currentItemHref = $currentItemHref.replaceAll( '\\', '/' ) )
238               <li class="b">#link( $currentItemHref $crumb.name 'b')</li>
239             #end
240             <li class="b"><strong class="b">$shortTitle</strong></li>
241           #end
242         </ol>
243         <a class="hide" href="#navigation">Jump to navigation</a>
244         <hr class="b" />
245       </div>
246       <main class="content cf">
247         <article id="content" class="main">
248           <header><h1>$shortTitle</h1></header>
249           $bodyContent
250         </article>
251         <div class="marginal">
252           <nav id="nav">
253             <hr class="n" />
254             <a id="navigation"></a>
255             <a class="hide" href="#top" title="Show Content">Jump back to the top of the page</a>
256             <h2 class="nav menu">Section-Menu</h2>
257             <ul id="menu">
258               <li class="m blog"><a href="/blog/" class="m">Blog</a></li>
259               <li class="m projects"><a href="/projects.html" class="m selected">Projects</a></li>
260               <li class="m about"><a href="/about.html" class="m">About</a></li>
261             </ul>
262             <h2 class="nav submenu">
263               <span class="s">Submenu for section</span>
264               <a class="s selected" href="/projects.html">Projects</a>
265             </h2>
266             <ul id="submenu" class="s">
267               ## Die vorhandenen Projekte sind hier hartkodiert!
268               #set ( $projects = {
269                   'Hibernate Maven Plugin' : '/hibernate-maven-plugin/'
270                   } )
271               #foreach( $entry in $projects.entrySet() )
272                 #if ( $project.name == $entry.key )
273                   <li class="s sub">
274                     #if ( $alignedFileName == 'index.html' )
275                       <strong class="s">$entry.key</strong>
276                     #else
277                       <a class="s selected" href="$relativePath/index.html">$entry.key</a>
278                     #end
279                     <ul class="s#if ( $active == 'index.html' ) active#end">
280                       ## Die Einträge aller Menüs werden als Einträge eines gemeinsamen
281                       ## Menüs angezeigt
282                       #foreach ( $menu in $decoration.body.menus )
283                         ## Einträge aus dem selbst definierten Menü in den
284                         ## automatisch erzeuten Menüs überspringen
285                         #if ( $menu.name )
286                           #foreach ( $item in $menu.items )
287                             #menuItem ( $item 'index.html' true )
288                           #end
289                         #else
290                           #foreach ( $item in $menu.items )
291                             #menuItem ( $item 'index.html' false )
292                           #end
293                         #end
294                       #end
295                     </ul>
296                   </li>
297                 #else
298                   <li class="s sub off"><a class="s" href="$entry.value">$entry.key</a></li>
299                 #end
300               #end
301             </ul>
302             <hr class="n" />
303           </nav>
304           <aside class="m">
305             <a href="http://maven.apache.org/" title="Built by Maven" class="poweredBy">
306               <img class="poweredBy" alt="Built by Maven" src="$relativePath/images/logos/maven-feather.png" />
307             </a>
308           </aside>
309         </div>
310       </main>
311       <footer id="footer">
312         <hr class="f" />
313         <ul id="footerlinks">
314           <li class="f" id="copyright">&#xa9; <strong>mo</strong> #copyright()</li>
315           <li class="f"><a class="f" href="/impressum.html">Impressum</a></li>
316           <li class="f about"><a class="f" href="/about.html">About</a></li>
317         </ul>
318       </footer>
319     </div>
320     #if( $decoration.googleAnalyticsAccountId && $decoration.googleAnalyticsAccountId != "" )
321     <script type="text/javascript"><!--//--><![CDATA[//><!--
322       var _gaq = _gaq || [];
323       _gaq.push(['_setAccount', '$decoration.googleAnalyticsAccountId']);
324       _gaq.push(['_trackPageview']);
325       (function() {
326         var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
327         ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
328         var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
329       })();
330     //--><!]]>
331     </script>
332     #end
333   </body>
334 </html>