You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by John Bresnik <jb...@auditintegrity.com> on 2003/07/28 20:24:45 UTC

multiple request parameters? how to?

can't seem to find anything in the docs that talks about use more than one parameter in your URL - i.e.

http://localhost/mypage.html?param1=foo&param2=bar

how can i access foo *and* bar in my sitemap [pipeline]? thanks

Re: multiple request parameters? how to?

Posted by Tony Collen <co...@umn.edu>.
John Bresnik wrote:
>>Then in your sitemap, you can use {request-param:foo} or
> 
> {request-param:bar} to get the values for
> 
>>foo and bar as you previously described.
> 
> 
> hey thanks for the help, i appreciate it - one more thing, could elaborate
> on the preceeding example?
> 
> is this the correct sitemap syntax?
> 
>       <map:match pattern="test.pdf">
>          <map:request-parameter name="foo" value="{request-param:foo}"/>
>          <map:request-parameter name="bar"    value="{request-param:bar}"/>
>          <map:generate type="file"
> src="cocoon:/test.xml?foo={foo}&amp;bar={bar}"/>
>          <map:transform type="xslt-saxon" src="test.xsl"/>
>          <map:serialize type="fo2pdf"/>
>       </map:match>
> 


Nope., you use it directly inside the map:generate tag:

<map:match pattern="test.pdf">
   <map:generate type="file" 
src="cocoon:/test.xml?foo={request-param:foo}&amp;bar={request-param:bar}"/>
   <map:transform .../>
   <map:serialize .../>
</map:match>



Tony


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


Re: multiple request parameters? how to?

Posted by John Bresnik <jb...@auditintegrity.com>.
>Then in your sitemap, you can use {request-param:foo} or
{request-param:bar} to get the values for
>foo and bar as you previously described.

hey thanks for the help, i appreciate it - one more thing, could elaborate
on the preceeding example?

is this the correct sitemap syntax?

      <map:match pattern="test.pdf">
         <map:request-parameter name="foo" value="{request-param:foo}"/>
         <map:request-parameter name="bar"    value="{request-param:bar}"/>
         <map:generate type="file"
src="cocoon:/test.xml?foo={foo}&amp;bar={bar}"/>
         <map:transform type="xslt-saxon" src="test.xsl"/>
         <map:serialize type="fo2pdf"/>
      </map:match>

thanks

----- Original Message -----
From: "Tony Collen" <co...@umn.edu>
To: <us...@cocoon.apache.org>
Sent: Monday, July 28, 2003 12:19 PM
Subject: Re: multiple request parameters? how to?


> John Bresnik wrote:
> > thanks. do you have an example of it?
>
>
> Yep,
>
> In your WEB-INF/cocoon.xconf file, you probably have something like:
>
>    <input-modules>
>      ...
>      <component-instance
class="org.apache.cocoon.components.modules.input.RequestParameterModule"
> logger="core.modules.input" name="request-param"/>
>      ...
>    </input-modules>
>
>
> If this isn't there, add it. It might only be in 2.1 AFAIK.
>
> Then in your sitemap, you can use {request-param:foo} or
{request-param:bar} to get the values for
> foo and bar as you previously described.
>
>
> Note to self: document more inputmodules!
>
> Tony
>
>
> ---------------------------------------------------------------------
> 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


Re: multiple request parameters? how to?

Posted by Tony Collen <co...@umn.edu>.
John Bresnik wrote:
> thanks. do you have an example of it?


Yep,

In your WEB-INF/cocoon.xconf file, you probably have something like:

   <input-modules>
     ...
     <component-instance class="org.apache.cocoon.components.modules.input.RequestParameterModule" 
logger="core.modules.input" name="request-param"/>
     ...
   </input-modules>


If this isn't there, add it. It might only be in 2.1 AFAIK.

Then in your sitemap, you can use {request-param:foo} or {request-param:bar} to get the values for 
foo and bar as you previously described.


Note to self: document more inputmodules!

Tony


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


Re: multiple request parameters? how to?

Posted by John Bresnik <jb...@auditintegrity.com>.
thanks. do you have an example of it?

----- Original Message -----
From: "Tony Collen" <co...@umn.edu>
To: <us...@cocoon.apache.org>
Sent: Monday, July 28, 2003 11:55 AM
Subject: Re: multiple request parameters? how to?


> John Bresnik wrote:
> > can't seem to find anything in the docs that talks about use more than
one parameter in your URL - i.e.
> >
> > http://localhost/mypage.html?param1=foo&param2=bar
> >
> > how can i access foo *and* bar in my sitemap [pipeline]? thanks
> >
>
>
> Hi John,
>
> Try the request parameter input module:
>
>
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/in
put/RequestParameterModule.html
>
> I thought there was a page for it on the Wiki, but I can't find it.. just
shoot a message if you
> need help using it.
>
> Tony
>
>
> ---------------------------------------------------------------------
> 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


Re: multiple request parameters? how to?

Posted by Tony Collen <co...@umn.edu>.
John Bresnik wrote:
> can't seem to find anything in the docs that talks about use more than one parameter in your URL - i.e.
> 
> http://localhost/mypage.html?param1=foo&param2=bar
> 
> how can i access foo *and* bar in my sitemap [pipeline]? thanks
> 


Hi John,

Try the request parameter input module:

http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/modules/input/RequestParameterModule.html

I thought there was a page for it on the Wiki, but I can't find it.. just shoot a message if you 
need help using it.

Tony


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