You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Martin Holmes <mh...@uvic.ca> on 2004/11/05 22:52:07 UTC

Authentication map problem

Hi there,

I'm trying to adapt the authentication-fw example for my own use, and 
I'm hitting a problem. The example uses only one file ("protected.xml"), 
which is defined explicitly in the sitemap match element. I'm trying to 
protect all the documents in a folder, like this:

<map:match pattern="test/*.htm">
         <map:act type="auth-protect">
           <map:parameter name="handler" value="demohandler"/>
           <map:generate src="test/{1}.xml"/>				
           <map:transform type="session"/>
           <map:transform src="stylesheets/simple-page2html.xsl"/>
           <map:transform type="encodeURL"/>
           <map:serialize type="xhtml"/>
         </map:act>
         <!-- something was wrong, redirect to login page -->
         <map:redirect-to uri="login"/>
       </map:match>

This code is adapted directly from the example match element, with just 
a few changes to accommodate my document type. When I try this, browsing 
to the url </authentication-fw/test/test.htm> after being authenticated, 
I get the following error:

org.apache.cocoon.ResourceNotFoundException: Resource not found.: 
org.apache.excalibur.source.SourceNotFoundException: 
file:/usr/local/jakarta-tomcat-5/webapps/cocoon/authentication-fw/test/.xml 
doesn't exist.

However, if I replace the "*" and {1} parameters with actual file names 
from the folder, everything works fine. Can anyone see why the wildcard 
matching would fail in this match element?

Cheers,
Martin


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


Re: Authentication map problem

Posted by Martin Holmes <mh...@uvic.ca>.
That did it! Many thanks indeed. Now I'll have to figure out what it 
means to put a path statement inside the parentheses -- I've never seen 
that before.

Cheers,
Martin

Ralph Goers wrote:
> Replace {1} with {../1}. The way you have it the sitemap is attempting to
> locate the file name in the map returned from the auth-protect action
> instead of from the * in the map:match.
> 
> Ralph
> 
> 
> Martin Holmes said:
> 
>>Hi there,
>>
>>I'm trying to adapt the authentication-fw example for my own use, and
>>I'm hitting a problem. The example uses only one file ("protected.xml"),
>>which is defined explicitly in the sitemap match element. I'm trying to
>>protect all the documents in a folder, like this:
>>
>><map:match pattern="test/*.htm">
>>         <map:act type="auth-protect">
>>           <map:parameter name="handler" value="demohandler"/>
>>           <map:generate src="test/{1}.xml"/>
>>           <map:transform type="session"/>
>>           <map:transform src="stylesheets/simple-page2html.xsl"/>
>>           <map:transform type="encodeURL"/>
>>           <map:serialize type="xhtml"/>
>>         </map:act>
>>         <!-- something was wrong, redirect to login page -->
>>         <map:redirect-to uri="login"/>
>>       </map:match>
>>
>>This code is adapted directly from the example match element, with just
>>a few changes to accommodate my document type. When I try this, browsing
>>to the url </authentication-fw> after being authenticated,
>>I get the following error:
>>
>>org.apache.cocoon.ResourceNotFoundException: Resource not found.:
>>org.apache.excalibur.source.SourceNotFoundException:
>>file:/usr/local/jakarta-tomcat-5/webapps/cocoon/authentication-fw/test/.xml
>>doesn't exist.
>>
>>However, if I replace the "*" and {1} parameters with actual file names
>>from the folder, everything works fine. Can anyone see why the wildcard
>>matching would fail in this match element?
>>
>>Cheers,
>>Martin
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>


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


Re: Authentication map problem

Posted by Ralph Goers <Ra...@dslextreme.com>.
Replace {1} with {../1}. The way you have it the sitemap is attempting to
locate the file name in the map returned from the auth-protect action
instead of from the * in the map:match.

Ralph


Martin Holmes said:
> Hi there,
>
> I'm trying to adapt the authentication-fw example for my own use, and
> I'm hitting a problem. The example uses only one file ("protected.xml"),
> which is defined explicitly in the sitemap match element. I'm trying to
> protect all the documents in a folder, like this:
>
> <map:match pattern="test/*.htm">
>          <map:act type="auth-protect">
>            <map:parameter name="handler" value="demohandler"/>
>            <map:generate src="test/{1}.xml"/>
>            <map:transform type="session"/>
>            <map:transform src="stylesheets/simple-page2html.xsl"/>
>            <map:transform type="encodeURL"/>
>            <map:serialize type="xhtml"/>
>          </map:act>
>          <!-- something was wrong, redirect to login page -->
>          <map:redirect-to uri="login"/>
>        </map:match>
>
> This code is adapted directly from the example match element, with just
> a few changes to accommodate my document type. When I try this, browsing
> to the url </authentication-fw> after being authenticated,
> I get the following error:
>
> org.apache.cocoon.ResourceNotFoundException: Resource not found.:
> org.apache.excalibur.source.SourceNotFoundException:
> file:/usr/local/jakarta-tomcat-5/webapps/cocoon/authentication-fw/test/.xml
> doesn't exist.
>
> However, if I replace the "*" and {1} parameters with actual file names
> from the folder, everything works fine. Can anyone see why the wildcard
> matching would fail in this match element?
>
> Cheers,
> Martin
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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