portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Sean Taylor" <da...@bluesunrise.com>
Subject RE: [VelocityPortlet] context differs in actionEvent from BuildNormalContext
Date Thu, 05 Dec 2002 17:12:56 GMT

> -----Original Message-----
> From: Luta, Raphael (VUN) [mailto:Raphael.Luta@groupvu.Com]
> Sent: Thursday, December 05, 2002 12:51 AM
> To: 'Jetspeed Developers List'
> Subject: RE: [VelocityPortlet] context differs in actionEvent from
> BuildNormalContext
>
>
> 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.
>
Ah yes, it always comes back to the same old issues with actions/getContent.

My vote is +0, since I believe we we can handle it better in future
releases, and I don't want to chance bringing any instability this close to
a release.
It won't break any of my code, but it may be possible that some users are
depending on the context sharing scenario you described.

David



--
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