portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luta, Raphael (VUN)" <Raphael.L...@groupvu.Com>
Subject RE: [VelocityPortlet] context differs in actionEvent from BuildNo rmalContext
Date Thu, 05 Dec 2002 08:51:00 GMT
De : David Sean Taylor [mailto:david@bluesunrise.com]
> 
> Velocity Portlet question:
> 
> Does anyone know why the context object is different in an 
> action event from
> the context object (for the same class) in the BuildNormalContext?

Yes, VelocityPortletAction lines 108-110 for the answer in code and
debug statements :)

> I would consider this a bug, but perhps there is a good 
> reason for it that I
> don't know about....
> 
> So if in my actionEvent:
> 
> context.put("foo", foo);
> 

The context you're using is a specially initialized one by the 
VelocityPortletAction. you could try using the default Turbine
context (using the VelcoityService.CONTEXT constant) *but* you
risk overriding global vars with your portlet specific info...

> and then in the BuildNormalContext:
> 
> String foo = context.get("foo");
> 

This context is retrieved by TurbineVelocity.getContext().

> Its not found, in fact the two context objects have different 
> object ids
> 

I agree that the current context mess is a bug and I have already some
patches available as part of the PortletTools implementation but changing
it now means that the context sharing semantics will change between
VelocityPortlet.

Easiest fix currently on the code base:
- change the VelocityPortletAction and VelocityPortlet to always the same
context using getTemplateContext() and use a js_peid context identifier.
For this to work with action_events, js_peid parameter must be provided
in the request since action_events are processed before the portlets are
available.

Impact of this is that context sharing between instances of the same 
portlet and between different portlets will be impossible and will *need*
to go through the StateManager or the HttpSession.

If there are enough +1 on this change, I can commit it today or tomorrow.

--
Raphaƫl Luta - raphael@apache.org
Jakarta Jetspeed - Enterprise Portal in Java
http://jakarta.apache.org/jetspeed/

--
To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>


Mime
View raw message