roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r593995 - in /roller/trunk/sandbox/scripting/groovy: ./ src/org/apache/roller/scripting/
Date Mon, 12 Nov 2007 00:18:20 GMT
Author: snoopdave
Date: Sun Nov 11 16:18:19 2007
New Revision: 593995

URL: http://svn.apache.org/viewvc?rev=593995&view=rev
Log:
Making Groovy and GSP renderers work with 4.0

Modified:
    roller/trunk/sandbox/scripting/groovy/ant.properties
    roller/trunk/sandbox/scripting/groovy/build.xml
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRenderer.java
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRendererFactory.java
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRenderer.java
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRendererFactory.java
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRollerBinding.java
    roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRunner.java

Modified: roller/trunk/sandbox/scripting/groovy/ant.properties
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/ant.properties?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/ant.properties (original)
+++ roller/trunk/sandbox/scripting/groovy/ant.properties Sun Nov 11 16:18:19 2007
@@ -1,2 +1,4 @@
-rollersrc.dir=../../..
-groovy.home=/Applications/Java/groovy
\ No newline at end of file
+
+tools.dir=../../../tools
+rollersrc.dir=../../../apps/weblogger
+groovy.home=/Applications/Java/groovy

Modified: roller/trunk/sandbox/scripting/groovy/build.xml
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/build.xml?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/build.xml (original)
+++ roller/trunk/sandbox/scripting/groovy/build.xml Sun Nov 11 16:18:19 2007
@@ -6,9 +6,15 @@
         
     <path id="scripting.path">
         <fileset dir="${rollersrc.dir}/build/webapp/WEB-INF/lib">   
-            <include name="roller-web.jar"/>   
+            <include name="roller-core.jar"/>   
             <include name="roller-business.jar"/>   
-            <include name="commons-logging.jar"/>   
+            <include name="roller-web.jar"/>   
+        </fileset>
+        <fileset dir="${tools.dir}/lib">   
+            <include name="commons-logging-1.0.4.jar"/>   
+        </fileset>
+        <fileset dir="${tools.dir}/openjpa-0.9.7">   
+            <include name="openjpa-0.9.7-incubating.jar"/>   
         </fileset>
         <fileset dir="${groovy.home}/lib">
             <include name="groovy-1.0.jar"/>

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRenderer.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRenderer.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRenderer.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRenderer.java
Sun Nov 11 16:18:19 2007
@@ -26,9 +26,10 @@
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.pojos.Template;
-import org.apache.roller.ui.rendering.Renderer;
-import org.apache.roller.ui.rendering.RenderingException;
+import org.apache.roller.weblogger.pojos.Template;
+import org.apache.roller.weblogger.pojos.WeblogTemplate;
+import org.apache.roller.weblogger.ui.rendering.Renderer;
+import org.apache.roller.weblogger.ui.rendering.RenderingException;
 
 /**
  * Renderer that compiles/executes Roller Template as a Groovy Template.
@@ -45,10 +46,10 @@
 public class GSPRenderer implements Renderer {
     private static Log log = LogFactory.getLog(GroovletRenderer.class);
     private groovy.text.Template groovyTemplate = null;   
-    private Template template = null;
+    private WeblogTemplate template = null;
     private Exception parseException = null;
     
-    public GSPRenderer(TemplateEngine templateEngine, Template template) {
+    public GSPRenderer(TemplateEngine templateEngine, WeblogTemplate template) {
         this.template = template;
         try {
             // TODO: implement caching for compiled templates

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRendererFactory.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRendererFactory.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRendererFactory.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GSPRendererFactory.java
Sun Nov 11 16:18:19 2007
@@ -22,9 +22,10 @@
 import groovy.text.TemplateEngine;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.pojos.Template;
-import org.apache.roller.ui.rendering.Renderer;
-import org.apache.roller.ui.rendering.RendererFactory;
+import org.apache.roller.weblogger.pojos.Template;
+import org.apache.roller.weblogger.pojos.WeblogTemplate;
+import org.apache.roller.weblogger.ui.rendering.Renderer;
+import org.apache.roller.weblogger.ui.rendering.RendererFactory;
 
 /**
  * RendererFactory that handles Groovy Server Page (GSP) style templates 
@@ -39,9 +40,9 @@
         if(template.getTemplateLanguage() == null || template.getId() == null) {
             return null;
         }
-        if("gsp".equals(template.getTemplateLanguage())) {
+        if("gsp".equals(template.getTemplateLanguage()) && template instanceof WeblogTemplate)
{
             try {
-                renderer = new GSPRenderer(templateEngine, template); 
+                renderer = new GSPRenderer(templateEngine, (WeblogTemplate)template); 
             } catch(Exception ex) {
                 return null;
             }

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRenderer.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRenderer.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRenderer.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRenderer.java
Sun Nov 11 16:18:19 2007
@@ -25,9 +25,9 @@
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.pojos.Template;
-import org.apache.roller.ui.rendering.Renderer;
-import org.apache.roller.ui.rendering.RenderingException;
+import org.apache.roller.weblogger.pojos.WeblogTemplate;
+import org.apache.roller.weblogger.ui.rendering.Renderer;
+import org.apache.roller.weblogger.ui.rendering.RenderingException;
 
 /**
  * Renderer that evaluates Roller Template as Groovy script.
@@ -44,9 +44,9 @@
  */
 public class GroovletRenderer implements Renderer {
     private static Log log = LogFactory.getLog(GroovletRenderer.class);
-    private Template template = null;
+    private WeblogTemplate template = null;
     
-    public GroovletRenderer(Template template) {
+    public GroovletRenderer(WeblogTemplate template) {
         this.template = template;
     }
     

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRendererFactory.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRendererFactory.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRendererFactory.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovletRendererFactory.java
Sun Nov 11 16:18:19 2007
@@ -20,9 +20,10 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.pojos.Template;
-import org.apache.roller.ui.rendering.Renderer;
-import org.apache.roller.ui.rendering.RendererFactory;
+import org.apache.roller.weblogger.pojos.Template;
+import org.apache.roller.weblogger.pojos.WeblogTemplate;
+import org.apache.roller.weblogger.ui.rendering.Renderer;
+import org.apache.roller.weblogger.ui.rendering.RendererFactory;
 
 /**
  * RendererFactory that handles Groovlet-style templates w/language name "groovlet"
@@ -35,9 +36,9 @@
         if(template.getTemplateLanguage() == null || template.getId() == null) {
             return null;
         }        
-        if("groovlet".equals(template.getTemplateLanguage())) {             
+        if("groovlet".equals(template.getTemplateLanguage()) && template instanceof
WeblogTemplate) {             
             try {
-               renderer = new GroovletRenderer(template);
+               renderer = new GroovletRenderer((WeblogTemplate)template);
             } catch(Exception ex) {
                 return null;
             }                        

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRollerBinding.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRollerBinding.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRollerBinding.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRollerBinding.java
Sun Nov 11 16:18:19 2007
@@ -25,7 +25,7 @@
 import java.util.Map;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.roller.ui.rendering.model.UtilitiesModel;
+import org.apache.roller.weblogger.ui.rendering.model.UtilitiesModel;
 
 /**
  * Binds Roller model objects along with Groovlet and GSP style "out" and "html" variables.

Modified: roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRunner.java
URL: http://svn.apache.org/viewvc/roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRunner.java?rev=593995&r1=593994&r2=593995&view=diff
==============================================================================
--- roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRunner.java
(original)
+++ roller/trunk/sandbox/scripting/groovy/src/org/apache/roller/scripting/GroovyRunner.java
Sun Nov 11 16:18:19 2007
@@ -23,7 +23,7 @@
 
 import java.io.File;
 import groovy.lang.*;
-import org.apache.roller.util.*;
+import org.apache.roller.weblogger.util.*;
 
 /**
  * Setup Roller classloader and run a Groovy script



Mime
View raw message