You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kenneth Petersen <Co...@epetersen.dk> on 2001/10/30 14:03:43 UTC

Cocoon2 : Selector using parameter from request.

I would like to use a parameter from the request to determine what xml-file to view. Without being sure, I think that the "parameter"-selector (org.apache.cocoon.selection.ParameterSelectorFactory) from the Cocoon SiteMap can be used for this. As a test I have written the following matcher:

   <map:match pattern="test/*">
	<map:select type="parameter">
		<map:parameter name="parameter-selector-test" value="XXXX"/>		
		<map:when test="condition1">
			<map:generate src="cocoon:/vo-form/nameForPerson/Jan/default/1"/>
		</map:when>
		<map:otherwise>
			<map:generate src="cocoon:/vo-form/nameForPerson/Jan/part/1"/>
		</map:otherwise>
	</map:select>
	<map:serialize type="xml"/>
   </map:match>

What I would like is to be able to pass a parameter from the request instead of value="XXXX". How do I accomplish this?


Best regards
KP

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: Cocoon2 : Selector using parameter from request.

Posted by Eduardo Godoy Vega <eg...@mail.tekchile.cl>.
Maybe this code can help you!
Here "Count" is an action Parameter ...

    <map:match pattern="process-unveil">
	<map:act type="unveil-it">
		<map:parameter name="UnveilServer" value="kioto"/>
			<map:select type="parameter">
				<map:parameter name="parameter-selector-test" value="{Count}"/>
				<map:when test="0">
				<map:generate type="serverpages" src="count0.xsp">
					<map:parameter name="use-request-parameters" value="true"/>
				</map:generate>
				</map:when>
				....
			</map:select>

Eduardo.
-----Original Message-----
From: Kenneth Petersen [mailto:Cocoon2@epetersen.dk]
Sent: Tuesday, October 30, 2001 9:04 AM
To: users
Subject: Cocoon2 : Selector using parameter from request.


I would like to use a parameter from the request to determine what xml-file
to view. Without being sure, I think that the "parameter"-selector
(org.apache.cocoon.selection.ParameterSelectorFactory) from the Cocoon
SiteMap can be used for this. As a test I have written the following
matcher:

   <map:match pattern="test/*">
	<map:select type="parameter">
		<map:parameter name="parameter-selector-test" value="XXXX"/>
		<map:when test="condition1">
			<map:generate src="cocoon:/vo-form/nameForPerson/Jan/default/1"/>
		</map:when>
		<map:otherwise>
			<map:generate src="cocoon:/vo-form/nameForPerson/Jan/part/1"/>
		</map:otherwise>
	</map:select>
	<map:serialize type="xml"/>
   </map:match>

What I would like is to be able to pass a parameter from the request instead
of value="XXXX". How do I accomplish this?


Best regards
KP

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>