You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Grzegorz Kossakowski <gr...@tuffmail.com> on 2007/10/24 22:58:34 UTC

Confusion about property-based beans configuration

Hello,

I'm just trying to use propertu-based configuration of Spring beans and I'm facing several problems.
First of all there is some confusion about correct syntax, at[1] there is information that syntax is
as follows:
my.special.beanName#property=somevalue

However, when taking a look at ExtendedPropertyOverrideConfigurer[2] class I see this comment:
 * Our version of the property override configurer which reads properties from
 * the Cocoon spring configuration directory. A property should have the
 * following format: {bean name}/{property name}={value}.

The question is: which syntax is correct?

Another one is about location of property files taken into account when updating beans' definitions.
  The mentioned page states that location is:
/META-INF/cocoon/spring

but I wonder how this relates to the block structure explained here[3]? At that page we can see that
default location for properties is:
/META-INF/cocoon/properties/


I'm little bit confused, could someone explain this inconsistency?

[1] http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/1.0/1312_1_1.html
[2]
http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
[3] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g4/1263.html

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

Re: Confusion about property-based beans configuration

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Carsten Ziegeler pisze:
> The javadoc is correct, "/" is used as the separator.

Thanks. I corrected docs.

> We distinguish between properties for configuring the application and
> overriding bean definitions. The first one uses
> /META-INF/cocoon/properties and all these values end up in the Settings
> object. The properties can be used throughout the whole application and
> references can occur in most configuration files like avalon configs,
> spring bean configs, sitemaps etc.
> 
> The bean override configuration is a special mechanism to override
> settings of beans. There we use all files from /META-INF/cocoon/spring
> to detect such things.
> 
> So we have a clear separation between these two issues.

Thanks for explanation! Everything works correctly now.

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

Re: Confusion about property-based beans configuration

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

Grzegorz Kossakowski schrieb:
> Hello,
> 
> I'm just trying to use propertu-based configuration of Spring beans and I'm facing several problems.
> First of all there is some confusion about correct syntax, at[1] there is information that syntax is
> as follows:
> my.special.beanName#property=somevalue
> 
> However, when taking a look at ExtendedPropertyOverrideConfigurer[2] class I see this comment:
>  * Our version of the property override configurer which reads properties from
>  * the Cocoon spring configuration directory. A property should have the
>  * following format: {bean name}/{property name}={value}.
> 
> The question is: which syntax is correct?
The javadoc is correct, "/" is used as the separator.

> 
> Another one is about location of property files taken into account when updating beans' definitions.
>   The mentioned page states that location is:
> /META-INF/cocoon/spring
> 
> but I wonder how this relates to the block structure explained here[3]? At that page we can see that
> default location for properties is:
> /META-INF/cocoon/properties/
> 
We distinguish between properties for configuring the application and
overriding bean definitions. The first one uses
/META-INF/cocoon/properties and all these values end up in the Settings
object. The properties can be used throughout the whole application and
references can occur in most configuration files like avalon configs,
spring bean configs, sitemaps etc.

The bean override configuration is a special mechanism to override
settings of beans. There we use all files from /META-INF/cocoon/spring
to detect such things.

So we have a clear separation between these two issues.

Carsten
> 
> I'm little bit confused, could someone explain this inconsistency?
> 
> [1] http://cocoon.apache.org/subprojects/configuration/1.0/spring-configurator/1.0/1312_1_1.html
> [2]
> http://svn.apache.org/repos/asf/cocoon/trunk/core/cocoon-configuration/cocoon-spring-configurator/src/main/java/org/apache/cocoon/spring/configurator/impl/ExtendedPropertyOverrideConfigurer.java
> [3] http://cocoon.zones.apache.org/daisy/cdocs/g1/g1/g4/1263.html
> 


-- 
Carsten Ziegeler
cziegeler@apache.org