af9803
From da397953bd73068c4ab8d219ec91e312fd3d5d55 Mon Sep 17 00:00:00 2001
af9803
From: Michael Simacek <msimacek@redhat.com>
af9803
Date: Mon, 6 Feb 2017 14:27:53 +0100
af9803
Subject: [PATCH 2/2] Remove dependency on velocity-tools
af9803
af9803
---
af9803
 .../doxia/siterenderer/DefaultSiteRenderer.java    | 58 +---------------------
af9803
 1 file changed, 2 insertions(+), 56 deletions(-)
af9803
af9803
diff --git a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
af9803
index c31688d..58058b3 100644
af9803
--- a/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
af9803
+++ b/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
af9803
@@ -76,31 +76,11 @@ import org.apache.maven.doxia.parser.module.ParserModuleNotFoundException;
af9803
 import org.apache.maven.doxia.siterenderer.sink.SiteRendererSink;
af9803
 import org.apache.maven.doxia.util.XmlValidator;
af9803
 import org.apache.velocity.Template;
af9803
+import org.apache.velocity.VelocityContext;
af9803
 import org.apache.velocity.context.Context;
af9803
 import org.apache.velocity.exception.ParseErrorException;
af9803
 import org.apache.velocity.exception.ResourceNotFoundException;
af9803
 import org.apache.velocity.exception.VelocityException;
af9803
-import org.apache.velocity.tools.Scope;
af9803
-import org.apache.velocity.tools.ToolManager;
af9803
-import org.apache.velocity.tools.config.ConfigurationUtils;
af9803
-import org.apache.velocity.tools.config.EasyFactoryConfiguration;
af9803
-import org.apache.velocity.tools.config.FactoryConfiguration;
af9803
-import org.apache.velocity.tools.generic.AlternatorTool;
af9803
-import org.apache.velocity.tools.generic.ClassTool;
af9803
-import org.apache.velocity.tools.generic.ComparisonDateTool;
af9803
-import org.apache.velocity.tools.generic.ContextTool;
af9803
-import org.apache.velocity.tools.generic.ConversionTool;
af9803
-import org.apache.velocity.tools.generic.DisplayTool;
af9803
-import org.apache.velocity.tools.generic.EscapeTool;
af9803
-import org.apache.velocity.tools.generic.FieldTool;
af9803
-import org.apache.velocity.tools.generic.LinkTool;
af9803
-import org.apache.velocity.tools.generic.LoopTool;
af9803
-import org.apache.velocity.tools.generic.MathTool;
af9803
-import org.apache.velocity.tools.generic.NumberTool;
af9803
-import org.apache.velocity.tools.generic.RenderTool;
af9803
-import org.apache.velocity.tools.generic.ResourceTool;
af9803
-import org.apache.velocity.tools.generic.SortTool;
af9803
-import org.apache.velocity.tools.generic.XmlTool;
af9803
 import org.codehaus.plexus.PlexusContainer;
af9803
 import org.codehaus.plexus.component.annotations.Component;
af9803
 import org.codehaus.plexus.component.annotations.Requirement;
af9803
@@ -481,41 +461,7 @@ public class DefaultSiteRenderer
af9803
      */
af9803
     protected Context createToolManagedVelocityContext( SiteRenderingContext siteRenderingContext )
af9803
     {
af9803
-        Locale locale = siteRenderingContext.getLocale();
af9803
-        String dateFormat = siteRenderingContext.getDecoration().getPublishDate().getFormat();
af9803
-
af9803
-        EasyFactoryConfiguration config = new EasyFactoryConfiguration( false );
af9803
-        config.property( "safeMode", Boolean.FALSE );
af9803
-        config.toolbox( Scope.REQUEST )
af9803
-            .tool( ContextTool.class )
af9803
-            .tool( LinkTool.class )
af9803
-            .tool( LoopTool.class )
af9803
-            .tool( RenderTool.class );
af9803
-        config.toolbox( Scope.APPLICATION ).property( "locale", locale )
af9803
-            .tool( AlternatorTool.class )
af9803
-            .tool( ClassTool.class )
af9803
-            .tool( ComparisonDateTool.class ).property( "format", dateFormat )
af9803
-            .tool( ConversionTool.class ).property( "dateFormat", dateFormat )
af9803
-            .tool( DisplayTool.class )
af9803
-            .tool( EscapeTool.class )
af9803
-            .tool( FieldTool.class )
af9803
-            .tool( MathTool.class )
af9803
-            .tool( NumberTool.class )
af9803
-            .tool( ResourceTool.class ).property( "bundles", new String[] { "site-renderer" } )
af9803
-            .tool( SortTool.class )
af9803
-            .tool( XmlTool.class );
af9803
-
af9803
-        FactoryConfiguration customConfig = ConfigurationUtils.findInClasspath( TOOLS_LOCATION );
af9803
-
af9803
-        if ( customConfig != null )
af9803
-        {
af9803
-            config.addConfiguration( customConfig );
af9803
-        }
af9803
-
af9803
-        ToolManager manager = new ToolManager( false, false );
af9803
-        manager.configure( config );
af9803
-
af9803
-        return manager.createContext();
af9803
+        return new VelocityContext();
af9803
     }
af9803
 
af9803
     /**
af9803
-- 
af9803
2.9.3
af9803