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 18:47:46 UTC

accessing request parameters in sitemap

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>


Thanks,
-- 
Ovidiu Predescu <ov...@cup.hp.com>
http://www.geocities.com/SiliconValley/Monitor/7464/ (GNU, Emacs, other stuff)

---------------------------------------------------------------------
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 Vadim Gritsenko <va...@verizon.net>.
> From: Stuart Roebuck [mailto:stuart.roebuck@adolos.co.uk]
> 
> On Wednesday, February 13, 2002, at 12:46 pm, Marcus Crafter wrote:
> 
> > Hi Ovidiu,
> >
> > On Tue, Feb 12, 2002 at 09:47:46AM -0800, Ovidiu Predescu wrote:
> >
> >> 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>
> >
> > 	Parts of this is possible with the RequestParamAction. It would
> > 	need to be extended into a more general action to support
> > 	headers, session properties, etc and the syntax you've used
> > 	above, but the basics are there.
> >
> > 	Take a look at org.apache.cocoon.acting.RequestParamAction.
> 
> Am I right in saying that, in creating an action of this type, it is
best
> to limit the number of name,value pairs being made available as any
> differing value may be enough to prevent caching even if the value is
not
> used in the match?

Nope. Not used entries in the Map are *not used*. :)

Vadim

> 
> Stuart.


---------------------------------------------------------------------
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 Stuart Roebuck <st...@adolos.co.uk>.
On Wednesday, February 13, 2002, at 12:46 pm, Marcus Crafter wrote:

> Hi Ovidiu,
>
> On Tue, Feb 12, 2002 at 09:47:46AM -0800, Ovidiu Predescu wrote:
>
>> 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>
>
> 	Parts of this is possible with the RequestParamAction. It would
> 	need to be extended into a more general action to support
> 	headers, session properties, etc and the syntax you've used
> 	above, but the basics are there.
>
> 	Take a look at org.apache.cocoon.acting.RequestParamAction.

Am I right in saying that, in creating an action of this type, it is best 
to limit the number of name,value pairs being made available as any 
differing value may be enough to prevent caching even if the value is not 
used in the match?

Stuart.


            Public Key - 1024D/88DD65AF 2001-11-23 Stuart Roebuck (Adolos)
      Key fingerprint = 89D9 E405 F8B1 9B22 0FA2  F2C1 9E57 5AB1 88DD 65AF
-------------------------------------------------------------------------
Stuart Roebuck                                  stuart.roebuck@adolos.com
Systems Architect                             Java, XML, MacOS X, XP, etc.
ADOLOS                                           <http://www.adolos.com/>


---------------------------------------------------------------------
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 Marcus Crafter <cr...@fztig938.bank.dresdner.net>.
Hi Ovidiu,

On Tue, Feb 12, 2002 at 09:47:46AM -0800, Ovidiu Predescu wrote:
 
> 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>

	Parts of this is possible with the RequestParamAction. It would
	need to be extended into a more general action to support
	headers, session properties, etc and the syntax you've used
	above, but the basics are there.

	Take a look at org.apache.cocoon.acting.RequestParamAction.

	Cheers,

	Marcus

-- 
        .....
     ,,$$$$$$$$$,      Marcus Crafter
    ;$'      '$$$$:    Computer Systems Engineer
    $:         $$$$:   ManageSoft GmbH
     $       o_)$$$:   82-84 Mainzer Landstrasse
     ;$,    _/\ &&:'   60327 Frankfurt Germany
       '     /( &&&
           \_&&&&'
          &&&&.
    &&&&&&&:

---------------------------------------------------------------------
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 Vadim Gritsenko <va...@verizon.net>.
> 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.

PS: It might be that some matchers are missing. If you find a miss, tell
me.

Vadim



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