You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Chris Kimpton <ki...@yahoo.com> on 2001/08/31 18:56:39 UTC
Re: How do I set the portlet title - in the portlet?
Hi,
--- Rapha�l Luta <ra...@networks.groupvu.com> 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?
Thanks for any insights,
Chris
=====
Need somewhere to Live in London - http://freeflats.com
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org
Re: How do I set the portlet title - in the portlet?
Posted by Raphaël Luta <ra...@networks.groupvu.com>.
Chris Kimpton wrote:
> Hi,
>
> --- Raphaël Luta <ra...@networks.groupvu.com> 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 - raphael.luta@networks.groupvu.com
Vivendi Universal Networks - Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org