You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ovidiu Predescu <ov...@cup.hp.com> on 2002/02/12 20:12:41 UTC

Re: accessing request parameters in sitemap

On Tue, 12 Feb 2002 13:58:19 -0500, "Vadim Gritsenko" <va...@verizon.net> wrote:

> > From: ovidiu@orion.rgv.hp.com [mailto:ovidiu@orion.rgv.hp.com] On
> Behalf Of
> > 
> > Currently the sitemap has a syntax which allows referring to matching
> > portions of the URL. Is there a way to refer to request arguments,
> > headers or session related properties directly in the sitemap?
> > Something like this:
> > 
> > <map:match pattern="doc/**">
> >   <map:generate src="documents/{1}">
> >     <map:parameter name="type" value="{parameter(type)}"/>
> >     <map:parameter name="browser" value="{header(X-Browser)}"/>
> >   </map:generate>
> >   ...
> > </map:match>
> 
> It can look like (not exactly, that's the hint):
> 
> <map:match type="request-header" pattern="X-Browser">
>   <map:generate src="documents/xxx">
>     <map:parameter name="browser" value="{1}"/>
>   </map:generate>
>   ...
> </map:match>
> 
> Check out matching and selection packages.

Right, but with this approach, I match on a request header, when what
I want is to still match on the URL, but access various parts of the
request.

With your example, I instead match on the request-header, and invoke
the pipeline with it. What should be the xxx in the documents/xxx?

Thanks,
Ovidiu

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


Re: accessing request parameters in sitemap

Posted by Stefano Mazzocchi <st...@apache.org>.
Ovidiu Predescu wrote:
> 
> On Tue, 12 Feb 2002 13:58:19 -0500, "Vadim Gritsenko" <va...@verizon.net> wrote:
> 
> > > From: ovidiu@orion.rgv.hp.com [mailto:ovidiu@orion.rgv.hp.com] On
> > Behalf Of
> > >
> > > Currently the sitemap has a syntax which allows referring to matching
> > > portions of the URL. Is there a way to refer to request arguments,
> > > headers or session related properties directly in the sitemap?
> > > Something like this:
> > >
> > > <map:match pattern="doc/**">
> > >   <map:generate src="documents/{1}">
> > >     <map:parameter name="type" value="{parameter(type)}"/>
> > >     <map:parameter name="browser" value="{header(X-Browser)}"/>
> > >   </map:generate>
> > >   ...
> > > </map:match>
> >
> > It can look like (not exactly, that's the hint):
> >
> > <map:match type="request-header" pattern="X-Browser">
> >   <map:generate src="documents/xxx">
> >     <map:parameter name="browser" value="{1}"/>
> >   </map:generate>
> >   ...
> > </map:match>
> >
> > Check out matching and selection packages.
> 
> Right, but with this approach, I match on a request header, when what
> I want is to still match on the URL, but access various parts of the
> request.
> 
> With your example, I instead match on the request-header, and invoke
> the pipeline with it. What should be the xxx in the documents/xxx?

What about using nested matchers?

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



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