Chris Kimpton wrote:
> Hi,
>
> --- Rapha�l Luta <[EMAIL PROTECTED]> wrote:
>
>>
>>Chris Kimpton wrote:
>>
>>It all depends on when do you try to set up the title:
>>- if it's during the the getContent() call, then it depends on the
>>control implementation
>> because if getContent is only called when needed, the portlet
>>title is already rendered...
>> If you're using on Velocity, you can modify the control template
>>to do something like
>> this :
>>
>>#if( ! $portlet.isClosed($data) )
>>#set ($content = $portlet.getContent($data))
>>
>
> I have code like the above in my jetspeed.vm and have just switched
> to the latest jetspeed code from CVS - I am getting a problem where
> the first portlet has the content displayed before the title, but
> then the remainding portlets are displayed correctly.
>
> Could this be a velocity problem - something to do with the #set
> command?
>
This is related to the JSP inside Velocity fix: since JSP always stream
their response and it's not possible to intercept their response in servlet
2.2 environments; the default behavior for VelocityPortlet is now
to stream its response directly.
You can simply subclass VelocityPortlet.java to VelocityBufferedPortlet.java,
copy getContent() and patch it this way:
151c151
< TurbineVelocity.handleRequest(context, templatePath, rundata.getOut());
---
> s = TurbineVelocity.handleRequest(context, templatePath);
You can then use the VelocityBufferedPortlet as the parent for your portlets that
require this title manipulation and keep the base VelocityPortlet for the others
(especially the Customization portlets that need the streaming features to work).
--
Raphael Luta - [EMAIL PROTECTED]
Vivendi Universal Networks - Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]