cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Fagerstrom <>
Subject Re: Difference between FOM_Session and REal Session?
Date Sat, 22 Jan 2005 14:35:54 GMT
I agree with that the behaviour is weird, but it is designed to be that 
way. What happens is that your data is always placed in the session data 
  in the servlet. But then the request object, session objects etc are 
placed in a different place if you use them from flow, comperd with how 
it is done in the rest of Cocoon. If you want to know all the details 
you can take a look at the setupView method in 
o.a.c.components.flow.javascript.fom.FOM_JavaScriptInterpreter and 

The flow embeds the request object etc in some kind of dynaic map which 
makes them more convinient to use from flow and from expression 
languages. Then the object are placed in special places in the object 
model. I.e. not the same as all other Cocoon components use. JXTG gets 
the objects that are used in $cocoon from these places, check the setup 
and setContext methods in the original JXTG for details.

The result of this is that when you use JXTG without flow, the $cocoon 
object is empty except for $cocoon.parameters. For back compatibility 
and for making it possible to use whithout flow there are some 
deprecated variables $request, $session etc that uses the non emebeded 
object from the objectmodel. You have to use these if you don't use flow.

In the refactored JXTG I use o.a.c.environment.FlowObjectModelHelper, 
that Carsten wrote. It gets the objects from the normal places in the 
objectmodel and does the dynamic map embeding and puts everything in 
$cocoon. By using this we get the same behaviour booth in the flow and 
non flow context.


oceatoon wrote:
> HI everyone 
> We are having weird effects poping up some structure questions about FOM and
> more precisly about FOM_session. I use Flow to put some data into
> cocoon.session.setAttribute("data",data) and retreive this easily from my
> jx file coming from flow. 
> Thinking this is part of a global session object, in this same JX page, I
> have a link calling a pipeline that opens another JX file this time coming
> from the pipeline my ${} doesn't work???  hmmm
> so I realise that the first cocoon.session isn't the global session I am
> looking for (that could be used from anywhere) but a FOM_session?? Is this
> correct?  
> I have a feeling this was made so that Flow(Rhino Flow Continuation) could
> work in it's own little context, the same for JX, but regular pipelines
> don't go that way ?? So I ask myself now, how am I going to be able to
> access my FOM_session(like a global session) data coming from pipeline
> calls, or how to set what I put into FOM-session into global session??
> I don't know much about the backend of FOM or Flow, so please excuse me if
> this is a bit pulled out of the hat;), but I'd like to understand the
> session structural difference between coming from Pipeline and from Flow.
> Could there be a link with another recently posted problem about
> cocoon.request in JX???
> Thanks for the thoughts
> Tibor

View raw message