Colin Chalmers wrote:

> In order to keep Turbine properties and my application properties seperate I
> would like to have two property files. I've looked in the archives and am
> (almost) sure this is possible however I do have one or two questions.
> 
> 1. Is it indeed possible and can I have them both init at startup? Or do I
> have to init my own one seperately/"manually"?

The prefered option is to use share the ResourceService with Turbine.
This
means putting your own config settings into a file and including it into
the TR.properties. You must take care to avoid key clashes.

The other option is setting up a separate ResourceService of your own.
This is to say the least kludgy, but since you asked...

TurbineConfig tc = new
TurbineConfig(TurbineResources.getRealPath("/"),"/WEB-INF/conf/myown.properties");
TurbineResourceService myResources = new TurbineResourcesService();
myResources.init(tc);

... and now you can use myResources just as the TurbineResources.

Ugh. I just relized that the above code would mess up Turbine because of
the static servletConfig field
that Jason introduced into the base service... So that code wont acually
work right now, but it should
when we have the static's issue resolved.

> 2. I noticed in the Javadocs that TurbineConfig could be the correct way to
> go but is that not only for debugging?

TurbineConfig is intended for running Turbine outside the servlet
container environment (a standalone
console app, or supporting the EJB part of your J2EE app)

> 3. Is it possible to set/delete attributes in resource files? I see in
> TurbineConfig that these methods are not yet implemented.

Currently you can't set the config options at runtime. This is mainly
because
there is a problem with making the changes permanent.
ExtendendProperties can
have an option of writing the contents to a file, but this would
rearange
your settings (not sure if it would be alphabetically or hashcode-wise)
and 
strip all of the comments. Not good...

Rafal

--
Rafal Krzewski
Senior Internet Developer
mailto:[EMAIL PROTECTED]
+48 22 8534830 http://e-point.pl


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to