incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From my...@apache.org
Subject svn commit: r1041046 - in /sling/trunk/contrib/scripting/velocity: pom.xml src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java
Date Wed, 01 Dec 2010 15:16:16 GMT
Author: mykee
Date: Wed Dec  1 15:15:37 2010
New Revision: 1041046

URL: http://svn.apache.org/viewvc?rev=1041046&view=rev
Log:
SLING-1882 Update Velocity Scripting to Velocity 1.7

Modified:
    sling/trunk/contrib/scripting/velocity/pom.xml
    sling/trunk/contrib/scripting/velocity/src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java

Modified: sling/trunk/contrib/scripting/velocity/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/velocity/pom.xml?rev=1041046&r1=1041045&r2=1041046&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/velocity/pom.xml (original)
+++ sling/trunk/contrib/scripting/velocity/pom.xml Wed Dec  1 15:15:37 2010
@@ -23,7 +23,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>9</version>
+        <version>10-SNAPSHOT</version>
         <relativePath>../../../parent/pom.xml</relativePath>
     </parent>
 
@@ -50,6 +50,10 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.felix</groupId>
+                <artifactId>maven-scr-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <extensions>true</extensions>
                 <configuration>
@@ -97,6 +101,16 @@
             <version>2.1.0</version>
         </dependency>
         <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+ 		<dependency>
+		    <groupId>org.apache.felix</groupId>
+		    <artifactId>org.apache.felix.scr.annotations</artifactId>
+		    <version>1.4.0</version>
+		</dependency>
+        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.scripting.api</artifactId>
             <version>2.1.0</version>
@@ -106,13 +120,9 @@
             <artifactId>servlet-api</artifactId>
         </dependency>
         <dependency>
-            <groupId>javax.jcr</groupId>
-            <artifactId>jcr</artifactId>
-        </dependency>
-        <dependency>
             <groupId>org.apache.velocity</groupId>
             <artifactId>velocity</artifactId>
-            <version>1.6.4</version>
+            <version>1.7</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: sling/trunk/contrib/scripting/velocity/src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java
URL: http://svn.apache.org/viewvc/sling/trunk/contrib/scripting/velocity/src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java?rev=1041046&r1=1041045&r2=1041046&view=diff
==============================================================================
--- sling/trunk/contrib/scripting/velocity/src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java
(original)
+++ sling/trunk/contrib/scripting/velocity/src/main/java/org/apache/sling/scripting/velocity/VelocityTemplatesScriptEngine.java
Wed Dec  1 15:15:37 2010
@@ -19,6 +19,7 @@ package org.apache.sling.scripting.veloc
 import java.io.Reader;
 import java.io.Writer;
 import java.util.Map;
+import java.util.Properties;
 
 import javax.script.Bindings;
 import javax.script.ScriptContext;
@@ -40,12 +41,13 @@ public class VelocityTemplatesScriptEngi
 
     public VelocityTemplatesScriptEngine(ScriptEngineFactory factory) {
         super(factory);
-
+        
         final ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {
 	        Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
 	        
 	        velocity = new VelocityEngine();
+	        
             velocity.init();
         } catch (Exception e) {
             throw new RuntimeException("Exception in Velocity.init() "
@@ -91,10 +93,9 @@ public class VelocityTemplatesScriptEngi
 	        Writer w = scriptContext.getWriter();
 	        try {
 	            velocity.evaluate(c, w, logTag, script);
-	            w.toString();
 	        } catch (Throwable t) {
 	            throw new ScriptException("Failure running script " + scriptName
-	                + ": " + t);
+	                + ": " + t + ", stack trace: " + t.getStackTrace() );
 	        }
 	    } finally {
 	    	Thread.currentThread().setContextClassLoader(oldClassLoader);



Mime
View raw message