> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]