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 Dan Moore <mo...@yahoo.com> on 2004/10/13 18:02:56 UTC

Re: dynamic title in portlet, solution

Hi folks,

What I ended up doing to get a dynamic title in my Jetspeed 1.5
portlets was:
1.  Setting any portlet with a dynamic title to have no titlebar.
2.  Hacking the controls/html/jetspeed.vm file into a top.vm and
bottom.vm
3.  Using #parse to include the top and bottom chunks into my template.
4.  Jetspeed calls getContent, and everything comes out of there,
including a title bar, but now we can affect that title bar's content.

This precludes certain functionality, like being able to close the
portlet or minimize it.  But we're disallowing that behaviour anyway. 

Sure, it's going to cause problems with the same information in both
places, but this was the easiest, cleanest way I could think of to fix
the issue.

Dan

--- Dan Moore <mo...@yahoo.com> wrote:

> More info below.
> 
> --- Dan Moore <mo...@yahoo.com> wrote:
> 
> > Hi,
> > 
> > I'm running Jetspeed 1.5.  Like some other folks, I have a need to
> > dynamically change the title of a portlet, based on information
> > passed
> > in to it.  I'm trying to write Velocity portlets, so all of the
> > information needed to set the title is obtained in the Action
> class,
> > in
> > the buildNormalContext() method.  I did some looking around on the
> > mailing list, and it appears that, due to the lifecycle of Jetspeed
> 1
> > portlets, this is not easy to do.
> > 
> > I found one post that seemed to help:
> >
>
http://nagoya.apache.org/eyebrowse/ReadMsg?listName=jetspeed-user@jakarta.apache.org&msgNo=1113
> > But, when implementing the proposed solution, it became clear to me
> > that VelocityPortlet.getContent() writes to output rather than
> > returning a String that can be stored as suggested in the above
> mail.
> > 
> > So, as I see it, the only way I can change the title, via the
> Action
> > class, is by:
> > 
> > 1.  Calling getContent twice in jetspeed.vm (which, will, if I
> don't
> > have a cached portlet, call buildNormalContent twice).  Surround
> the
> > first call with HTML comment characters so the user doesn't see it.
> 
> And this method doesn't work for me, because it breaks the
> Customizer. 
> (The Customizer apparently outputs HTML comment characters, which
> close
> the comment around the first call.)
> 
> Dan
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-user-help@jakarta.apache.org