cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Johnston <coc...@lojjic.net>
Subject Re: "auth-protect" not defined for "act"
Date Sun, 09 Apr 2006 21:26:12 GMT
Peter Flynn wrote:
> Andrew Stevens wrote:
> [me]
>>> I did the default build, so I had assumed Yes. How would I recognise it?
>>
>> Well, for starters, there'll be a cocoon-authentication-fw-block.jar
>> in build/webapp/WEB-INF/lib...
> 
> That's there:
> 
> $ locate cocoon-authentication-fw-block.jar
> /usr/src/cocoon-2.1.8/build/webapp/WEB-INF/lib/cocoon-authentication-fw-block.jar
> 
> /usr/local/apache-tomcat-5.5.12/webapps/ROOT/WEB-INF/lib/cocoon-authentication-fw-block.jar
> 
> $
> 
> So the authentication-fw block must have been selected for inclusion.
> Unfortunately it doesn't mean anything to me as I don't speak Java.
> But presumably it means that the relevant bits and pieces *are* present
> in the build, so I can use them, if I can find some document which tells
> me which ones are needed and what they're called, right?

Confirming the .jar file exists only shows that the various code
components (Actions, Generators, etc.) are available.  You still have to
make sure that your configuration files (cocoon.xconf, sitemap.xmap) are
set up to make use of those components.

> 
> And Bruno Dumon wrote:
> [me]
>>> I tried
>>>
>>>   <map:action name="auth-protect"
>>>   src="org.apache.cocoon.webapps.authentication.acting.ProtectAction"/>
> [...]
>>
>> Just guessing class names isn't very effective indeed ;-)
> 
> No, alas. Naming them after the action they perform would be far
> too easy :-)
> 
>> One way to know what exists is of course to check the source code.
> 
> Only relevant, alas, if you speak Java.

Not necessarily so; see below.

>> Another way is to go to here:
>> http://cocoon.zones.apache.org/daisy/documentation/facetedBrowser/default
>>
>> and choose "authentication-fw" for CocoonBlock and "Action" for
>> CocoonComponentReference, and this should show you a list of all
>> actions in the authentication framework.
> 
> Which unfortunately confirms my suspicion that there is no definition
> for auth-protect [yet]. If you do as above, the only four listed are
> AuthAction, LoggedInAction, LoginAction, and LogoutAction. The doc
> at http://cocoon.apache.org/2.1/developing/webapps/authentication.html
> describes very clearly the existence of a <map:act type="auth-protect">
> which appears to be fundamental to the authentication framework, but
> which causes a fatal error if you try to use it.

I've never used the authentication framework, but from looking at the
source code it appears the "auth-protect" action type is typically
mapped to the AuthAction class.  Here are the action definitions
distributed with the authentication-fw block:

<map:action name="auth-protect"
src="org.apache.cocoon.webapps.authentication.acting.AuthAction"/>
<map:action name="auth-login"
src="org.apache.cocoon.webapps.authentication.acting.LoginAction"/>
<map:action name="auth-logout"
src="org.apache.cocoon.webapps.authentication.acting.LogoutAction"/>
<map:action name="auth-loggedIn"
src="org.apache.cocoon.webapps.authentication.acting.LoggedInAction"/>

Note that to find this I didn't have to "speak Java" at all.  I just
browsed into src/blocks/authentication-fw/conf, and looked at the files
in that directory; the snippet above is pasted straight out of
authentication-act.xmap.  The files in that directory define the
configuration values that are normally added to cocoon.xconf and
sitemap.xmap when the block is built.  You'll need to make sure they
have been added to your versions of those files, since it seems yours
are out of sync.

--Jason

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


Mime
View raw message