cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <>
Subject Re: [C2] Map passing through multiple levels
Date Wed, 07 Mar 2001 17:27:57 GMT
Klaasen Tom wrote:
> Hi,
> I'm trying to pull this off:
>    <map:match pattern="wimps/*">
>         <map:act type="parameter_select">
>                 <parameter name="lang"/>
>                 <parameter name="user"/>
>                 <parameter name="version"/>
>                 <map:match type="doctype" pattern="wepul">
>                         <map:generate type="wimps" src="{1}"/>
>                         <map:transform type="xslt"
> src="stylesheets/wimps/simple.xsl"/>
>                         <map:serialize type="html"/>
>                 </map:match>
>         </map:act>
>    </map:match>
> The question whether this "parameter_select" is the way to go aside, I want
> the {1} in <map:generate type="wimps" src="{1}"/> to translate in the * from
> <map:match pattern="wimps/*">. However, this doesn't work (because I've got
> a nested matcher). Is there a way that I can get access to the value of the
> * in this construct? Or do I have to put that {1} in the objectModel also
> and retrieve it in the generate step? That solution doesn't seem very
> attracting to me. Is there something like {../1}?
> About the parameter_select: this is a class inspired on the LangSelect
> action, but I tried to make it a bit more generic (it gets all parameters of
> the <parameter...> tags, not only the hard coded "lang" parameter). I'm
> still a bit unsecure whether this is a nice solution (it seems I've copied
> the selector behaviour, but with a construct that is much easier to
> implement).
> Thanks for your comments.

In my proprietary Navigation action, I have an action react to the source
parameter, i.e. modifying the action will permit you to do this:

<map:act type="parameter_select" src="{1}">
     <parameter name="lang"/>
     <parameter name="user"/>
     <parameter name="version"/>
     <map:match type="doctype" pattern="wepul">
           <map:generate type="wimps" src="{destination}"/>
           <map:transform type="xslt" src="stylesheets/wimps/simple.xsl"/>
           <map:serialize type="html"/>

The parameter_select Action will do something along the following:

actionMap.put("destination", source);
// .... Skip a few lines ....
return actionMap;

I use it for access control and such.

View raw message