maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r914179 [22/34] - in /websites/production/maven-doxia/content/doxia-sitetools-archives/doxia-sitetools-LATEST: ./ apidocs/ apidocs/org/apache/maven/doxia/docrenderer/ apidocs/org/apache/maven/doxia/docrenderer/class-use/ apidocs/org/apache/...
Date Fri, 27 Jun 2014 21:41:42 GMT
Modified: websites/production/maven-doxia/content/doxia-sitetools-archives/doxia-sitetools-LATEST/doxia-site-renderer/xref/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.html
==============================================================================
--- websites/production/maven-doxia/content/doxia-sitetools-archives/doxia-sitetools-LATEST/doxia-site-renderer/xref/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.html (original)
+++ websites/production/maven-doxia/content/doxia-sitetools-archives/doxia-sitetools-LATEST/doxia-site-renderer/xref/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.html Fri Jun 27 21:41:29 2014
@@ -95,7 +95,7 @@
 <a class="jxr_linenumber" name="L87" href="#L87">87</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="L88" href="#L88">88</a>  <em class="jxr_javadoccomment"> * @author &lt;a href="<a href="mailto:evenisse@codehaus.org" target="alexandria_uri">mailto:evenisse@codehaus.org</a>"&gt;Emmanuel Venisse&lt;/a&gt;</em>
 <a class="jxr_linenumber" name="L89" href="#L89">89</a>  <em class="jxr_javadoccomment"> * @author &lt;a href="<a href="mailto:vincent.siveton@gmail.com" target="alexandria_uri">mailto:vincent.siveton@gmail.com</a>"&gt;Vincent Siveton&lt;/a&gt;</em>
-<a class="jxr_linenumber" name="L90" href="#L90">90</a>  <em class="jxr_javadoccomment"> * @version $Id: DefaultSiteRenderer.java 1556042 2014-01-06 21:36:13Z hboutemy $</em>
+<a class="jxr_linenumber" name="L90" href="#L90">90</a>  <em class="jxr_javadoccomment"> * @version $Id: DefaultSiteRenderer.java 1589008 2014-04-21 23:53:37Z hboutemy $</em>
 <a class="jxr_linenumber" name="L91" href="#L91">91</a>  <em class="jxr_javadoccomment"> * @since 1.0</em>
 <a class="jxr_linenumber" name="L92" href="#L92">92</a>  <em class="jxr_javadoccomment"> */</em>
 <a class="jxr_linenumber" name="L93" href="#L93">93</a>  @Component( role = Renderer.<strong class="jxr_keyword">class</strong> )
@@ -202,14 +202,14 @@
 <a class="jxr_linenumber" name="L194" href="#L194">194</a>         {
 <a class="jxr_linenumber" name="L195" href="#L195">195</a>             List&lt;String&gt; allFiles = FileUtils.getFileNames( moduleBasedir, <span class="jxr_string">"**/*.*"</span>, excludes, false );
 <a class="jxr_linenumber" name="L196" href="#L196">196</a> 
-<a class="jxr_linenumber" name="L197" href="#L197">197</a>             String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH );
+<a class="jxr_linenumber" name="L197" href="#L197">197</a>             String fullExtension = <span class="jxr_string">"."</span> + module.getExtension();
 <a class="jxr_linenumber" name="L198" href="#L198">198</a>             List&lt;String&gt; docs = <strong class="jxr_keyword">new</strong> LinkedList&lt;String&gt;( allFiles );
 <a class="jxr_linenumber" name="L199" href="#L199">199</a>             <em class="jxr_comment">// Take care of extension case</em>
 <a class="jxr_linenumber" name="L200" href="#L200">200</a>             <strong class="jxr_keyword">for</strong> ( Iterator&lt;String&gt; it = docs.iterator(); it.hasNext(); )
 <a class="jxr_linenumber" name="L201" href="#L201">201</a>             {
-<a class="jxr_linenumber" name="L202" href="#L202">202</a>                 String name = it.next().trim();
+<a class="jxr_linenumber" name="L202" href="#L202">202</a>                 String name = it.next();
 <a class="jxr_linenumber" name="L203" href="#L203">203</a> 
-<a class="jxr_linenumber" name="L204" href="#L204">204</a>                 <strong class="jxr_keyword">if</strong> ( !name.toLowerCase( Locale.ENGLISH ).endsWith( <span class="jxr_string">"."</span> + lowerCaseExtension ) )
+<a class="jxr_linenumber" name="L204" href="#L204">204</a>                 <strong class="jxr_keyword">if</strong> ( !endsWithIgnoreCase( name, fullExtension ) )
 <a class="jxr_linenumber" name="L205" href="#L205">205</a>                 {
 <a class="jxr_linenumber" name="L206" href="#L206">206</a>                     it.remove();
 <a class="jxr_linenumber" name="L207" href="#L207">207</a>                 }
@@ -217,719 +217,728 @@
 <a class="jxr_linenumber" name="L209" href="#L209">209</a> 
 <a class="jxr_linenumber" name="L210" href="#L210">210</a>             List&lt;String&gt; velocityFiles = <strong class="jxr_keyword">new</strong> LinkedList&lt;String&gt;( allFiles );
 <a class="jxr_linenumber" name="L211" href="#L211">211</a>             <em class="jxr_comment">// *.xml.vm</em>
-<a class="jxr_linenumber" name="L212" href="#L212">212</a>             <strong class="jxr_keyword">for</strong> ( Iterator&lt;String&gt; it = velocityFiles.iterator(); it.hasNext(); )
-<a class="jxr_linenumber" name="L213" href="#L213">213</a>             {
-<a class="jxr_linenumber" name="L214" href="#L214">214</a>                 String name = it.next().trim();
-<a class="jxr_linenumber" name="L215" href="#L215">215</a> 
-<a class="jxr_linenumber" name="L216" href="#L216">216</a>                 <strong class="jxr_keyword">if</strong> ( !name.toLowerCase( Locale.ENGLISH ).endsWith( lowerCaseExtension + <span class="jxr_string">".vm"</span> ) )
-<a class="jxr_linenumber" name="L217" href="#L217">217</a>                 {
-<a class="jxr_linenumber" name="L218" href="#L218">218</a>                     it.remove();
-<a class="jxr_linenumber" name="L219" href="#L219">219</a>                 }
-<a class="jxr_linenumber" name="L220" href="#L220">220</a>             }
-<a class="jxr_linenumber" name="L221" href="#L221">221</a>             docs.addAll( velocityFiles );
-<a class="jxr_linenumber" name="L222" href="#L222">222</a> 
-<a class="jxr_linenumber" name="L223" href="#L223">223</a>             <strong class="jxr_keyword">for</strong> ( String doc : docs )
-<a class="jxr_linenumber" name="L224" href="#L224">224</a>             {
-<a class="jxr_linenumber" name="L225" href="#L225">225</a>                 String docc = doc.trim();
-<a class="jxr_linenumber" name="L226" href="#L226">226</a> 
-<a class="jxr_linenumber" name="L227" href="#L227">227</a>                 <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> context =
-<a class="jxr_linenumber" name="L228" href="#L228">228</a>                         <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a>( moduleBasedir, docc, module.getParserId(), module.getExtension() );
-<a class="jxr_linenumber" name="L229" href="#L229">229</a> 
-<a class="jxr_linenumber" name="L230" href="#L230">230</a>                 <em class="jxr_comment">// TODO: DOXIA-111: we need a general filter here that knows how to alter the context</em>
-<a class="jxr_linenumber" name="L231" href="#L231">231</a>                 <strong class="jxr_keyword">if</strong> ( docc.toLowerCase( Locale.ENGLISH ).endsWith( <span class="jxr_string">".vm"</span> ) )
-<a class="jxr_linenumber" name="L232" href="#L232">232</a>                 {
-<a class="jxr_linenumber" name="L233" href="#L233">233</a>                     context.setAttribute( <span class="jxr_string">"velocity"</span>, <span class="jxr_string">"true"</span> );
-<a class="jxr_linenumber" name="L234" href="#L234">234</a>                 }
-<a class="jxr_linenumber" name="L235" href="#L235">235</a> 
-<a class="jxr_linenumber" name="L236" href="#L236">236</a>                 String key = context.getOutputName();
-<a class="jxr_linenumber" name="L237" href="#L237">237</a>                 key = StringUtils.replace( key, <span class="jxr_string">"&#92;&#92;"</span>, <span class="jxr_string">"/"</span> );
-<a class="jxr_linenumber" name="L238" href="#L238">238</a> 
-<a class="jxr_linenumber" name="L239" href="#L239">239</a>                 <strong class="jxr_keyword">if</strong> ( files.containsKey( key ) )
-<a class="jxr_linenumber" name="L240" href="#L240">240</a>                 {
-<a class="jxr_linenumber" name="L241" href="#L241">241</a>                     <a href="../../../../../org/apache/maven/doxia/siterenderer/DocumentRenderer.html">DocumentRenderer</a> renderer = files.get( key );
-<a class="jxr_linenumber" name="L242" href="#L242">242</a> 
-<a class="jxr_linenumber" name="L243" href="#L243">243</a>                     <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> originalContext = renderer.getRenderingContext();
-<a class="jxr_linenumber" name="L244" href="#L244">244</a> 
-<a class="jxr_linenumber" name="L245" href="#L245">245</a>                     File originalDoc = <strong class="jxr_keyword">new</strong> File( originalContext.getBasedir(), originalContext.getInputName() );
-<a class="jxr_linenumber" name="L246" href="#L246">246</a> 
-<a class="jxr_linenumber" name="L247" href="#L247">247</a>                     <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Files '"</span> + module.getSourceDirectory() + File.separator + docc
-<a class="jxr_linenumber" name="L248" href="#L248">248</a>                         + <span class="jxr_string">"' clashes with existing '"</span> + originalDoc + <span class="jxr_string">"'."</span> );
-<a class="jxr_linenumber" name="L249" href="#L249">249</a>                 }
-<a class="jxr_linenumber" name="L250" href="#L250">250</a>                 <em class="jxr_comment">// -----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L251" href="#L251">251</a>                 <em class="jxr_comment">// Handle key without case differences</em>
-<a class="jxr_linenumber" name="L252" href="#L252">252</a>                 <em class="jxr_comment">// -----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L253" href="#L253">253</a>                 <strong class="jxr_keyword">for</strong> ( Map.Entry&lt;String, DocumentRenderer&gt; entry : files.entrySet() )
-<a class="jxr_linenumber" name="L254" href="#L254">254</a>                 {
-<a class="jxr_linenumber" name="L255" href="#L255">255</a>                     <strong class="jxr_keyword">if</strong> ( entry.getKey().equalsIgnoreCase( key ) )
-<a class="jxr_linenumber" name="L256" href="#L256">256</a>                     {
-<a class="jxr_linenumber" name="L257" href="#L257">257</a>                         <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> originalContext = entry.getValue().getRenderingContext();
-<a class="jxr_linenumber" name="L258" href="#L258">258</a> 
-<a class="jxr_linenumber" name="L259" href="#L259">259</a>                         File originalDoc = <strong class="jxr_keyword">new</strong> File( originalContext.getBasedir(), originalContext.getInputName() );
-<a class="jxr_linenumber" name="L260" href="#L260">260</a> 
-<a class="jxr_linenumber" name="L261" href="#L261">261</a>                         <strong class="jxr_keyword">if</strong> ( Os.isFamily( Os.FAMILY_WINDOWS ) )
-<a class="jxr_linenumber" name="L262" href="#L262">262</a>                         {
-<a class="jxr_linenumber" name="L263" href="#L263">263</a>                             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Files '"</span> + module.getSourceDirectory() + File.separator
-<a class="jxr_linenumber" name="L264" href="#L264">264</a>                                 + docc + <span class="jxr_string">"' clashes with existing '"</span> + originalDoc + <span class="jxr_string">"'."</span> );
-<a class="jxr_linenumber" name="L265" href="#L265">265</a>                         }
-<a class="jxr_linenumber" name="L266" href="#L266">266</a> 
-<a class="jxr_linenumber" name="L267" href="#L267">267</a>                         <strong class="jxr_keyword">if</strong> ( getLogger().isWarnEnabled() )
-<a class="jxr_linenumber" name="L268" href="#L268">268</a>                         {
-<a class="jxr_linenumber" name="L269" href="#L269">269</a>                             getLogger().warn(
-<a class="jxr_linenumber" name="L270" href="#L270">270</a>                                               <span class="jxr_string">"Files '"</span> + module.getSourceDirectory() + File.separator + docc
-<a class="jxr_linenumber" name="L271" href="#L271">271</a>                                                   + <span class="jxr_string">"' could clashes with existing '"</span> + originalDoc + <span class="jxr_string">"'."</span> );
-<a class="jxr_linenumber" name="L272" href="#L272">272</a>                         }
-<a class="jxr_linenumber" name="L273" href="#L273">273</a>                     }
-<a class="jxr_linenumber" name="L274" href="#L274">274</a>                 }
-<a class="jxr_linenumber" name="L275" href="#L275">275</a> 
-<a class="jxr_linenumber" name="L276" href="#L276">276</a>                 files.put( key, <strong class="jxr_keyword">new</strong> DoxiaDocumentRenderer( context ) );
-<a class="jxr_linenumber" name="L277" href="#L277">277</a>             }
-<a class="jxr_linenumber" name="L278" href="#L278">278</a>         }
-<a class="jxr_linenumber" name="L279" href="#L279">279</a>     }
-<a class="jxr_linenumber" name="L280" href="#L280">280</a> 
-<a class="jxr_linenumber" name="L281" href="#L281">281</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> renderModule( Collection&lt;DocumentRenderer&gt; docs, SiteRenderingContext siteRenderingContext,
-<a class="jxr_linenumber" name="L282" href="#L282">282</a>                                File outputDirectory )
-<a class="jxr_linenumber" name="L283" href="#L283">283</a>             <strong class="jxr_keyword">throws</strong> IOException, <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>
-<a class="jxr_linenumber" name="L284" href="#L284">284</a>     {
-<a class="jxr_linenumber" name="L285" href="#L285">285</a>         <strong class="jxr_keyword">for</strong> ( DocumentRenderer docRenderer : docs )
-<a class="jxr_linenumber" name="L286" href="#L286">286</a>         {
-<a class="jxr_linenumber" name="L287" href="#L287">287</a>             <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> renderingContext = docRenderer.getRenderingContext();
-<a class="jxr_linenumber" name="L288" href="#L288">288</a> 
-<a class="jxr_linenumber" name="L289" href="#L289">289</a>             File outputFile = <strong class="jxr_keyword">new</strong> File( outputDirectory, docRenderer.getOutputName() );
-<a class="jxr_linenumber" name="L290" href="#L290">290</a> 
-<a class="jxr_linenumber" name="L291" href="#L291">291</a>             File inputFile = <strong class="jxr_keyword">new</strong> File( renderingContext.getBasedir(), renderingContext.getInputName() );
-<a class="jxr_linenumber" name="L292" href="#L292">292</a> 
-<a class="jxr_linenumber" name="L293" href="#L293">293</a>             <strong class="jxr_keyword">boolean</strong> modified = !outputFile.exists() || ( inputFile.lastModified() &gt; outputFile.lastModified() )
-<a class="jxr_linenumber" name="L294" href="#L294">294</a>                 || ( siteRenderingContext.getDecoration().getLastModified() &gt; outputFile.lastModified() );
-<a class="jxr_linenumber" name="L295" href="#L295">295</a> 
-<a class="jxr_linenumber" name="L296" href="#L296">296</a>             <strong class="jxr_keyword">if</strong> ( modified || docRenderer.isOverwrite() )
-<a class="jxr_linenumber" name="L297" href="#L297">297</a>             {
-<a class="jxr_linenumber" name="L298" href="#L298">298</a>                 <strong class="jxr_keyword">if</strong> ( !outputFile.getParentFile().exists() )
-<a class="jxr_linenumber" name="L299" href="#L299">299</a>                 {
-<a class="jxr_linenumber" name="L300" href="#L300">300</a>                     outputFile.getParentFile().mkdirs();
-<a class="jxr_linenumber" name="L301" href="#L301">301</a>                 }
-<a class="jxr_linenumber" name="L302" href="#L302">302</a> 
-<a class="jxr_linenumber" name="L303" href="#L303">303</a>                 <strong class="jxr_keyword">if</strong> ( getLogger().isDebugEnabled() )
-<a class="jxr_linenumber" name="L304" href="#L304">304</a>                 {
-<a class="jxr_linenumber" name="L305" href="#L305">305</a>                     getLogger().debug( <span class="jxr_string">"Generating "</span> + outputFile );
-<a class="jxr_linenumber" name="L306" href="#L306">306</a>                 }
-<a class="jxr_linenumber" name="L307" href="#L307">307</a> 
-<a class="jxr_linenumber" name="L308" href="#L308">308</a>                 Writer writer = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L309" href="#L309">309</a>                 <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L310" href="#L310">310</a>                 {
-<a class="jxr_linenumber" name="L311" href="#L311">311</a>                     writer = WriterFactory.newWriter( outputFile, siteRenderingContext.getOutputEncoding() );
-<a class="jxr_linenumber" name="L312" href="#L312">312</a>                     docRenderer.renderDocument( writer, <strong class="jxr_keyword">this</strong>, siteRenderingContext );
-<a class="jxr_linenumber" name="L313" href="#L313">313</a>                 }
-<a class="jxr_linenumber" name="L314" href="#L314">314</a>                 <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L315" href="#L315">315</a>                 {
-<a class="jxr_linenumber" name="L316" href="#L316">316</a>                     IOUtil.close( writer );
-<a class="jxr_linenumber" name="L317" href="#L317">317</a>                 }
-<a class="jxr_linenumber" name="L318" href="#L318">318</a>             }
-<a class="jxr_linenumber" name="L319" href="#L319">319</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L320" href="#L320">320</a>             {
-<a class="jxr_linenumber" name="L321" href="#L321">321</a>                 <strong class="jxr_keyword">if</strong> ( getLogger().isDebugEnabled() )
-<a class="jxr_linenumber" name="L322" href="#L322">322</a>                 {
-<a class="jxr_linenumber" name="L323" href="#L323">323</a>                     getLogger().debug( inputFile + <span class="jxr_string">" unchanged, not regenerating..."</span> );
-<a class="jxr_linenumber" name="L324" href="#L324">324</a>                 }
-<a class="jxr_linenumber" name="L325" href="#L325">325</a>             }
-<a class="jxr_linenumber" name="L326" href="#L326">326</a>         }
-<a class="jxr_linenumber" name="L327" href="#L327">327</a>     }
-<a class="jxr_linenumber" name="L328" href="#L328">328</a> 
-<a class="jxr_linenumber" name="L329" href="#L329">329</a>     <em class="jxr_javadoccomment">/** {@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L330" href="#L330">330</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> renderDocument( Writer writer, RenderingContext renderingContext, SiteRenderingContext siteContext )
-<a class="jxr_linenumber" name="L331" href="#L331">331</a>             <strong class="jxr_keyword">throws</strong> RendererException, FileNotFoundException, UnsupportedEncodingException
-<a class="jxr_linenumber" name="L332" href="#L332">332</a>     {
-<a class="jxr_linenumber" name="L333" href="#L333">333</a>         <a href="../../../../../org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.html">SiteRendererSink</a> sink = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/sink/SiteRendererSink.html">SiteRendererSink</a>( renderingContext );
-<a class="jxr_linenumber" name="L334" href="#L334">334</a> 
-<a class="jxr_linenumber" name="L335" href="#L335">335</a>         File doc = <strong class="jxr_keyword">new</strong> File( renderingContext.getBasedir(), renderingContext.getInputName() );
-<a class="jxr_linenumber" name="L336" href="#L336">336</a> 
-<a class="jxr_linenumber" name="L337" href="#L337">337</a>         Reader reader = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L338" href="#L338">338</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L339" href="#L339">339</a>         {
-<a class="jxr_linenumber" name="L340" href="#L340">340</a>             String resource = doc.getAbsolutePath();
-<a class="jxr_linenumber" name="L341" href="#L341">341</a> 
-<a class="jxr_linenumber" name="L342" href="#L342">342</a>             Parser parser = doxia.getParser( renderingContext.getParserId() );
-<a class="jxr_linenumber" name="L343" href="#L343">343</a> 
-<a class="jxr_linenumber" name="L344" href="#L344">344</a>             <em class="jxr_comment">// TODO: DOXIA-111: the filter used here must be checked generally.</em>
-<a class="jxr_linenumber" name="L345" href="#L345">345</a>             <strong class="jxr_keyword">if</strong> ( renderingContext.getAttribute( <span class="jxr_string">"velocity"</span> ) != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L346" href="#L346">346</a>             {
-<a class="jxr_linenumber" name="L347" href="#L347">347</a>                 <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L348" href="#L348">348</a>                 {
-<a class="jxr_linenumber" name="L349" href="#L349">349</a>                     SiteResourceLoader.setResource( resource );
-<a class="jxr_linenumber" name="L350" href="#L350">350</a> 
-<a class="jxr_linenumber" name="L351" href="#L351">351</a>                     Context vc = createVelocityContext( sink, siteContext );
-<a class="jxr_linenumber" name="L352" href="#L352">352</a> 
-<a class="jxr_linenumber" name="L353" href="#L353">353</a>                     StringWriter sw = <strong class="jxr_keyword">new</strong> StringWriter();
-<a class="jxr_linenumber" name="L354" href="#L354">354</a> 
-<a class="jxr_linenumber" name="L355" href="#L355">355</a>                     velocity.getEngine().mergeTemplate( resource, siteContext.getInputEncoding(), vc, sw );
-<a class="jxr_linenumber" name="L356" href="#L356">356</a> 
-<a class="jxr_linenumber" name="L357" href="#L357">357</a>                     reader = <strong class="jxr_keyword">new</strong> StringReader( sw.toString() );
-<a class="jxr_linenumber" name="L358" href="#L358">358</a>                     <strong class="jxr_keyword">if</strong> ( parser.getType() == Parser.XML_TYPE &amp;&amp; siteContext.isValidate() )
-<a class="jxr_linenumber" name="L359" href="#L359">359</a>                     {
-<a class="jxr_linenumber" name="L360" href="#L360">360</a>                         reader = validate( reader, resource );
-<a class="jxr_linenumber" name="L361" href="#L361">361</a>                     }
-<a class="jxr_linenumber" name="L362" href="#L362">362</a>                 }
-<a class="jxr_linenumber" name="L363" href="#L363">363</a>                 <strong class="jxr_keyword">catch</strong> ( Exception e )
-<a class="jxr_linenumber" name="L364" href="#L364">364</a>                 {
-<a class="jxr_linenumber" name="L365" href="#L365">365</a>                     <strong class="jxr_keyword">if</strong> ( getLogger().isDebugEnabled() )
-<a class="jxr_linenumber" name="L366" href="#L366">366</a>                     {
-<a class="jxr_linenumber" name="L367" href="#L367">367</a>                         getLogger().error( <span class="jxr_string">"Error parsing "</span> + resource + <span class="jxr_string">" as a velocity template, using as text."</span>, e );
-<a class="jxr_linenumber" name="L368" href="#L368">368</a>                     }
-<a class="jxr_linenumber" name="L369" href="#L369">369</a>                     <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L370" href="#L370">370</a>                     {
-<a class="jxr_linenumber" name="L371" href="#L371">371</a>                         getLogger().error( <span class="jxr_string">"Error parsing "</span> + resource + <span class="jxr_string">" as a velocity template, using as text."</span> );
-<a class="jxr_linenumber" name="L372" href="#L372">372</a>                     }
-<a class="jxr_linenumber" name="L373" href="#L373">373</a>                 }
-<a class="jxr_linenumber" name="L374" href="#L374">374</a>             }
-<a class="jxr_linenumber" name="L375" href="#L375">375</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L376" href="#L376">376</a>             {
-<a class="jxr_linenumber" name="L377" href="#L377">377</a>                 <strong class="jxr_keyword">switch</strong> ( parser.getType() )
-<a class="jxr_linenumber" name="L378" href="#L378">378</a>                 {
-<a class="jxr_linenumber" name="L379" href="#L379">379</a>                     <strong class="jxr_keyword">case</strong> Parser.XML_TYPE:
-<a class="jxr_linenumber" name="L380" href="#L380">380</a>                         reader = ReaderFactory.newXmlReader( doc );
-<a class="jxr_linenumber" name="L381" href="#L381">381</a>                         <strong class="jxr_keyword">if</strong> ( siteContext.isValidate() )
-<a class="jxr_linenumber" name="L382" href="#L382">382</a>                         {
-<a class="jxr_linenumber" name="L383" href="#L383">383</a>                             reader = validate( reader, resource );
-<a class="jxr_linenumber" name="L384" href="#L384">384</a>                         }
-<a class="jxr_linenumber" name="L385" href="#L385">385</a>                         <strong class="jxr_keyword">break</strong>;
-<a class="jxr_linenumber" name="L386" href="#L386">386</a> 
-<a class="jxr_linenumber" name="L387" href="#L387">387</a>                     <strong class="jxr_keyword">case</strong> Parser.TXT_TYPE:
-<a class="jxr_linenumber" name="L388" href="#L388">388</a>                     <strong class="jxr_keyword">case</strong> Parser.UNKNOWN_TYPE:
-<a class="jxr_linenumber" name="L389" href="#L389">389</a>                     <strong class="jxr_keyword">default</strong>:
-<a class="jxr_linenumber" name="L390" href="#L390">390</a>                         reader = ReaderFactory.newReader( doc, siteContext.getInputEncoding() );
-<a class="jxr_linenumber" name="L391" href="#L391">391</a>                 }
-<a class="jxr_linenumber" name="L392" href="#L392">392</a>             }
-<a class="jxr_linenumber" name="L393" href="#L393">393</a>             sink.enableLogging( <strong class="jxr_keyword">new</strong> PlexusLoggerWrapper( getLogger() ) );
-<a class="jxr_linenumber" name="L394" href="#L394">394</a> 
-<a class="jxr_linenumber" name="L395" href="#L395">395</a>             <strong class="jxr_keyword">if</strong> ( reader == <strong class="jxr_keyword">null</strong> ) <em class="jxr_comment">// can happen if velocity throws above</em>
-<a class="jxr_linenumber" name="L396" href="#L396">396</a>             {
-<a class="jxr_linenumber" name="L397" href="#L397">397</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Error getting a parser for '"</span> + doc + <span class="jxr_string">"'"</span> );
-<a class="jxr_linenumber" name="L398" href="#L398">398</a>             }
-<a class="jxr_linenumber" name="L399" href="#L399">399</a>             doxia.parse( reader, renderingContext.getParserId(), sink );
-<a class="jxr_linenumber" name="L400" href="#L400">400</a>         }
-<a class="jxr_linenumber" name="L401" href="#L401">401</a>         <strong class="jxr_keyword">catch</strong> ( ParserNotFoundException e )
-<a class="jxr_linenumber" name="L402" href="#L402">402</a>         {
-<a class="jxr_linenumber" name="L403" href="#L403">403</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Error getting a parser for '"</span> + doc + <span class="jxr_string">"': "</span> + e.getMessage(), e );
-<a class="jxr_linenumber" name="L404" href="#L404">404</a>         }
-<a class="jxr_linenumber" name="L405" href="#L405">405</a>         <strong class="jxr_keyword">catch</strong> ( ParseException e )
-<a class="jxr_linenumber" name="L406" href="#L406">406</a>         {
-<a class="jxr_linenumber" name="L407" href="#L407">407</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Error parsing '"</span>
-<a class="jxr_linenumber" name="L408" href="#L408">408</a>                     + doc + <span class="jxr_string">"': line ["</span> + e.getLineNumber() + <span class="jxr_string">"] "</span> + e.getMessage(), e );
-<a class="jxr_linenumber" name="L409" href="#L409">409</a>         }
-<a class="jxr_linenumber" name="L410" href="#L410">410</a>         <strong class="jxr_keyword">catch</strong> ( IOException e )
-<a class="jxr_linenumber" name="L411" href="#L411">411</a>         {
-<a class="jxr_linenumber" name="L412" href="#L412">412</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"IOException when processing '"</span> + doc + <span class="jxr_string">"'"</span>, e );
-<a class="jxr_linenumber" name="L413" href="#L413">413</a>         }
-<a class="jxr_linenumber" name="L414" href="#L414">414</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L415" href="#L415">415</a>         {
-<a class="jxr_linenumber" name="L416" href="#L416">416</a>             sink.flush();
-<a class="jxr_linenumber" name="L417" href="#L417">417</a> 
-<a class="jxr_linenumber" name="L418" href="#L418">418</a>             sink.close();
-<a class="jxr_linenumber" name="L419" href="#L419">419</a> 
-<a class="jxr_linenumber" name="L420" href="#L420">420</a>             IOUtil.close( reader );
-<a class="jxr_linenumber" name="L421" href="#L421">421</a>         }
-<a class="jxr_linenumber" name="L422" href="#L422">422</a> 
-<a class="jxr_linenumber" name="L423" href="#L423">423</a>         generateDocument( writer, sink, siteContext );
-<a class="jxr_linenumber" name="L424" href="#L424">424</a>     }
-<a class="jxr_linenumber" name="L425" href="#L425">425</a> 
-<a class="jxr_linenumber" name="L426" href="#L426">426</a>     <strong class="jxr_keyword">private</strong> Context createVelocityContext( SiteRendererSink sink, SiteRenderingContext siteRenderingContext )
-<a class="jxr_linenumber" name="L427" href="#L427">427</a>     {
-<a class="jxr_linenumber" name="L428" href="#L428">428</a>         ToolManager toolManager = <strong class="jxr_keyword">new</strong> ToolManager( <strong class="jxr_keyword">true</strong> );
-<a class="jxr_linenumber" name="L429" href="#L429">429</a>         Context context = toolManager.createContext();
-<a class="jxr_linenumber" name="L430" href="#L430">430</a> 
-<a class="jxr_linenumber" name="L431" href="#L431">431</a>         <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L432" href="#L432">432</a>         <em class="jxr_comment">// Data objects</em>
-<a class="jxr_linenumber" name="L433" href="#L433">433</a>         <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L434" href="#L434">434</a> 
-<a class="jxr_linenumber" name="L435" href="#L435">435</a>         <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> renderingContext = sink.getRenderingContext();
-<a class="jxr_linenumber" name="L436" href="#L436">436</a>         context.put( <span class="jxr_string">"relativePath"</span>, renderingContext.getRelativePath() );
-<a class="jxr_linenumber" name="L437" href="#L437">437</a> 
-<a class="jxr_linenumber" name="L438" href="#L438">438</a>         <em class="jxr_comment">// Add infos from document</em>
-<a class="jxr_linenumber" name="L439" href="#L439">439</a>         context.put( <span class="jxr_string">"authors"</span>, sink.getAuthors() );
-<a class="jxr_linenumber" name="L440" href="#L440">440</a> 
-<a class="jxr_linenumber" name="L441" href="#L441">441</a>         context.put( <span class="jxr_string">"shortTitle"</span>, sink.getTitle() );
-<a class="jxr_linenumber" name="L442" href="#L442">442</a> 
-<a class="jxr_linenumber" name="L443" href="#L443">443</a>         <em class="jxr_comment">// DOXIASITETOOLS-70: Prepend the project name to the title, if any</em>
-<a class="jxr_linenumber" name="L444" href="#L444">444</a>         String title = <span class="jxr_string">""</span>;
-<a class="jxr_linenumber" name="L445" href="#L445">445</a>         <strong class="jxr_keyword">if</strong> ( siteRenderingContext.getDecoration() != <strong class="jxr_keyword">null</strong>
-<a class="jxr_linenumber" name="L446" href="#L446">446</a>                 &amp;&amp; siteRenderingContext.getDecoration().getName() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L447" href="#L447">447</a>         {
-<a class="jxr_linenumber" name="L448" href="#L448">448</a>             title = siteRenderingContext.getDecoration().getName();
-<a class="jxr_linenumber" name="L449" href="#L449">449</a>         }
-<a class="jxr_linenumber" name="L450" href="#L450">450</a>         <strong class="jxr_keyword">else</strong> <strong class="jxr_keyword">if</strong> ( siteRenderingContext.getDefaultWindowTitle() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L451" href="#L451">451</a>         {
-<a class="jxr_linenumber" name="L452" href="#L452">452</a>             title = siteRenderingContext.getDefaultWindowTitle();
-<a class="jxr_linenumber" name="L453" href="#L453">453</a>         }
-<a class="jxr_linenumber" name="L454" href="#L454">454</a> 
-<a class="jxr_linenumber" name="L455" href="#L455">455</a>         <strong class="jxr_keyword">if</strong> ( title.length() &gt; 0 )
-<a class="jxr_linenumber" name="L456" href="#L456">456</a>         {
-<a class="jxr_linenumber" name="L457" href="#L457">457</a>             title += <span class="jxr_string">" &amp;#x2013; "</span>;
-<a class="jxr_linenumber" name="L458" href="#L458">458</a>         }
-<a class="jxr_linenumber" name="L459" href="#L459">459</a>         title += sink.getTitle();
-<a class="jxr_linenumber" name="L460" href="#L460">460</a> 
-<a class="jxr_linenumber" name="L461" href="#L461">461</a>         context.put( <span class="jxr_string">"title"</span>, title );
-<a class="jxr_linenumber" name="L462" href="#L462">462</a> 
-<a class="jxr_linenumber" name="L463" href="#L463">463</a>         context.put( <span class="jxr_string">"headContent"</span>, sink.getHead() );
-<a class="jxr_linenumber" name="L464" href="#L464">464</a> 
-<a class="jxr_linenumber" name="L465" href="#L465">465</a>         context.put( <span class="jxr_string">"bodyContent"</span>, sink.getBody() );
-<a class="jxr_linenumber" name="L466" href="#L466">466</a> 
-<a class="jxr_linenumber" name="L467" href="#L467">467</a>         context.put( <span class="jxr_string">"decoration"</span>, siteRenderingContext.getDecoration() );
-<a class="jxr_linenumber" name="L468" href="#L468">468</a> 
-<a class="jxr_linenumber" name="L469" href="#L469">469</a>         SimpleDateFormat sdf = <strong class="jxr_keyword">new</strong> SimpleDateFormat( <span class="jxr_string">"yyyyMMdd"</span> );
-<a class="jxr_linenumber" name="L470" href="#L470">470</a>         <strong class="jxr_keyword">if</strong> ( StringUtils.isNotEmpty( sink.getDate() ) )
-<a class="jxr_linenumber" name="L471" href="#L471">471</a>         {
-<a class="jxr_linenumber" name="L472" href="#L472">472</a>             <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L473" href="#L473">473</a>             {
-<a class="jxr_linenumber" name="L474" href="#L474">474</a>                 <em class="jxr_comment">// we support only ISO-8601 date</em>
-<a class="jxr_linenumber" name="L475" href="#L475">475</a>                 context.put( <span class="jxr_string">"dateCreation"</span>,
-<a class="jxr_linenumber" name="L476" href="#L476">476</a>                         sdf.format( <strong class="jxr_keyword">new</strong> SimpleDateFormat( <span class="jxr_string">"yyyy-MM-dd"</span> ).parse( sink.getDate() ) ) );
-<a class="jxr_linenumber" name="L477" href="#L477">477</a>             }
-<a class="jxr_linenumber" name="L478" href="#L478">478</a>             <strong class="jxr_keyword">catch</strong> ( java.text.ParseException e )
-<a class="jxr_linenumber" name="L479" href="#L479">479</a>             {
-<a class="jxr_linenumber" name="L480" href="#L480">480</a>                 getLogger().debug( <span class="jxr_string">"Could not parse date: "</span> + sink.getDate() + <span class="jxr_string">", ignoring!"</span>, e );
-<a class="jxr_linenumber" name="L481" href="#L481">481</a>             }
-<a class="jxr_linenumber" name="L482" href="#L482">482</a>         }
-<a class="jxr_linenumber" name="L483" href="#L483">483</a>         context.put( <span class="jxr_string">"dateRevision"</span>, sdf.format( <strong class="jxr_keyword">new</strong> Date() ) );
-<a class="jxr_linenumber" name="L484" href="#L484">484</a> 
-<a class="jxr_linenumber" name="L485" href="#L485">485</a>         context.put( <span class="jxr_string">"currentDate"</span>, <strong class="jxr_keyword">new</strong> Date() );
-<a class="jxr_linenumber" name="L486" href="#L486">486</a> 
-<a class="jxr_linenumber" name="L487" href="#L487">487</a>         context.put( <span class="jxr_string">"publishDate"</span>, siteRenderingContext.getPublishDate() );
-<a class="jxr_linenumber" name="L488" href="#L488">488</a> 
-<a class="jxr_linenumber" name="L489" href="#L489">489</a>         Locale locale = siteRenderingContext.getLocale();
-<a class="jxr_linenumber" name="L490" href="#L490">490</a> 
-<a class="jxr_linenumber" name="L491" href="#L491">491</a>         DateFormat dateFormat = DateFormat.getDateInstance( DateFormat.DEFAULT, locale );
-<a class="jxr_linenumber" name="L492" href="#L492">492</a> 
-<a class="jxr_linenumber" name="L493" href="#L493">493</a>         <strong class="jxr_keyword">if</strong> ( siteRenderingContext.getDecoration().getPublishDate() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L494" href="#L494">494</a>         {
-<a class="jxr_linenumber" name="L495" href="#L495">495</a>             <strong class="jxr_keyword">if</strong> ( StringUtils.isNotBlank( siteRenderingContext.getDecoration().getPublishDate().getFormat() ) )
-<a class="jxr_linenumber" name="L496" href="#L496">496</a>             {
-<a class="jxr_linenumber" name="L497" href="#L497">497</a>                 dateFormat =
-<a class="jxr_linenumber" name="L498" href="#L498">498</a>                     <strong class="jxr_keyword">new</strong> SimpleDateFormat( siteRenderingContext.getDecoration().getPublishDate().getFormat(), locale );
-<a class="jxr_linenumber" name="L499" href="#L499">499</a>             }
-<a class="jxr_linenumber" name="L500" href="#L500">500</a>         }
-<a class="jxr_linenumber" name="L501" href="#L501">501</a> 
-<a class="jxr_linenumber" name="L502" href="#L502">502</a>         context.put( <span class="jxr_string">"dateFormat"</span>, dateFormat );
-<a class="jxr_linenumber" name="L503" href="#L503">503</a> 
-<a class="jxr_linenumber" name="L504" href="#L504">504</a>         String currentFileName = renderingContext.getOutputName().replace( '&#92;&#92;', '/' );
-<a class="jxr_linenumber" name="L505" href="#L505">505</a>         context.put( <span class="jxr_string">"currentFileName"</span>, currentFileName );
-<a class="jxr_linenumber" name="L506" href="#L506">506</a> 
-<a class="jxr_linenumber" name="L507" href="#L507">507</a>         context.put( <span class="jxr_string">"alignedFileName"</span>, PathTool.calculateLink( currentFileName, renderingContext.getRelativePath() ) );
-<a class="jxr_linenumber" name="L508" href="#L508">508</a> 
-<a class="jxr_linenumber" name="L509" href="#L509">509</a>         context.put( <span class="jxr_string">"locale"</span>, locale );
-<a class="jxr_linenumber" name="L510" href="#L510">510</a>         context.put( <span class="jxr_string">"supportedLocales"</span>, Collections.unmodifiableList( siteRenderingContext.getSiteLocales() ) );
-<a class="jxr_linenumber" name="L511" href="#L511">511</a> 
-<a class="jxr_linenumber" name="L512" href="#L512">512</a>         InputStream inputStream = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L513" href="#L513">513</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L514" href="#L514">514</a>         {
-<a class="jxr_linenumber" name="L515" href="#L515">515</a>             inputStream = <strong class="jxr_keyword">this</strong>.getClass().getClassLoader().getResourceAsStream( <span class="jxr_string">"META-INF/maven/org.apache.maven.doxia/doxia-site-renderer/pom.properties"</span> );
-<a class="jxr_linenumber" name="L516" href="#L516">516</a>             <strong class="jxr_keyword">if</strong> ( inputStream == <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L517" href="#L517">517</a>             {
-<a class="jxr_linenumber" name="L518" href="#L518">518</a>                 getLogger().debug( <span class="jxr_string">"pom.properties for doxia-site-renderer could not be found."</span> );
-<a class="jxr_linenumber" name="L519" href="#L519">519</a>             }
-<a class="jxr_linenumber" name="L520" href="#L520">520</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L521" href="#L521">521</a>             {
-<a class="jxr_linenumber" name="L522" href="#L522">522</a>                 Properties properties = <strong class="jxr_keyword">new</strong> Properties();
-<a class="jxr_linenumber" name="L523" href="#L523">523</a>                 properties.load( inputStream );
-<a class="jxr_linenumber" name="L524" href="#L524">524</a>                 context.put( <span class="jxr_string">"doxiaSiteRendererVersion"</span>, properties.getProperty( <span class="jxr_string">"version"</span> ) );
-<a class="jxr_linenumber" name="L525" href="#L525">525</a>             }
-<a class="jxr_linenumber" name="L526" href="#L526">526</a>         }
-<a class="jxr_linenumber" name="L527" href="#L527">527</a>         <strong class="jxr_keyword">catch</strong>( IOException e )
-<a class="jxr_linenumber" name="L528" href="#L528">528</a>         {
-<a class="jxr_linenumber" name="L529" href="#L529">529</a>             getLogger().debug( <span class="jxr_string">"Failed to load pom.properties, so doxiaVersion is not available in the velocityContext."</span> );
-<a class="jxr_linenumber" name="L530" href="#L530">530</a>         }
-<a class="jxr_linenumber" name="L531" href="#L531">531</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L532" href="#L532">532</a>         {
-<a class="jxr_linenumber" name="L533" href="#L533">533</a>             IOUtil.close( inputStream );
-<a class="jxr_linenumber" name="L534" href="#L534">534</a>         }
-<a class="jxr_linenumber" name="L535" href="#L535">535</a> 
-<a class="jxr_linenumber" name="L536" href="#L536">536</a>         <em class="jxr_comment">// Add user properties</em>
-<a class="jxr_linenumber" name="L537" href="#L537">537</a>         Map&lt;String, ?&gt; templateProperties = siteRenderingContext.getTemplateProperties();
-<a class="jxr_linenumber" name="L538" href="#L538">538</a> 
-<a class="jxr_linenumber" name="L539" href="#L539">539</a>         <strong class="jxr_keyword">if</strong> ( templateProperties != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L540" href="#L540">540</a>         {
-<a class="jxr_linenumber" name="L541" href="#L541">541</a>             <strong class="jxr_keyword">for</strong> ( Map.Entry&lt;String, ?&gt; entry : templateProperties.entrySet() )
-<a class="jxr_linenumber" name="L542" href="#L542">542</a>             {
-<a class="jxr_linenumber" name="L543" href="#L543">543</a>                 context.put( entry.getKey(), entry.getValue() );
-<a class="jxr_linenumber" name="L544" href="#L544">544</a>             }
-<a class="jxr_linenumber" name="L545" href="#L545">545</a>         }
-<a class="jxr_linenumber" name="L546" href="#L546">546</a> 
-<a class="jxr_linenumber" name="L547" href="#L547">547</a>         <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L548" href="#L548">548</a>         <em class="jxr_comment">// Tools</em>
-<a class="jxr_linenumber" name="L549" href="#L549">549</a>         <em class="jxr_comment">// ----------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L550" href="#L550">550</a> 
-<a class="jxr_linenumber" name="L551" href="#L551">551</a>         context.put( <span class="jxr_string">"PathTool"</span>, <strong class="jxr_keyword">new</strong> PathTool() );
-<a class="jxr_linenumber" name="L552" href="#L552">552</a> 
-<a class="jxr_linenumber" name="L553" href="#L553">553</a>         context.put( <span class="jxr_string">"FileUtils"</span>, <strong class="jxr_keyword">new</strong> FileUtils() );
-<a class="jxr_linenumber" name="L554" href="#L554">554</a> 
-<a class="jxr_linenumber" name="L555" href="#L555">555</a>         context.put( <span class="jxr_string">"StringUtils"</span>, <strong class="jxr_keyword">new</strong> StringUtils() );
-<a class="jxr_linenumber" name="L556" href="#L556">556</a> 
-<a class="jxr_linenumber" name="L557" href="#L557">557</a>         context.put( <span class="jxr_string">"i18n"</span>, i18n );
-<a class="jxr_linenumber" name="L558" href="#L558">558</a> 
-<a class="jxr_linenumber" name="L559" href="#L559">559</a>         <strong class="jxr_keyword">return</strong> context;
-<a class="jxr_linenumber" name="L560" href="#L560">560</a>     }
-<a class="jxr_linenumber" name="L561" href="#L561">561</a> 
-<a class="jxr_linenumber" name="L562" href="#L562">562</a>     <em class="jxr_javadoccomment">/** {@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L563" href="#L563">563</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> generateDocument( Writer writer, SiteRendererSink sink, SiteRenderingContext siteRenderingContext )
-<a class="jxr_linenumber" name="L564" href="#L564">564</a>             <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>
-<a class="jxr_linenumber" name="L565" href="#L565">565</a>     {
-<a class="jxr_linenumber" name="L566" href="#L566">566</a>         Context context = createVelocityContext( sink, siteRenderingContext );
-<a class="jxr_linenumber" name="L567" href="#L567">567</a> 
-<a class="jxr_linenumber" name="L568" href="#L568">568</a>         writeTemplate( writer, context, siteRenderingContext );
-<a class="jxr_linenumber" name="L569" href="#L569">569</a>     }
-<a class="jxr_linenumber" name="L570" href="#L570">570</a> 
-<a class="jxr_linenumber" name="L571" href="#L571">571</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> writeTemplate( Writer writer, Context context, SiteRenderingContext siteContext )
-<a class="jxr_linenumber" name="L572" href="#L572">572</a>             <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>
-<a class="jxr_linenumber" name="L573" href="#L573">573</a>     {
-<a class="jxr_linenumber" name="L574" href="#L574">574</a>         ClassLoader old = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L575" href="#L575">575</a> 
-<a class="jxr_linenumber" name="L576" href="#L576">576</a>         <strong class="jxr_keyword">if</strong> ( siteContext.getTemplateClassLoader() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L577" href="#L577">577</a>         {
-<a class="jxr_linenumber" name="L578" href="#L578">578</a>             <em class="jxr_comment">// -------------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L579" href="#L579">579</a>             <em class="jxr_comment">// If no template classloader was set we'll just use the context classloader</em>
-<a class="jxr_linenumber" name="L580" href="#L580">580</a>             <em class="jxr_comment">// -------------------------------------------------------------------------</em>
-<a class="jxr_linenumber" name="L581" href="#L581">581</a> 
-<a class="jxr_linenumber" name="L582" href="#L582">582</a>             old = Thread.currentThread().getContextClassLoader();
-<a class="jxr_linenumber" name="L583" href="#L583">583</a> 
-<a class="jxr_linenumber" name="L584" href="#L584">584</a>             Thread.currentThread().setContextClassLoader( siteContext.getTemplateClassLoader() );
-<a class="jxr_linenumber" name="L585" href="#L585">585</a>         }
-<a class="jxr_linenumber" name="L586" href="#L586">586</a> 
-<a class="jxr_linenumber" name="L587" href="#L587">587</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L588" href="#L588">588</a>         {
-<a class="jxr_linenumber" name="L589" href="#L589">589</a>             processTemplate( siteContext.getTemplateName(), context, writer );
-<a class="jxr_linenumber" name="L590" href="#L590">590</a>         }
-<a class="jxr_linenumber" name="L591" href="#L591">591</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L592" href="#L592">592</a>         {
-<a class="jxr_linenumber" name="L593" href="#L593">593</a>             IOUtil.close( writer );
-<a class="jxr_linenumber" name="L594" href="#L594">594</a> 
-<a class="jxr_linenumber" name="L595" href="#L595">595</a>             <strong class="jxr_keyword">if</strong> ( old != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L596" href="#L596">596</a>             {
-<a class="jxr_linenumber" name="L597" href="#L597">597</a>                 Thread.currentThread().setContextClassLoader( old );
-<a class="jxr_linenumber" name="L598" href="#L598">598</a>             }
-<a class="jxr_linenumber" name="L599" href="#L599">599</a>         }
-<a class="jxr_linenumber" name="L600" href="#L600">600</a>     }
-<a class="jxr_linenumber" name="L601" href="#L601">601</a> 
-<a class="jxr_linenumber" name="L602" href="#L602">602</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L603" href="#L603">603</a> <em class="jxr_javadoccomment">     * @noinspection OverlyBroadCatchBlock,UnusedCatchParameter</em>
-<a class="jxr_linenumber" name="L604" href="#L604">604</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L605" href="#L605">605</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> processTemplate( String templateName, Context context, Writer writer )
-<a class="jxr_linenumber" name="L606" href="#L606">606</a>             <strong class="jxr_keyword">throws</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>
-<a class="jxr_linenumber" name="L607" href="#L607">607</a>     {
-<a class="jxr_linenumber" name="L608" href="#L608">608</a>         Template template;
-<a class="jxr_linenumber" name="L609" href="#L609">609</a> 
-<a class="jxr_linenumber" name="L610" href="#L610">610</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L611" href="#L611">611</a>         {
-<a class="jxr_linenumber" name="L612" href="#L612">612</a>             template = velocity.getEngine().getTemplate( templateName );
-<a class="jxr_linenumber" name="L613" href="#L613">613</a>         }
-<a class="jxr_linenumber" name="L614" href="#L614">614</a>         <strong class="jxr_keyword">catch</strong> ( Exception e )
-<a class="jxr_linenumber" name="L615" href="#L615">615</a>         {
-<a class="jxr_linenumber" name="L616" href="#L616">616</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Could not find the template '"</span> + templateName, e );
-<a class="jxr_linenumber" name="L617" href="#L617">617</a>         }
-<a class="jxr_linenumber" name="L618" href="#L618">618</a> 
-<a class="jxr_linenumber" name="L619" href="#L619">619</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L620" href="#L620">620</a>         {
-<a class="jxr_linenumber" name="L621" href="#L621">621</a>             template.merge( context, writer );
-<a class="jxr_linenumber" name="L622" href="#L622">622</a>         }
-<a class="jxr_linenumber" name="L623" href="#L623">623</a>         <strong class="jxr_keyword">catch</strong> ( Exception e )
-<a class="jxr_linenumber" name="L624" href="#L624">624</a>         {
-<a class="jxr_linenumber" name="L625" href="#L625">625</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RendererException.html">RendererException</a>( <span class="jxr_string">"Error while generating code."</span>, e );
-<a class="jxr_linenumber" name="L626" href="#L626">626</a>         }
-<a class="jxr_linenumber" name="L627" href="#L627">627</a>     }
-<a class="jxr_linenumber" name="L628" href="#L628">628</a> 
-<a class="jxr_linenumber" name="L629" href="#L629">629</a>     <em class="jxr_javadoccomment">/** {@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L630" href="#L630">630</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a> createContextForSkin( File skinFile, Map&lt;String, ?&gt; attributes,
-<a class="jxr_linenumber" name="L631" href="#L631">631</a>                                                       DecorationModel decoration, String defaultWindowTitle,
-<a class="jxr_linenumber" name="L632" href="#L632">632</a>                                                       Locale locale )
-<a class="jxr_linenumber" name="L633" href="#L633">633</a>             <strong class="jxr_keyword">throws</strong> IOException
-<a class="jxr_linenumber" name="L634" href="#L634">634</a>     {
-<a class="jxr_linenumber" name="L635" href="#L635">635</a>         <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a> context = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a>();
-<a class="jxr_linenumber" name="L636" href="#L636">636</a> 
-<a class="jxr_linenumber" name="L637" href="#L637">637</a>         ZipFile zipFile = getZipFile( skinFile );
-<a class="jxr_linenumber" name="L638" href="#L638">638</a> 
-<a class="jxr_linenumber" name="L639" href="#L639">639</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L640" href="#L640">640</a>         {
-<a class="jxr_linenumber" name="L641" href="#L641">641</a>             <strong class="jxr_keyword">if</strong> ( zipFile.getEntry( SKIN_TEMPLATE_LOCATION ) != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L642" href="#L642">642</a>             {
-<a class="jxr_linenumber" name="L643" href="#L643">643</a>                 context.setTemplateName( SKIN_TEMPLATE_LOCATION );
-<a class="jxr_linenumber" name="L644" href="#L644">644</a>                 context.setTemplateClassLoader( <strong class="jxr_keyword">new</strong> URLClassLoader( <strong class="jxr_keyword">new</strong> URL[]{skinFile.toURI().toURL()} ) );
-<a class="jxr_linenumber" name="L645" href="#L645">645</a>             }
-<a class="jxr_linenumber" name="L646" href="#L646">646</a>             <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L647" href="#L647">647</a>             {
-<a class="jxr_linenumber" name="L648" href="#L648">648</a>                 context.setTemplateName( DEFAULT_TEMPLATE );
-<a class="jxr_linenumber" name="L649" href="#L649">649</a>                 context.setTemplateClassLoader( getClass().getClassLoader() );
-<a class="jxr_linenumber" name="L650" href="#L650">650</a>                 context.setUsingDefaultTemplate( <strong class="jxr_keyword">true</strong> );
-<a class="jxr_linenumber" name="L651" href="#L651">651</a>             }
-<a class="jxr_linenumber" name="L652" href="#L652">652</a>         }
-<a class="jxr_linenumber" name="L653" href="#L653">653</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L654" href="#L654">654</a>         {
-<a class="jxr_linenumber" name="L655" href="#L655">655</a>             closeZipFile( zipFile );
-<a class="jxr_linenumber" name="L656" href="#L656">656</a>         }
-<a class="jxr_linenumber" name="L657" href="#L657">657</a> 
-<a class="jxr_linenumber" name="L658" href="#L658">658</a>         context.setTemplateProperties( attributes );
-<a class="jxr_linenumber" name="L659" href="#L659">659</a>         context.setLocale( locale );
-<a class="jxr_linenumber" name="L660" href="#L660">660</a>         context.setDecoration( decoration );
-<a class="jxr_linenumber" name="L661" href="#L661">661</a>         context.setDefaultWindowTitle( defaultWindowTitle );
-<a class="jxr_linenumber" name="L662" href="#L662">662</a>         context.setSkinJarFile( skinFile );
-<a class="jxr_linenumber" name="L663" href="#L663">663</a> 
-<a class="jxr_linenumber" name="L664" href="#L664">664</a>         <strong class="jxr_keyword">return</strong> context;
-<a class="jxr_linenumber" name="L665" href="#L665">665</a>     }
-<a class="jxr_linenumber" name="L666" href="#L666">666</a> 
-<a class="jxr_linenumber" name="L667" href="#L667">667</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> ZipFile getZipFile( File file )
-<a class="jxr_linenumber" name="L668" href="#L668">668</a>         <strong class="jxr_keyword">throws</strong> IOException
-<a class="jxr_linenumber" name="L669" href="#L669">669</a>     {
-<a class="jxr_linenumber" name="L670" href="#L670">670</a>         <strong class="jxr_keyword">if</strong> ( file == <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L671" href="#L671">671</a>         {
-<a class="jxr_linenumber" name="L672" href="#L672">672</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IOException( <span class="jxr_string">"Error opening ZipFile: null"</span> );
-<a class="jxr_linenumber" name="L673" href="#L673">673</a>         }
-<a class="jxr_linenumber" name="L674" href="#L674">674</a> 
-<a class="jxr_linenumber" name="L675" href="#L675">675</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L676" href="#L676">676</a>         {
-<a class="jxr_linenumber" name="L677" href="#L677">677</a>             <em class="jxr_comment">// TODO: plexus-archiver, if it could do the excludes</em>
-<a class="jxr_linenumber" name="L678" href="#L678">678</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> ZipFile( file );
-<a class="jxr_linenumber" name="L679" href="#L679">679</a>         }
-<a class="jxr_linenumber" name="L680" href="#L680">680</a>         <strong class="jxr_keyword">catch</strong> ( ZipException ex )
-<a class="jxr_linenumber" name="L681" href="#L681">681</a>         {
-<a class="jxr_linenumber" name="L682" href="#L682">682</a>             IOException ioe = <strong class="jxr_keyword">new</strong> IOException( <span class="jxr_string">"Error opening ZipFile: "</span> + file.getAbsolutePath() );
-<a class="jxr_linenumber" name="L683" href="#L683">683</a>             ioe.initCause( ex );
-<a class="jxr_linenumber" name="L684" href="#L684">684</a>             <strong class="jxr_keyword">throw</strong> ioe;
-<a class="jxr_linenumber" name="L685" href="#L685">685</a>         }
-<a class="jxr_linenumber" name="L686" href="#L686">686</a>     }
-<a class="jxr_linenumber" name="L687" href="#L687">687</a> 
-<a class="jxr_linenumber" name="L688" href="#L688">688</a>     <em class="jxr_javadoccomment">/** {@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L689" href="#L689">689</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a> createContextForTemplate( File templateFile, File skinFile, Map&lt;String, ?&gt; attributes,
-<a class="jxr_linenumber" name="L690" href="#L690">690</a>                                                           DecorationModel decoration, String defaultWindowTitle,
-<a class="jxr_linenumber" name="L691" href="#L691">691</a>                                                           Locale locale )
-<a class="jxr_linenumber" name="L692" href="#L692">692</a>             <strong class="jxr_keyword">throws</strong> MalformedURLException
-<a class="jxr_linenumber" name="L693" href="#L693">693</a>     {
-<a class="jxr_linenumber" name="L694" href="#L694">694</a>         <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a> context = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/SiteRenderingContext.html">SiteRenderingContext</a>();
-<a class="jxr_linenumber" name="L695" href="#L695">695</a> 
-<a class="jxr_linenumber" name="L696" href="#L696">696</a>         context.setTemplateName( templateFile.getName() );
-<a class="jxr_linenumber" name="L697" href="#L697">697</a>         context.setTemplateClassLoader( <strong class="jxr_keyword">new</strong> URLClassLoader( <strong class="jxr_keyword">new</strong> URL[]{templateFile.getParentFile().toURI().toURL()} ) );
-<a class="jxr_linenumber" name="L698" href="#L698">698</a> 
-<a class="jxr_linenumber" name="L699" href="#L699">699</a>         context.setTemplateProperties( attributes );
-<a class="jxr_linenumber" name="L700" href="#L700">700</a>         context.setLocale( locale );
-<a class="jxr_linenumber" name="L701" href="#L701">701</a>         context.setDecoration( decoration );
-<a class="jxr_linenumber" name="L702" href="#L702">702</a>         context.setDefaultWindowTitle( defaultWindowTitle );
-<a class="jxr_linenumber" name="L703" href="#L703">703</a>         context.setSkinJarFile( skinFile );
-<a class="jxr_linenumber" name="L704" href="#L704">704</a> 
-<a class="jxr_linenumber" name="L705" href="#L705">705</a>         <strong class="jxr_keyword">return</strong> context;
-<a class="jxr_linenumber" name="L706" href="#L706">706</a>     }
-<a class="jxr_linenumber" name="L707" href="#L707">707</a> 
-<a class="jxr_linenumber" name="L708" href="#L708">708</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> closeZipFile( ZipFile zipFile )
-<a class="jxr_linenumber" name="L709" href="#L709">709</a>     {
-<a class="jxr_linenumber" name="L710" href="#L710">710</a>         <em class="jxr_comment">// TODO: move to plexus utils</em>
-<a class="jxr_linenumber" name="L711" href="#L711">711</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L712" href="#L712">712</a>         {
-<a class="jxr_linenumber" name="L713" href="#L713">713</a>             zipFile.close();
-<a class="jxr_linenumber" name="L714" href="#L714">714</a>         }
-<a class="jxr_linenumber" name="L715" href="#L715">715</a>         <strong class="jxr_keyword">catch</strong> ( IOException e )
-<a class="jxr_linenumber" name="L716" href="#L716">716</a>         {
-<a class="jxr_linenumber" name="L717" href="#L717">717</a>             <em class="jxr_comment">// ignore</em>
-<a class="jxr_linenumber" name="L718" href="#L718">718</a>         }
-<a class="jxr_linenumber" name="L719" href="#L719">719</a>     }
-<a class="jxr_linenumber" name="L720" href="#L720">720</a> 
-<a class="jxr_linenumber" name="L721" href="#L721">721</a>     <em class="jxr_javadoccomment">/** {@inheritDoc} */</em>
-<a class="jxr_linenumber" name="L722" href="#L722">722</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> copyResources( SiteRenderingContext siteRenderingContext, File resourcesDirectory, File outputDirectory )
-<a class="jxr_linenumber" name="L723" href="#L723">723</a>             <strong class="jxr_keyword">throws</strong> IOException
-<a class="jxr_linenumber" name="L724" href="#L724">724</a>     {
-<a class="jxr_linenumber" name="L725" href="#L725">725</a>         <strong class="jxr_keyword">if</strong> ( siteRenderingContext.getSkinJarFile() != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L726" href="#L726">726</a>         {
-<a class="jxr_linenumber" name="L727" href="#L727">727</a>             ZipFile file = getZipFile( siteRenderingContext.getSkinJarFile() );
-<a class="jxr_linenumber" name="L728" href="#L728">728</a> 
-<a class="jxr_linenumber" name="L729" href="#L729">729</a>             <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L730" href="#L730">730</a>             {
-<a class="jxr_linenumber" name="L731" href="#L731">731</a>                 <strong class="jxr_keyword">for</strong> ( Enumeration&lt;? <strong class="jxr_keyword">extends</strong> ZipEntry&gt; e = file.entries(); e.hasMoreElements(); )
-<a class="jxr_linenumber" name="L732" href="#L732">732</a>                 {
-<a class="jxr_linenumber" name="L733" href="#L733">733</a>                     ZipEntry entry = e.nextElement();
-<a class="jxr_linenumber" name="L734" href="#L734">734</a> 
-<a class="jxr_linenumber" name="L735" href="#L735">735</a>                     <strong class="jxr_keyword">if</strong> ( !entry.getName().startsWith( <span class="jxr_string">"META-INF/"</span> ) )
-<a class="jxr_linenumber" name="L736" href="#L736">736</a>                     {
-<a class="jxr_linenumber" name="L737" href="#L737">737</a>                         File destFile = <strong class="jxr_keyword">new</strong> File( outputDirectory, entry.getName() );
-<a class="jxr_linenumber" name="L738" href="#L738">738</a>                         <strong class="jxr_keyword">if</strong> ( !entry.isDirectory() )
-<a class="jxr_linenumber" name="L739" href="#L739">739</a>                         {
-<a class="jxr_linenumber" name="L740" href="#L740">740</a>                             destFile.getParentFile().mkdirs();
-<a class="jxr_linenumber" name="L741" href="#L741">741</a> 
-<a class="jxr_linenumber" name="L742" href="#L742">742</a>                             copyFileFromZip( file, entry, destFile );
-<a class="jxr_linenumber" name="L743" href="#L743">743</a>                         }
-<a class="jxr_linenumber" name="L744" href="#L744">744</a>                         <strong class="jxr_keyword">else</strong>
-<a class="jxr_linenumber" name="L745" href="#L745">745</a>                         {
-<a class="jxr_linenumber" name="L746" href="#L746">746</a>                             destFile.mkdirs();
-<a class="jxr_linenumber" name="L747" href="#L747">747</a>                         }
-<a class="jxr_linenumber" name="L748" href="#L748">748</a>                     }
-<a class="jxr_linenumber" name="L749" href="#L749">749</a>                 }
-<a class="jxr_linenumber" name="L750" href="#L750">750</a>             }
-<a class="jxr_linenumber" name="L751" href="#L751">751</a>             <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L752" href="#L752">752</a>             {
-<a class="jxr_linenumber" name="L753" href="#L753">753</a>                 closeZipFile( file );
-<a class="jxr_linenumber" name="L754" href="#L754">754</a>             }
-<a class="jxr_linenumber" name="L755" href="#L755">755</a>         }
-<a class="jxr_linenumber" name="L756" href="#L756">756</a> 
-<a class="jxr_linenumber" name="L757" href="#L757">757</a>         <strong class="jxr_keyword">if</strong> ( siteRenderingContext.isUsingDefaultTemplate() )
-<a class="jxr_linenumber" name="L758" href="#L758">758</a>         {
-<a class="jxr_linenumber" name="L759" href="#L759">759</a>             InputStream resourceList = getClass().getClassLoader()
-<a class="jxr_linenumber" name="L760" href="#L760">760</a>                     .getResourceAsStream( RESOURCE_DIR + <span class="jxr_string">"/resources.txt"</span> );
-<a class="jxr_linenumber" name="L761" href="#L761">761</a> 
-<a class="jxr_linenumber" name="L762" href="#L762">762</a>             <strong class="jxr_keyword">if</strong> ( resourceList != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L763" href="#L763">763</a>             {
-<a class="jxr_linenumber" name="L764" href="#L764">764</a>                 Reader r = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L765" href="#L765">765</a>                 LineNumberReader reader = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L766" href="#L766">766</a>                 <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L767" href="#L767">767</a>                 {
-<a class="jxr_linenumber" name="L768" href="#L768">768</a>                     r = ReaderFactory.newReader( resourceList, ReaderFactory.UTF_8 );
-<a class="jxr_linenumber" name="L769" href="#L769">769</a>                     reader = <strong class="jxr_keyword">new</strong> LineNumberReader( r );
-<a class="jxr_linenumber" name="L770" href="#L770">770</a> 
-<a class="jxr_linenumber" name="L771" href="#L771">771</a>                     String line = reader.readLine();
-<a class="jxr_linenumber" name="L772" href="#L772">772</a> 
-<a class="jxr_linenumber" name="L773" href="#L773">773</a>                     <strong class="jxr_keyword">while</strong> ( line != <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L774" href="#L774">774</a>                     {
-<a class="jxr_linenumber" name="L775" href="#L775">775</a>                         InputStream is = getClass().getClassLoader().getResourceAsStream( RESOURCE_DIR + <span class="jxr_string">"/"</span> + line );
-<a class="jxr_linenumber" name="L776" href="#L776">776</a> 
-<a class="jxr_linenumber" name="L777" href="#L777">777</a>                         <strong class="jxr_keyword">if</strong> ( is == <strong class="jxr_keyword">null</strong> )
-<a class="jxr_linenumber" name="L778" href="#L778">778</a>                         {
-<a class="jxr_linenumber" name="L779" href="#L779">779</a>                             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> IOException( <span class="jxr_string">"The resource "</span> + line + <span class="jxr_string">" doesn't exist."</span> );
-<a class="jxr_linenumber" name="L780" href="#L780">780</a>                         }
-<a class="jxr_linenumber" name="L781" href="#L781">781</a> 
-<a class="jxr_linenumber" name="L782" href="#L782">782</a>                         File outputFile = <strong class="jxr_keyword">new</strong> File( outputDirectory, line );
-<a class="jxr_linenumber" name="L783" href="#L783">783</a> 
-<a class="jxr_linenumber" name="L784" href="#L784">784</a>                         <strong class="jxr_keyword">if</strong> ( !outputFile.getParentFile().exists() )
-<a class="jxr_linenumber" name="L785" href="#L785">785</a>                         {
-<a class="jxr_linenumber" name="L786" href="#L786">786</a>                             outputFile.getParentFile().mkdirs();
-<a class="jxr_linenumber" name="L787" href="#L787">787</a>                         }
-<a class="jxr_linenumber" name="L788" href="#L788">788</a> 
-<a class="jxr_linenumber" name="L789" href="#L789">789</a>                         OutputStream os = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L790" href="#L790">790</a>                         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L791" href="#L791">791</a>                         {
-<a class="jxr_linenumber" name="L792" href="#L792">792</a>                             <em class="jxr_comment">// for the images</em>
-<a class="jxr_linenumber" name="L793" href="#L793">793</a>                             os = <strong class="jxr_keyword">new</strong> FileOutputStream( outputFile );
-<a class="jxr_linenumber" name="L794" href="#L794">794</a>                             IOUtil.copy( is, os );
-<a class="jxr_linenumber" name="L795" href="#L795">795</a>                         }
-<a class="jxr_linenumber" name="L796" href="#L796">796</a>                         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L797" href="#L797">797</a>                         {
-<a class="jxr_linenumber" name="L798" href="#L798">798</a>                             IOUtil.close( os );
-<a class="jxr_linenumber" name="L799" href="#L799">799</a>                         }
-<a class="jxr_linenumber" name="L800" href="#L800">800</a> 
-<a class="jxr_linenumber" name="L801" href="#L801">801</a>                         IOUtil.close( is );
-<a class="jxr_linenumber" name="L802" href="#L802">802</a> 
-<a class="jxr_linenumber" name="L803" href="#L803">803</a>                         line = reader.readLine();
-<a class="jxr_linenumber" name="L804" href="#L804">804</a>                     }
-<a class="jxr_linenumber" name="L805" href="#L805">805</a>                 }
-<a class="jxr_linenumber" name="L806" href="#L806">806</a>                 <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L807" href="#L807">807</a>                 {
-<a class="jxr_linenumber" name="L808" href="#L808">808</a>                     IOUtil.close( reader );
-<a class="jxr_linenumber" name="L809" href="#L809">809</a>                     IOUtil.close( r );
-<a class="jxr_linenumber" name="L810" href="#L810">810</a>                 }
-<a class="jxr_linenumber" name="L811" href="#L811">811</a>             }
-<a class="jxr_linenumber" name="L812" href="#L812">812</a>         }
-<a class="jxr_linenumber" name="L813" href="#L813">813</a> 
-<a class="jxr_linenumber" name="L814" href="#L814">814</a>         <em class="jxr_comment">// Copy extra site resources</em>
-<a class="jxr_linenumber" name="L815" href="#L815">815</a>         <strong class="jxr_keyword">if</strong> ( resourcesDirectory != <strong class="jxr_keyword">null</strong> &amp;&amp; resourcesDirectory.exists() )
-<a class="jxr_linenumber" name="L816" href="#L816">816</a>         {
-<a class="jxr_linenumber" name="L817" href="#L817">817</a>             copyDirectory( resourcesDirectory, outputDirectory );
-<a class="jxr_linenumber" name="L818" href="#L818">818</a>         }
-<a class="jxr_linenumber" name="L819" href="#L819">819</a> 
-<a class="jxr_linenumber" name="L820" href="#L820">820</a>         <em class="jxr_comment">// Check for the existence of /css/site.css</em>
-<a class="jxr_linenumber" name="L821" href="#L821">821</a>         File siteCssFile = <strong class="jxr_keyword">new</strong> File( outputDirectory, <span class="jxr_string">"/css/site.css"</span> );
-<a class="jxr_linenumber" name="L822" href="#L822">822</a>         <strong class="jxr_keyword">if</strong> ( !siteCssFile.exists() )
-<a class="jxr_linenumber" name="L823" href="#L823">823</a>         {
-<a class="jxr_linenumber" name="L824" href="#L824">824</a>             <em class="jxr_comment">// Create the subdirectory css if it doesn't exist, DOXIA-151</em>
-<a class="jxr_linenumber" name="L825" href="#L825">825</a>             File cssDirectory = <strong class="jxr_keyword">new</strong> File( outputDirectory, <span class="jxr_string">"/css/"</span> );
-<a class="jxr_linenumber" name="L826" href="#L826">826</a>             <strong class="jxr_keyword">boolean</strong> created = cssDirectory.mkdirs();
-<a class="jxr_linenumber" name="L827" href="#L827">827</a>             <strong class="jxr_keyword">if</strong> ( created &amp;&amp; getLogger().isDebugEnabled() )
-<a class="jxr_linenumber" name="L828" href="#L828">828</a>             {
-<a class="jxr_linenumber" name="L829" href="#L829">829</a>                 getLogger().debug(
-<a class="jxr_linenumber" name="L830" href="#L830">830</a>                     <span class="jxr_string">"The directory '"</span> + cssDirectory.getAbsolutePath() + <span class="jxr_string">"' did not exist. It was created."</span> );
-<a class="jxr_linenumber" name="L831" href="#L831">831</a>             }
-<a class="jxr_linenumber" name="L832" href="#L832">832</a> 
-<a class="jxr_linenumber" name="L833" href="#L833">833</a>             <em class="jxr_comment">// If the file is not there - create an empty file, DOXIA-86</em>
-<a class="jxr_linenumber" name="L834" href="#L834">834</a>             <strong class="jxr_keyword">if</strong> ( getLogger().isDebugEnabled() )
-<a class="jxr_linenumber" name="L835" href="#L835">835</a>             {
-<a class="jxr_linenumber" name="L836" href="#L836">836</a>                 getLogger().debug(
-<a class="jxr_linenumber" name="L837" href="#L837">837</a>                     <span class="jxr_string">"The file '"</span> + siteCssFile.getAbsolutePath() + <span class="jxr_string">"' does not exists. Creating an empty file."</span> );
-<a class="jxr_linenumber" name="L838" href="#L838">838</a>             }
-<a class="jxr_linenumber" name="L839" href="#L839">839</a>             Writer writer = <strong class="jxr_keyword">null</strong>;
-<a class="jxr_linenumber" name="L840" href="#L840">840</a>             <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L841" href="#L841">841</a>             {
-<a class="jxr_linenumber" name="L842" href="#L842">842</a>                 writer = WriterFactory.newWriter( siteCssFile, siteRenderingContext.getOutputEncoding() );
-<a class="jxr_linenumber" name="L843" href="#L843">843</a>                 <em class="jxr_comment">//DOXIA-290...the file should not be 0 bytes.</em>
-<a class="jxr_linenumber" name="L844" href="#L844">844</a>                 writer.write( <span class="jxr_string">"/* You can override this file with your own styles */"</span>  );
-<a class="jxr_linenumber" name="L845" href="#L845">845</a>             }
-<a class="jxr_linenumber" name="L846" href="#L846">846</a>             <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L847" href="#L847">847</a>             {
-<a class="jxr_linenumber" name="L848" href="#L848">848</a>                 IOUtil.close( writer );
-<a class="jxr_linenumber" name="L849" href="#L849">849</a>             }
-<a class="jxr_linenumber" name="L850" href="#L850">850</a>         }
-<a class="jxr_linenumber" name="L851" href="#L851">851</a>     }
-<a class="jxr_linenumber" name="L852" href="#L852">852</a> 
-<a class="jxr_linenumber" name="L853" href="#L853">853</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> copyFileFromZip( ZipFile file, ZipEntry entry, File destFile )
-<a class="jxr_linenumber" name="L854" href="#L854">854</a>             <strong class="jxr_keyword">throws</strong> IOException
-<a class="jxr_linenumber" name="L855" href="#L855">855</a>     {
-<a class="jxr_linenumber" name="L856" href="#L856">856</a>         FileOutputStream fos = <strong class="jxr_keyword">new</strong> FileOutputStream( destFile );
-<a class="jxr_linenumber" name="L857" href="#L857">857</a> 
-<a class="jxr_linenumber" name="L858" href="#L858">858</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L859" href="#L859">859</a>         {
-<a class="jxr_linenumber" name="L860" href="#L860">860</a>             IOUtil.copy( file.getInputStream( entry ), fos );
-<a class="jxr_linenumber" name="L861" href="#L861">861</a>         }
-<a class="jxr_linenumber" name="L862" href="#L862">862</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L863" href="#L863">863</a>         {
-<a class="jxr_linenumber" name="L864" href="#L864">864</a>             IOUtil.close( fos );
-<a class="jxr_linenumber" name="L865" href="#L865">865</a>         }
-<a class="jxr_linenumber" name="L866" href="#L866">866</a>     }
-<a class="jxr_linenumber" name="L867" href="#L867">867</a> 
-<a class="jxr_linenumber" name="L868" href="#L868">868</a>     <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L869" href="#L869">869</a> <em class="jxr_javadoccomment">     * Copy the directory</em>
-<a class="jxr_linenumber" name="L870" href="#L870">870</a> <em class="jxr_javadoccomment">     *</em>
-<a class="jxr_linenumber" name="L871" href="#L871">871</a> <em class="jxr_javadoccomment">     * @param source      source file to be copied</em>
-<a class="jxr_linenumber" name="L872" href="#L872">872</a> <em class="jxr_javadoccomment">     * @param destination destination file</em>
-<a class="jxr_linenumber" name="L873" href="#L873">873</a> <em class="jxr_javadoccomment">     * @throws java.io.IOException if any</em>
-<a class="jxr_linenumber" name="L874" href="#L874">874</a> <em class="jxr_javadoccomment">     */</em>
-<a class="jxr_linenumber" name="L875" href="#L875">875</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> copyDirectory( File source, File destination )
-<a class="jxr_linenumber" name="L876" href="#L876">876</a>             <strong class="jxr_keyword">throws</strong> IOException
-<a class="jxr_linenumber" name="L877" href="#L877">877</a>     {
-<a class="jxr_linenumber" name="L878" href="#L878">878</a>         <strong class="jxr_keyword">if</strong> ( source.exists() )
-<a class="jxr_linenumber" name="L879" href="#L879">879</a>         {
-<a class="jxr_linenumber" name="L880" href="#L880">880</a>             DirectoryScanner scanner = <strong class="jxr_keyword">new</strong> DirectoryScanner();
-<a class="jxr_linenumber" name="L881" href="#L881">881</a> 
-<a class="jxr_linenumber" name="L882" href="#L882">882</a>             String[] includedResources = {<span class="jxr_string">"**/**"</span>};
-<a class="jxr_linenumber" name="L883" href="#L883">883</a> 
-<a class="jxr_linenumber" name="L884" href="#L884">884</a>             scanner.setIncludes( includedResources );
-<a class="jxr_linenumber" name="L885" href="#L885">885</a> 
-<a class="jxr_linenumber" name="L886" href="#L886">886</a>             scanner.addDefaultExcludes();
-<a class="jxr_linenumber" name="L887" href="#L887">887</a> 
-<a class="jxr_linenumber" name="L888" href="#L888">888</a>             scanner.setBasedir( source );
-<a class="jxr_linenumber" name="L889" href="#L889">889</a> 
-<a class="jxr_linenumber" name="L890" href="#L890">890</a>             scanner.scan();
-<a class="jxr_linenumber" name="L891" href="#L891">891</a> 
-<a class="jxr_linenumber" name="L892" href="#L892">892</a>             List&lt;String&gt; includedFiles = Arrays.asList( scanner.getIncludedFiles() );
-<a class="jxr_linenumber" name="L893" href="#L893">893</a> 
-<a class="jxr_linenumber" name="L894" href="#L894">894</a>             <strong class="jxr_keyword">for</strong> ( String name : includedFiles )
-<a class="jxr_linenumber" name="L895" href="#L895">895</a>             {
-<a class="jxr_linenumber" name="L896" href="#L896">896</a>                 File sourceFile = <strong class="jxr_keyword">new</strong> File( source, name );
-<a class="jxr_linenumber" name="L897" href="#L897">897</a> 
-<a class="jxr_linenumber" name="L898" href="#L898">898</a>                 File destinationFile = <strong class="jxr_keyword">new</strong> File( destination, name );
-<a class="jxr_linenumber" name="L899" href="#L899">899</a> 
-<a class="jxr_linenumber" name="L900" href="#L900">900</a>                 FileUtils.copyFile( sourceFile, destinationFile );
-<a class="jxr_linenumber" name="L901" href="#L901">901</a>             }
-<a class="jxr_linenumber" name="L902" href="#L902">902</a>         }
-<a class="jxr_linenumber" name="L903" href="#L903">903</a>     }
-<a class="jxr_linenumber" name="L904" href="#L904">904</a> 
-<a class="jxr_linenumber" name="L905" href="#L905">905</a>     <strong class="jxr_keyword">private</strong> Reader validate( Reader source, String resource )
-<a class="jxr_linenumber" name="L906" href="#L906">906</a>             <strong class="jxr_keyword">throws</strong> ParseException, IOException
-<a class="jxr_linenumber" name="L907" href="#L907">907</a>     {
-<a class="jxr_linenumber" name="L908" href="#L908">908</a>         getLogger().debug( <span class="jxr_string">"Validating: "</span> + resource );
-<a class="jxr_linenumber" name="L909" href="#L909">909</a> 
-<a class="jxr_linenumber" name="L910" href="#L910">910</a>         <strong class="jxr_keyword">try</strong>
-<a class="jxr_linenumber" name="L911" href="#L911">911</a>         {
-<a class="jxr_linenumber" name="L912" href="#L912">912</a>             String content = IOUtil.toString( <strong class="jxr_keyword">new</strong> BufferedReader( source ) );
-<a class="jxr_linenumber" name="L913" href="#L913">913</a> 
-<a class="jxr_linenumber" name="L914" href="#L914">914</a>             <strong class="jxr_keyword">new</strong> XmlValidator( <strong class="jxr_keyword">new</strong> PlexusLoggerWrapper( getLogger() ) ).validate( content );
-<a class="jxr_linenumber" name="L915" href="#L915">915</a> 
-<a class="jxr_linenumber" name="L916" href="#L916">916</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> StringReader( content );
-<a class="jxr_linenumber" name="L917" href="#L917">917</a>         }
-<a class="jxr_linenumber" name="L918" href="#L918">918</a>         <strong class="jxr_keyword">finally</strong>
-<a class="jxr_linenumber" name="L919" href="#L919">919</a>         {
-<a class="jxr_linenumber" name="L920" href="#L920">920</a>             IOUtil.close( source );
-<a class="jxr_linenumber" name="L921" href="#L921">921</a>         }
-<a class="jxr_linenumber" name="L922" href="#L922">922</a>     }
-<a class="jxr_linenumber" name="L923" href="#L923">923</a> 
-<a class="jxr_linenumber" name="L924" href="#L924">924</a> }
+<a class="jxr_linenumber" name="L212" href="#L212">212</a>             fullExtension += <span class="jxr_string">".vm"</span>;
+<a class="jxr_linenumber" name="L213" href="#L213">213</a>             <strong class="jxr_keyword">for</strong> ( Iterator&lt;String&gt; it = velocityFiles.iterator(); it.hasNext(); )
+<a class="jxr_linenumber" name="L214" href="#L214">214</a>             {
+<a class="jxr_linenumber" name="L215" href="#L215">215</a>                 String name = it.next();
+<a class="jxr_linenumber" name="L216" href="#L216">216</a> 
+<a class="jxr_linenumber" name="L217" href="#L217">217</a>                 <strong class="jxr_keyword">if</strong> ( !endsWithIgnoreCase( name, fullExtension ) )
+<a class="jxr_linenumber" name="L218" href="#L218">218</a>                 {
+<a class="jxr_linenumber" name="L219" href="#L219">219</a>                     it.remove();
+<a class="jxr_linenumber" name="L220" href="#L220">220</a>                 }
+<a class="jxr_linenumber" name="L221" href="#L221">221</a>             }
+<a class="jxr_linenumber" name="L222" href="#L222">222</a>             docs.addAll( velocityFiles );
+<a class="jxr_linenumber" name="L223" href="#L223">223</a> 
+<a class="jxr_linenumber" name="L224" href="#L224">224</a>             <strong class="jxr_keyword">for</strong> ( String doc : docs )
+<a class="jxr_linenumber" name="L225" href="#L225">225</a>             {
+<a class="jxr_linenumber" name="L226" href="#L226">226</a>                 <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a> context =
+<a class="jxr_linenumber" name="L227" href="#L227">227</a>                         <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/maven/doxia/siterenderer/RenderingContext.html">RenderingContext</a>( moduleBasedir, doc, module.getParserId(), module.getExtension() );
+<a class="jxr_linenumber" name="L228" href="#L228">228</a> 
+<a class="jxr_linenumber" name="L229" href="#L229">229</a>                 <em class="jxr_comment">// TODO: DOXIA-111: we need a general filter here that knows how to alter the context</em>
+<a class="jxr_linenumber" name="L230" href="#L230">230</a>                 <strong class="jxr_keyword">if</strong> ( doc.substring( doc.length() - 3 ).equalsIgnoreCase( <span class="jxr_string">".vm"</span> ) )
+<a class="jxr_linenumber" name="L231" href="#L231">231</a>                 {

[... 706 lines stripped ...]


Mime
View raw message