cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: How to pass {ID} into protected, mounted sitemap?
Date Fri, 12 Jan 2007 17:18:52 GMT
Stan Dyck wrote:
> I've got an authenticating pipeline something like this:
> 
> <map:match pattern="*">
>     <map:act type="auth-protect">
>        <map:parameter name="handler" value="myhandler"/>
> 
>        <map:match pattern="protected">
>           <map:generate src="resource1.xml"/>
>           <map:transform src="resource2html.xsl">
>              <map:parameter name="uid" value="{ID}"/>
>           </map:transform>
>           <map:serialize/>
>        </map:match>
> 
>        <map:match pattern="subdir/**">
>           <map:mount uri-prefix="subdir" check-reload="yes"
>                      src="subdir/sitemap.xmap"/>
>        </map:match>
> 
>     </map:act>
> </map:match>
> 
> The idea is to protect a resource in a root directory and all the 
> resources in a mounted subdirectory. This works fine except for one 
> thing. If the sitemap in the subdir directory has something like this:
> 
> <map:match pattern="subprotect">
>     <map:generate src="subresource.xml"/>
>     <map:transform src="subresource2html.xsl">
>        <map:parameter name="uid" value="{ID}"/>
>     </map:transform>
>     <map:serialize/>
> </map:match>
> 
> I can't get the uid parameter to inject the login id into the 
> subresource2html.xsl stylesheet. Can someone help me out with this? What 
> do I need to do to pass the user id into a protected, mounted sitemap?
> 
The {ID} is only available within the "auth-protect" action in the
sitemap. The easiest way for you is to just repeat the action inside
your subsitemap to make the {ID} available:
> <map:match pattern="subprotect">
>     <map:act type="auth-protect">
>        <map:parameter name="handler" value="myhandler"/>
>     <map:generate src="subresource.xml"/>
>     <map:transform src="subresource2html.xsl">
>        <map:parameter name="uid" value="{ID}"/>
>     </map:transform>
>     <map:serialize/>
>   </map:act>
> </map:match>

HTH
Carsten
-- 
Carsten Ziegeler - Chief Architect
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

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


Mime
View raw message