cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist ...@wrinkledog.com>
Subject Re: Properties file
Date Thu, 16 Jun 2005 19:22:26 GMT
Hi Chris,

On Jun 16, 2005, at 7:20 AM, Chris Marasti-Georg wrote:

>  Any ideas on getting these values from a .properties file into the  
> sitemap?

Yeah.  Try this...

1) Edit  WEB-INF/cocoon.xconf; find the <input-modules> section, and  
add something like this:

	<component-instance
			name="foobar-properties"
			 
class="org.apache.cocoon.components.modules.input.PropertiesFileModule"
			logger="core.modules.input"
		>
		<file src="foobar.properties" />
	</component-instance>

(note, you can have more than one instance, for different property  
files)

2) Then, in the sitemap you can use:

	{foobar-properties:someProperty}

to get the property value.

Try this...

	<map:component-configurations>
		<global-variables>
			<some-property>{foobar-properties;someProperty}</some-property>
			<another-property>{foobar-properties:anotherProperty}</another- 
property>
		</global-variables>
	</map:component-configurations>

...to localize the properties interface to one place, and then let the  
rest of your sitemap(s) use the values as regular sitemap globals  
without having to worry about where the values came from:

	{global:some-property}

Have fun,
—ml—


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message