Hello,

It would be great to set up swt file template path from a property file.

I send a patch for this one.

Thanks.

Youngho

Index: JGenRenderer.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-turbine-3/src/java/org/apache/turbine/pipeline/JGenRenderer.java,v
retrieving revision 1.4
diff -u -r1.4 JGenRenderer.java
--- JGenRenderer.java   9 Apr 2002 17:29:34 -0000       1.4
+++ JGenRenderer.java   4 Jun 2002 06:44:07 -0000
@@ -114,55 +114,57 @@
     {
         this.data = data;
     }
-    
+
     /**
-     * Process the request 
-     * 
+     * Process the request
+     *
      * @param target the filename of the template.
      * @throws TurbineException Any exception trown while processing will be
      *         wrapped into a TurbineException and rethrown.
      */
-    public void render( String target ) 
+    public void render( String target )
         throws TurbineException, IVException, IOException, ServletException
     {
         // This obviously can be improved.
-        String targetPath = Turbine.getRealPath( "/templates/swt/" + target );
-        
+        String targetPath = 
+Turbine.getConfiguration().getString("swt.templates.path") == null ?
+                                      Turbine.getRealPath( "/templates/swt/" + target 
+) :
+                                      
+Turbine.getConfiguration().getString("swt.templates.path") + target ;
+
         log.debug( "SWT to render: " + targetPath );
Index: TurbineResources.master
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-3/conf/master/TurbineResources.master,v
retrieving revision 1.15
diff -u -r1.15 TurbineResources.master
--- TurbineResources.master     17 Jan 2002 16:37:31 -0000      1.15
+++ TurbineResources.master     4 Jun 2002 06:46:37 -0000
@@ -162,7 +162,7 @@
 
 template.default = /Default
 template.default.extension = vm
-
+swt.templates.path=

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to