You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Magnus Haraldsen Amundsen <Ma...@computas.com> on 2008/05/08 14:57:05 UTC

Problem with auth block

Hi,

 

I have a sitemap which contains the following element:

 

<map:match pattern="admin/emner/*">

        <map:act type="cauth-is-logged-in">

          <map:parameter name="application" value="Sublima"/>

          <map:call function="com.computas.sublima.app.controller.admin.TopicController">

            <map:parameter name="mode" value="emner"/>

            <map:parameter name="submode" value="{1}"/>

          </map:call>

        </map:act>

        <map:redirect-to uri="{request:contextPath}/login"/>

      </map:match>

 

My problem is that <map:parameter name="submode" value="{1}"/> always is an empty String --> ""

This appeared when I applied the authentication to the sitemap.

 

Any ideas?

 

Med vennlig hilsen 

Magnus Haraldsen Amundsen
Kunnskapsingeniør
Mobil: 920 95 243
Epost: magnus.amundsen@computas.com <ma...@computas.com>    
Web: www.computas.com <http://www.computas.com/> 

|  COMPUTAS SETTER KUNNSKAP I SYSTEM  |

Computas AS  Vollsveien 9, Postboks 482, 1327 Lysaker | Telefon: 6783 1000 | Faks: 6783 1001

 

 


IMPORTANT NOTICE:
This message may contain confidential information. 
If you have received this e-mail in error, do not use, copy or 
distribute it. Do not open any attachments. Delete it immediately from
your system and notify the sender promptly by e-mail that you 
have done so. Thank you.


Re: Problem with auth block

Posted by Carsten Ziegeler <cz...@apache.org>.
Magnus Haraldsen Amundsen schrieb:

> 
> <map:match pattern="admin/emner/*">
> 
>         <map:act type="cauth-is-logged-in">
> 
>           <map:parameter name="application" value="Sublima"/>
> 
>           <map:call 
> function="com.computas.sublima.app.controller.admin.TopicController">
> 
>             <map:parameter name="mode" value="emner"/>
> 
>             <map:parameter name="submode" value="{1}"/>
> 
>           </map:call>
> 
>         </map:act>
> 
>         <map:redirect-to uri="{request:contextPath}/login"/>
> 
>       </map:match>
> 
>  
> 
> My problem is that <map:parameter name="submode" value="{1}"/> always is 
> an empty String à “”
> 
> This appeared when I applied the authentication to the sitemap.
> 
>  
This is a common mistake :) The {1} refers to values provided by the 
"parent" of the call command, which is the action. But you want to 
access the value from the matcher which is one level above, so use 
{../1} instead.
There is a nicer way of doing this by giving a the match node a name, 
but I don't know the exact syntax out of my head.

Carsten

-- 
Carsten Ziegeler
cziegeler@apache.org

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