cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marco Rolappe" <m_rola...@web.de>
Subject AW: Meaning of Map parameter in resolverURI method (SourceResolver)
Date Wed, 25 Feb 2004 14:31:58 GMT
hi wouter,

see below...

> -----Ursprungliche Nachricht-----
> Von: users-return-63535-m_rolappe=web.de@cocoon.apache.org
> [mailto:users-return-63535-m_rolappe=web.de@cocoon.apache.org]Im
> Auftrag von Wouter.DERUYCK@cec.eu.int
> Gesendet: Mittwoch, 25. Februar 2004 15:10
> An: users@cocoon.apache.org
> Betreff: Meaning of Map parameter in resolverURI method (SourceResolver)
>
>
> Hello,
>
> In my own Action I have to implement the act method as below
>  public Map act(Redirector redirector, SourceResolver resolver,
>                  Map objectModel, String source, Parameters parameters) {
>
> On the resolver object that  is passed I can call the method :
>
> Source resolveURI(String location,  String base, Map parameters)
>
> I pass as a parameter location a cocoon pipeline URI   of the form
> "cocoon:/test".
>
>
> <map:match pattern="test">
>
> 	<map:generate src="test/dispatch.xsp"
> type="serverpages"></map:generate>
> 	<map:transform type="xslt" src="disp.xslt">
> 	</map:transform>
> 	<map:serialize type="text"/>
> 	</map:match>
>
> What is the meaning of the Map parameters  in the resolveURI

the parameters are specific to the code implementing the respective URI
scheme/protocol, e.g. credentials.

> method ?  Can I
> use this to pass parameters to my cocoon:/test pipeline ?

no, you can't.

> The final goal is to give parameters to the disp.xslt stylesheet
> defined in
> the test pipeline...don't know how to do this when using the resolveURI
> method inside an action.

pretty simple, just add you parameters as a query string to the cocoon:/
url, e.g. cocoon:/test?myparam1=foo&myparam2=bar

then, when invoking your xslt transform you can either:

	<map:transform type="xslt" src="disp.xslt">
		<map:parameter name="myparam1" value="{request-param:myparam1}"/>
		...
	</map:transform>

or:

	<map:transform type="xslt" src="disp.xslt">
		<map:parameter name="use-request-parameters" value="true"/>
	</map:transform>

in both cases you have to declare the params in your stylesheet, of course.

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


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


Mime
View raw message