cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Pietschmann" <dev.sen...@gmail.com>
Subject Accessing BrowserSelector results from an Action
Date Thu, 31 Mar 2005 19:19:39 GMT
I'll try to keep it as short as possible:

Say you have a BrowserSelector in your Sitemap:

<map:selector name="renderer"
src="org.apache.cocoon.selection.BrowserSelector"
logger="sitemap.selector.browser">
	<browser name="desktop" useragent="MSIE 6.0"/>
	<browser name="desktop" useragent="Gecko"/>
	<browser name="pocketcolor" useragent="PPC"/>
	<browser name="mobile" useragent="OPWV-SDK"/>	
	[...]
</map:selector>

Furthermore there's an action which does something, depending on what the
browser is.
At the moment I'm using the selector in the sitemap, to tell my action which
browser is currently requesting:
		
<map:select type="browser">
	<map:when test="desktop">
		<map:act type="updateModel">
			<map:parameter name="format" value="xHTML"/>
		</map:act>
	</map:when>
	<map:when test="pocketcolor">
		<map:act type="updateModel">
			<map:parameter name="format" value="cHTML"/>
		</map:act>
	</map:when>
	<map:when test="pocket">
		<map:act type="updateModel">
			<map:parameter name="format" value="cHTML"/>
		</map:act>
	</map:when>
	[...]
</map:select>

Well, instead of passing a different parameter value for each case it would
be much easier for me if I could save this map:select, just specify my
action once and somehow access the BrowserSelector value from within my
Action.

How can I access the values the BrowserSelector has chosen?

Cheers,
Stefan




Mime
View raw message