-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wed, 23 Aug 2006, Leszek Gawron wrote:
Date: Wed, 23 Aug 2006 11:28:56 +0200
From: Leszek Gawron <[EMAIL PROTECTED]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: exposing cocoon 2.2 settings in jxtemplate object model
Carsten Ziegeler wrote:
Leszek Gawron schrieb:
> Carsten Ziegeler wrote:
> > Leszek Gawron schrieb:
> > > What do you think about exposing cocoon properties in jxtemplate
> > > via:
> > >
> > > ${cocoon.settings.getProperty( 'property-name' )}
> > > or
> > > ${cocoon.settings.propertyName}
> > >
> just to be sure: is this the proper way to obtain current Settings?
>
> final Settings settings =
> (Settings)EnvironmentHelper.getCurrentProcessor().getBeanFactory().getBean(Settings.ROLE);
>
Yes - you should check if getCurrentProcessor() returns null.
Done. Another question: I would like to expose Settings to template as map
(so we can loose that java like settings.getProperty() syntax). What I am
worried about is the fact that this map needs to be recreated for every
request. Maybe Settings could directly implement Map interface? Or if this
breaks the Settings interface design provide Settings.asMap() that is built
during settings reading and never more.
Just a general hint: don't generally extend classes if you cannot
control it's evolution as one day a new version of it might exposes more
than you'd like to handle.
- --
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
iD8DBQFE7GMlLNdJvZjjVZARAkhPAJwO+Anj8fZCEK17L2nWy/5pF4E2NACg0KMh
2wzZVv+xJwMVuLHUYs6/M9U=
=vdBa
-----END PGP SIGNATURE-----