cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Knecht <fe...@otego.com>
Subject Re: Restructuring directory structure[was [Vote] Block artifact directory structure]
Date Mon, 06 Nov 2006 18:06:56 GMT
Carsten Ziegeler schrieb:
> Felix Knecht wrote:
>> The problem:
>>
>> As far as I've seen, sitemap element parser as well as settings element
>> parser do not respect CLI property settings ( -Dorg.apache.cocoon.mode=xxx).
>>
>> The duplication:
>> With my supposed patch the functions getSystemProperty(String key) and
>> getSystemProperty(String key, String defaultValue) are implemented
>> several times at different locations (I think to remember alsways as
>> protected).
>>
> Ok, I briefly looked at the current code (I have not looked at your
> patch yet). The current code is not the original (working) code. The old
> version did check the system property and the optional runningMode
> attribute of the cocoon:settings element in the applicationContext,
> both, in the settings element parser. And this was the only place where
> this checking occured.
> The sitemap element parser *always* gets the running mode set by the
> attribute runningMode. This is ensured by the SitemapHelper class which
> creates an in memory spring configuration containing the sitemap element.
> Apart from these two places, there shouldn't be any need to directly
> detect the running mode. All places should have access to the Settings
> bean which provides a method to get the current running mode.
> 
> Did I oversee any location?

In settings element parser you get 'null' as runningMode when {mode} is
 only a CLI parameter. So the bean include handle is not done correctly done

<snip>
 // handle includes
 try {
   this.handleBeanInclude(parserContext, null,
Constants.DEFAULT_SPRING_CONFIGURATION_LOCATION, "*.xml", true);
   this.handleBeanInclude(parserContext, null,
Constants.DEFAULT_SPRING_CONFIGURATION_LOCATION + "/" + runningMode,
"*.xml", true);
</snip>

Felix
> 
> Carsten
> 


Mime
View raw message