cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Stevens" <>
Subject RE: Using variables in sitemap component parameter
Date Sun, 06 May 2007 21:45:23 GMT
>From: "Bas Suverkropp PC" <>
>To: <>

More a query for the user list, I'd have thought...

>Subject: Using variables in sitemap component parameter
>Date: Thu, 3 May 2007 13:56:34 +0200
>I am trying to make my sitemap environment-independent, with local 
>parameters read from
>a properties file (
>Unfortunately, using properties does not seem to work in the components 
>I want to replace
><map:transformer name="mail" 
>src="nl.kluwer.cocoon.transformation.HtmlMailTransformer" >
>	<smtphost></smtphost>
>	<smtpport>25</smtpport>
>	<from-address></from-address>
>with something like
><map:transformer name="mail" 
>src="nl.kluwer.cocoon.transformation.HtmlMailTransformer" >
>	<smtphost>{assembly:smtphost}</smtphost>
>	<smtpport>{assembly:smtpport}</smtpport>
>	<from-address>{assembly:from}</from-address>
>Any suggestions?

You didn't say which version of Cocoon you're using.  With the latest 2.2 
stuff, I believe the intended method is that you include all different 
versions of the configurations in your .war file and specify a "running 
mode" in a system property to tell Cocoon which set to use.  With 2.1.x, 
what I've done in the past is to use an external XML entity file rather than 
a properties file, include it in the relevant place with e.g.

<!DOCTYPE map:sitemap [
<!ENTITY emailsettings SYSTEM "emailsettings.ent">
<map:transformer name="mail" 
src="nl.kluwer.cocoon.transformation.HtmlMailTransformer" >

and let the parser do the work.  The .ent file contains the markup and 
settings to include inside the map:transformer; .ent (XMLSpy's default for 
external entities) rather than .xml as this probably won't be a well-formed 
XML document, but you could name it anything you like.
The only down side I found was that editing the settings file required a 
restart of the application before the changes would take effect (but that 
may vary depending on which app server you're using).

--  Open source java Sudoku application.

Reserve your place in history - Email Britain!

View raw message