cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Arbogast <sebastien.arbog...@gmail.com>
Subject Re: Authentication alternatives
Date Mon, 02 May 2005 06:23:41 GMT
> If you want to use the session framework, it's much more complicated..
> Here's an example on two wrappper functions to get and set a string in
> a path inside the session framework. Pay attention on two things: a
> session can have many diferent contexts (for different kind of data,
> etc.), and to locate data, you use xpath. If a context is not defined
> and you try to access to it, it'll throw an exception, so be careful.
> 
> function setData(path,value) {
>         var contextManager=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
>         var myContext;
>         if (contextManager.existsContext(site))
>                 myContext=contextManager.getContext("mycontext");
>         else myContext=contextManager.createContext("mycontext","","");
>         myContext.setAttribute(path,value);
>         cocoon.releaseComponent(contextManager);
> }

I'm trying to use Nacho's two wrapper functions but there is just one
thing I don't understand : what does the "site" parameter stand for in
call to contextManager.existsContext(site) ? Where does its value come
from ?

Thx in advance...

-- 
Sebastien ARBOGAST

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


Mime
View raw message