You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Vadim Gritsenko <va...@reverycodes.com> on 2006/12/11 21:54:29 UTC

Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Carsten Ziegeler wrote:
> Have a look at the core.properties file in the cocoon-core module. Just
> put a properties file with the appropriate configuration into
> WEB-INF/cocoon/properties. This should work.

Carsten,

Regarding loading of properties from WEB-INF - can you point out where this is 
done? In the code I can only see loading from META-INF; and I can not confirm 
that loading from WEB-INF is working.

Vadim

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Luca Morandini <lm...@ieee.org>.
Giacomo Pati wrote:
> 
> Carsten Ziegeler wrote:
>> Luca Morandini wrote:
>>> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
>>> was loaded after the "classpath:*" chain.
>>>
>> Yes, you're right. Hmm, perhaps we should load properties from
>> WEB-INF/classes last. I'll have a look at that as well.
> 
> Luca is absolutely right! WEB-INF/classes should be the last resort where one ultimatively can
> overwrite properties (same should be true for WEB-INF/classes/META-INF/cocoon/spring/.....)

Just to be absolutely clear: In my eyes 
WEB-INF/classes/META-INF/cocoon/properties should be used for block-wide 
property or cocoon defaults, and WEB-INF/cocoon/properties for 
project-wide properties.

I suppose most users would just put their properties under 
WEB-INF/cocoon and update the *.properties under 
WEB-INF/classes/META-INF only at their peril (a block update, or the 
adding of a block that happens to have a properties file starting with a 
  greater letter of the alphabet may ruin their day).

By the way, let's suppose I use block fooblock, which has a nice 
META-INF/cocoon/properties/fooblock.properties file tucked under its 
JAR: is fooblock.properties unzipped by default under 
WEB-INF/classes/META-INF so I can modify its properties ?

If so, what happens when there is another version of fooblock ? Is the 
properties file overwritten at installation (deploy) time ?

Sorry if the last questions seem so silly, but... "better safe than 
sorry" ;)

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Giacomo Pati <gi...@otego.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Carsten Ziegeler wrote:
> Luca Morandini wrote:
>> Remember to update the comments in the source code of 
>> SettingsBeanFactoryPostProcessor.java then, because they still state 
>> that WEB-INF/cocoon/properties is supported in the fall-back chain of 
>> properties loading.
>>
> Yepp, thanks for the info - I'll take care of it in the next days.
> 
> 
>> One issue, though: since the property loading mechanism uses 
>> "classpath:°" protocol, property files are read in alphabetical order, 
>> which means I might have my per-project properties ruined by the 
>> addition of a block, unless I call them zzzz.properties.
>>
>> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
>> was loaded after the "classpath:*" chain.
>>
> Yes, you're right. Hmm, perhaps we should load properties from
> WEB-INF/classes last. I'll have a look at that as well.

Luca is absolutely right! WEB-INF/classes should be the last resort where one ultimatively can
overwrite properties (same should be true for WEB-INF/classes/META-INF/cocoon/spring/.....)

Ciao

- --
Otego AG                                  Tel:   +41 (0)1  240 00 55
Giacomo Pati, CTO                         Mobile:+41 (0)79 262 21 04
Apache Software Foundation Member         Mailto:giacomo@apache.org
Hohlstrasse 216                           Mailto:Giacomo.Pati@otego.com
CH-8004 Zuerich                           http://www.otego.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFfsUNLNdJvZjjVZARAnF3AJ9dTgMEHqAYmj6vICLU0Q2b+ZfzVACfZvXH
pgNnuygo9oDrThYvuF7GYPg=
=Qdgc
-----END PGP SIGNATURE-----

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Vadim Gritsenko <va...@reverycodes.com>.
Mark Lundquist wrote:
> 
> On Dec 12, 2006, at 7:33 AM, Luca Morandini wrote:
> 
>> In truth, I don't find the use of "classes" for configuration stuff 
>> done outside JARs particularly intuitive...
> 
> +1

<me-too/>

Vadim


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Dec 12, 2006, at 7:33 AM, Luca Morandini wrote:

> In truth, I don't find the use of "classes" for configuration stuff 
> done outside JARs particularly intuitive...

+1
—ml—

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Luca Morandini <lm...@ieee.org>.
Ralph Goers wrote:
> 
> Luca Morandini wrote:
>>
>> So, the chain you propose is (sorted by order of loading):
>> 1) WEB-INF/classes/META-INF/cocoon/properties (block-wide stuff).
>> 2) WEB-INF/classes/cocoon/properties (project-wide stuf).
>>
>> In truth, I don't find the use of "classes" for configuration stuff 
>> done outside JARs particularly intuitive... I'd rather stick with 
>> WEB-INF/cocoon/properties. 
> One more level is needed which is already in the 2.1 branch (and I 
> thought 2.2). The system property org.apache.cocoon.settings points to 
> the directory where properties can be found.  In our environment we 
> never touch stuff inside war or ear files, especially since they might 
> not be exploded.

If you take a look at the comments in SettingsBeanFactoryPostProcessor 
source code, you'll find that plenty of configuration options are 
provided, and I think Cocoon should stick to that plan rather than 
dropping the WEB-INF/classes/cocoon/properties option.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Carsten Ziegeler <cz...@apache.org>.
Ralph Goers schrieb:
> 
> Luca Morandini wrote:
>> So, the chain you propose is (sorted by order of loading):
>> 1) WEB-INF/classes/META-INF/cocoon/properties (block-wide stuff).
>> 2) WEB-INF/classes/cocoon/properties (project-wide stuf).
>>
>> In truth, I don't find the use of "classes" for configuration stuff 
>> done outside JARs particularly intuitive... I'd rather stick with 
>> WEB-INF/cocoon/properties. 
> One more level is needed which is already in the 2.1 branch (and I 
> thought 2.2). The system property org.apache.cocoon.settings points to 
> the directory where properties can be found.  In our environment we 
> never touch stuff inside war or ear files, especially since they might 
> not be exploded.
> 
This is supported in 2.2 as well, but "org.apache.cocoon.settings" is
pointing to a file rather than a directory.

Carsten
-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Ralph Goers <Ra...@dslextreme.com>.

Luca Morandini wrote:
>
> So, the chain you propose is (sorted by order of loading):
> 1) WEB-INF/classes/META-INF/cocoon/properties (block-wide stuff).
> 2) WEB-INF/classes/cocoon/properties (project-wide stuf).
>
> In truth, I don't find the use of "classes" for configuration stuff 
> done outside JARs particularly intuitive... I'd rather stick with 
> WEB-INF/cocoon/properties. 
One more level is needed which is already in the 2.1 branch (and I 
thought 2.2). The system property org.apache.cocoon.settings points to 
the directory where properties can be found.  In our environment we 
never touch stuff inside war or ear files, especially since they might 
not be exploded.

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Luca Morandini <lm...@ieee.org>.
Carsten Ziegeler wrote:
> Luca Morandini schrieb:
>> Carsten Ziegeler wrote:
>>> Luca Morandini wrote:
>>>>
>>>> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
>>>> was loaded after the "classpath:*" chain.
>>>>
>>> Yes, you're right. Hmm, perhaps we should load properties from
>>> WEB-INF/classes last. I'll have a look at that as well.
>> Last ? Hmm... I'm not sure I got you point.
>>
> Yepp, the properties system works in the way that the last definition
> wins. And this means that project-wide stuff has to be loaded last.

So, the chain you propose is (sorted by order of loading):
1) WEB-INF/classes/META-INF/cocoon/properties (block-wide stuff).
2) WEB-INF/classes/cocoon/properties (project-wide stuf).

In truth, I don't find the use of "classes" for configuration stuff done 
outside JARs particularly intuitive... I'd rather stick with 
WEB-INF/cocoon/properties.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Carsten Ziegeler <cz...@apache.org>.
Luca Morandini schrieb:
> Carsten Ziegeler wrote:
>> Luca Morandini wrote:
>>
>>> One issue, though: since the property loading mechanism uses 
>>> "classpath:°" protocol, property files are read in alphabetical order, 
>>> which means I might have my per-project properties ruined by the 
>>> addition of a block, unless I call them zzzz.properties.
>>>
>>> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
>>> was loaded after the "classpath:*" chain.
>>>
>> Yes, you're right. Hmm, perhaps we should load properties from
>> WEB-INF/classes last. I'll have a look at that as well.
> 
> Last ? Hmm... I'm not sure I got you point.
> Anyway, what I meant is that I'd like to have a way to load project-wide 
> properties that cannot be overridden by block-wide ones.
> 
Yepp, the properties system works in the way that the last definition
wins. And this means that project-wide stuff has to be loaded last.

Carsten
-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Luca Morandini <lm...@ieee.org>.
Carsten Ziegeler wrote:
> Luca Morandini wrote:
> 
>> One issue, though: since the property loading mechanism uses 
>> "classpath:°" protocol, property files are read in alphabetical order, 
>> which means I might have my per-project properties ruined by the 
>> addition of a block, unless I call them zzzz.properties.
>>
>> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
>> was loaded after the "classpath:*" chain.
>>
> Yes, you're right. Hmm, perhaps we should load properties from
> WEB-INF/classes last. I'll have a look at that as well.

Last ? Hmm... I'm not sure I got you point.
Anyway, what I meant is that I'd like to have a way to load project-wide 
properties that cannot be overridden by block-wide ones.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Carsten Ziegeler <cz...@apache.org>.
Luca Morandini wrote:
> 
> Remember to update the comments in the source code of 
> SettingsBeanFactoryPostProcessor.java then, because they still state 
> that WEB-INF/cocoon/properties is supported in the fall-back chain of 
> properties loading.
>
Yepp, thanks for the info - I'll take care of it in the next days.


> One issue, though: since the property loading mechanism uses 
> "classpath:°" protocol, property files are read in alphabetical order, 
> which means I might have my per-project properties ruined by the 
> addition of a block, unless I call them zzzz.properties.
> 
> This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
> was loaded after the "classpath:*" chain.
> 
Yes, you're right. Hmm, perhaps we should load properties from
WEB-INF/classes last. I'll have a look at that as well.

Thanks
Carsten

-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Luca Morandini <lm...@ieee.org>.
Carsten Ziegeler wrote:
> Giacomo Pati wrote:
>>> This raises the question if we need this? I think we should readd the
>>> support for reading properties from WEB-INF/cocoon/properties.
>> IIRC we mentioned putting those into
>>
>> WEB-INF/classes/META-INF/cocoon/properties
>>
> Yes, you're absolutely right! This brings back my memory :)
> 
> So, there is no need for WEB-INF/cocoon/properties.

Remember to update the comments in the source code of 
SettingsBeanFactoryPostProcessor.java then, because they still state 
that WEB-INF/cocoon/properties is supported in the fall-back chain of 
properties loading.

One issue, though: since the property loading mechanism uses 
"classpath:°" protocol, property files are read in alphabetical order, 
which means I might have my per-project properties ruined by the 
addition of a block, unless I call them zzzz.properties.

This was neatly solved by the use of WEB-INF/cocoon/properties, since it 
was loaded after the "classpath:*" chain.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Carsten Ziegeler <cz...@apache.org>.
Giacomo Pati wrote:
> 
>> This raises the question if we need this? I think we should readd the
>> support for reading properties from WEB-INF/cocoon/properties.
> 
> IIRC we mentioned putting those into
> 
> WEB-INF/classes/META-INF/cocoon/properties
> 
Yes, you're absolutely right! This brings back my memory :)

So, there is no need for WEB-INF/cocoon/properties.

Thanks!
Carsten

-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Giacomo Pati <gi...@otego.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



Carsten Ziegeler wrote:
> Vadim Gritsenko wrote:
>> Carsten Ziegeler wrote:
>>> Have a look at the core.properties file in the cocoon-core module. Just
>>> put a properties file with the appropriate configuration into
>>> WEB-INF/cocoon/properties. This should work.
>> Carsten,
>>
>> Regarding loading of properties from WEB-INF - can you point out where this is 
>> done? In the code I can only see loading from META-INF; and I can not confirm 
>> that loading from WEB-INF is working.
>>
> You're right - it's gone :(
> 
> This raises the question if we need this? I think we should readd the
> support for reading properties from WEB-INF/cocoon/properties.

IIRC we mentioned putting those into

WEB-INF/classes/META-INF/cocoon/properties

Ciao

- --
Otego AG                                  Tel:   +41 (0)1  240 00 55
Giacomo Pati, CTO                         Mobile:+41 (0)79 262 21 04
Apache Software Foundation Member         Mailto:giacomo@apache.org
Hohlstrasse 216                           Mailto:Giacomo.Pati@otego.com
CH-8004 Zuerich                           http://www.otego.com

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFfoHlLNdJvZjjVZARAjBzAKDR7gLtREAykC1UfdCEDCkzsQjqTgCeLw++
SrMExCpuPx1fpUGTejD9yhY=
=C7y3
-----END PGP SIGNATURE-----

Re: Cocoon Properties, Re: Cocoon 2.2 Samples Setting MultipartFilter Max Upload Size

Posted by Carsten Ziegeler <cz...@apache.org>.
Vadim Gritsenko wrote:
> Carsten Ziegeler wrote:
>> Have a look at the core.properties file in the cocoon-core module. Just
>> put a properties file with the appropriate configuration into
>> WEB-INF/cocoon/properties. This should work.
> 
> Carsten,
> 
> Regarding loading of properties from WEB-INF - can you point out where this is 
> done? In the code I can only see loading from META-INF; and I can not confirm 
> that loading from WEB-INF is working.
> 
You're right - it's gone :(

This raises the question if we need this? I think we should readd the
support for reading properties from WEB-INF/cocoon/properties.

WDAT?

Carsten
-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/