You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Nicole Hochleiter <ho...@seitenbau.com> on 2007/01/24 14:35:43 UTC

Extension of PropertiesFileModule

Hi,
I need to extend the PropertiesFileModule (in fact I already have implemented my
own Version of the class and use it). But I wonder if the community would like
to have this extension in the project:
instead of only reading one file to one name I read several files which can
contain the same properties and the last one in the list is taken.

This is interesting e.g. if you have a default.properties and a local.properties
file where in the default you can define the default values and if a local
installation needs to add specific properties or only specific values this can
be configured in the local.properties which overwrite the default.

Nicole


Re: Extension of PropertiesFileModule

Posted by Nicole Hochleiter <ho...@seitenbau.com>.
Mark Lundquist <lundquist.mark <at> gmail.com> writes:

> 
> 
[...] 
> Hi Nicole,
> 
> In terms of the current code base, for overriding one properties file 
> with another the most parsimonious solution is to instantiate a 
> ChainMetaModule in cocoon.xconf.  Declare it to chain two 
> PropertiesFileModule instances — first the one for local.properties, 
> then the one for default.properties.  No new classes required 
> 
> But maybe it will be felt that supporting multiple properties files in 
> a single output module is desirable — in that case, it might be better 
> to just enhance PropertiesFileModule rather than add an additional 
> class....?
> 
> cheers,
> —ml—
> 
> 
Hi Mark,
thanks for your answer and the hint with the ChainMetaModule. Since Cocoon is so
big you sometimes don't see, that it already has a solution for your problem,
like it is in my case. I didn't know the module and what it can do. But next
time I will look for existing solution or ask the mailing list first. :-)

Thanks,
Nicole




Re: Extension of PropertiesFileModule

Posted by Mark Lundquist <lu...@gmail.com>.
On Jan 24, 2007, at 5:35 AM, Nicole Hochleiter wrote:

> Hi,
> I need to extend the PropertiesFileModule (in fact I already have 
> implemented my
> own Version of the class and use it). But I wonder if the community 
> would like
> to have this extension in the project:
> instead of only reading one file to one name I read several files 
> which can
> contain the same properties and the last one in the list is taken.
>
> This is interesting e.g. if you have a default.properties and a 
> local.properties
> file where in the default you can define the default values and if a 
> local
> installation needs to add specific properties or only specific values 
> this can
> be configured in the local.properties which overwrite the default.

Hi Nicole,

In terms of the current code base, for overriding one properties file 
with another the most parsimonious solution is to instantiate a 
ChainMetaModule in cocoon.xconf.  Declare it to chain two 
PropertiesFileModule instances — first the one for local.properties, 
then the one for default.properties.  No new classes required :-)

But maybe it will be felt that supporting multiple properties files in 
a single output module is desirable — in that case, it might be better 
to just enhance PropertiesFileModule rather than add an additional 
class....?

cheers,
—ml—