cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Philippe Guillard <pguill...@citycita.net>
Subject [AuthFW] authentication/ID from Java code
Date Fri, 25 Mar 2005 05:00:37 GMT
Hi all,

I found this wiki:  http://wiki.apache.org/cocoon/AuthFWWithFlow, tried 
this in an action to get thie ID of the user in the Portal, added the 
import statements that seem to be needed :

......
import org.apache.cocoon.webapps.session.SessionManager;
import org.apache.cocoon.components.*;

public class auth extends ServiceableAction implements ThreadSafe {
   
    public Map act(Redirector redirector, SourceResolver resolver,
            Map objectModel, String src, Parameters par) throws Exception {

            org.apache.avalon.framework.component.ComponentManager 
componentManager = CocoonComponentManager.getSitemapComponentManager();
            SessionManager sessionManager = 
(SessionManager)componentManager.lookup(org.apache.cocoon.webapps.session.SessionManager.ROLE);
            String user = sessionManager.getContextFragment( 
"authentication", "/authentication/ID").getFirstChild().getNodeValue();
            
Eclipse says : "CocoonComponentManager cannot be resolved".  I can't 
find why. My knowledge in Java is still poor...(cocoon 2.1.6rls)

Somebody can help ?

Another related question : I use Portal so it uses Authentication 
Framwork anyway, but until now i was adding some attributes with Java 
Session object, just because it is easier for mee to get that parameters 
in java actions. Is there something wrong with this practice ?
It looks like this in authentication part:
        <ID>userName</ID>
            <role>guest</role>
        <data><!-- i don't use it</data>
        <xsp-session:set-attribute 
name="foo"><xsp:expr>foo</xsp:expr></xsp-session:set-attribute>


Regards,

Phil

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


Mime
View raw message