You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Age Mooy <am...@home.nl> on 2002/03/12 15:12:27 UTC

[PATCH] passing applicationRoot and webappRoot variables to turbine-2 subsystems

Hi,

This patch passes the applicationRoot and webappRoot utility variables from Turbine to all loaded subsystems.
This makes it possible to use relative paths again in database urls (Hypersonic mostly) when using the
decoupled Torque with turbine-2.
I described the problem in my post to turbine-users titled "Using ${applicationRoot} in Torque.properties
(Torque-3.0-dev)"

Age


Index: Turbine.java
===================================================================
RCS file: /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
retrieving revision 1.10
diff -u -r1.10 Turbine.java
--- Turbine.java	8 Feb 2002 21:36:29 -0000	1.10
+++ Turbine.java	12 Mar 2002 13:58:28 -0000
@@ -857,9 +857,13 @@

                 Object sys = Class.forName(sysClassName).newInstance();

+                Configuration conf = new PropertiesConfiguration(sysConfig);
+
+                conf.setProperty(sysName + "." + APPLICATION_ROOT, applicationRoot);
+                conf.setProperty(sysName + "." + WEBAPP_ROOT,      webappRoot);
+
                 // configure subsystem using the defined config file
-                ((Configurable) sys).configure( (Configuration)
-                        new PropertiesConfiguration(sysConfig));
+                ((Configurable) sys).configure(conf);

                 // initialize subsystem
                 ((Initializable) sys).initialize();





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [PATCH] passing applicationRoot and webappRoot variables to turbine-2 subsystems

Posted by Jason van Zyl <jv...@zenplex.com>.
On Tue, 2002-03-12 at 09:12, Age Mooy wrote:
> 
> Hi,
> 
> This patch passes the applicationRoot and webappRoot utility variables from Turbine to all loaded subsystems.
> This makes it possible to use relative paths again in database urls (Hypersonic mostly) when using the
> decoupled Torque with turbine-2.
> I described the problem in my post to turbine-users titled "Using ${applicationRoot} in Torque.properties
> (Torque-3.0-dev)"

Thanks, we're redoing how the subsystems are loaded but I will
incorporate you patch when we get to it this week.
 
> Age
> 
> 
> Index: Turbine.java
> ===================================================================
> RCS file: /home/cvspublic/jakarta-turbine-2/src/java/org/apache/turbine/Turbine.java,v
> retrieving revision 1.10
> diff -u -r1.10 Turbine.java
> --- Turbine.java	8 Feb 2002 21:36:29 -0000	1.10
> +++ Turbine.java	12 Mar 2002 13:58:28 -0000
> @@ -857,9 +857,13 @@
> 
>                  Object sys = Class.forName(sysClassName).newInstance();
> 
> +                Configuration conf = new PropertiesConfiguration(sysConfig);
> +
> +                conf.setProperty(sysName + "." + APPLICATION_ROOT, applicationRoot);
> +                conf.setProperty(sysName + "." + WEBAPP_ROOT,      webappRoot);
> +
>                  // configure subsystem using the defined config file
> -                ((Configurable) sys).configure( (Configuration)
> -                        new PropertiesConfiguration(sysConfig));
> +                ((Configurable) sys).configure(conf);
> 
>                  // initialize subsystem
>                  ((Initializable) sys).initialize();
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>