You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by Ben Woodward <be...@bbc.co.uk> on 2003/08/12 15:06:28 UTC
Re: Change layout from default.vm to another
Hi there,
I've tried setting the layout both at the beginning of my portlet's
getContent and just before I return the ConcreteElement. Unfortunately
changing the layout here is not changing the velocity file I am using
when my content is rendered to screen.
Are the any methods that we can override to change the layout 'before
anything is written in the output stream'?
Also I was wandering what the difference between these two methods is.
rundata.setLayout("preview");
rundata.setLayoutTemplate("/html/preview.vm");
I suspect that they do the same thing, in which case, does setLayout
make an assumption that my velocity file is in
/WEB-INF/templates/vm/layouts/html/preview.vm?
Many thanks, Ben
On Tuesday, Jun 3, 2003, at 16:13 Europe/Dublin, Luta, Raphael (VUN)
wrote:
>
> You can use these Turbine features to change the layout "on the fly"
> between requests with one *major* caveat:
> if you keep the out of box settings of Jetspeed, you need to change
> your layout *before anything is written in the output stream*, which
> basically imposes you to do it at the Turbine Action level
> if you use Velocity, you can switch to the "buffered" Turbine mode
> which enables you to change layout later in the request processing
> but will prevent you from including JSPs into your portal.
>
> --
> Raphaël Luta - raphael@apache.org
> Jakarta Jetspeed - Enterprise Portal in Java
> http://jakarta.apache.org/jetspeed/
>
>> -----Message d'origine-----
>> De : Jeremy Ford [mailto:caius1440@hotmail.com]
>> Envoyé : mardi 3 juin 2003 04:55
>> À : jetspeed-dev@jakarta.apache.org
>> Objet : Change layout from default.vm to another
>>
>>
>> I was wondering how one could change the default layout from
>> default.vm to
>> another on the fly. Looking at the TurbineRunData, there are
>> 3 methods that
>> can change templates during execution.
>>
>> setLayout -- I have successfully used this. The only
>> drawback is that it
>> requires a class file to define the layout
>> setScreenTemplate -- changes the screen template, but still
>> uses the default
>> layout
>> setLayoutTemplate -- I have tried to use this, but I have
>> seen the layout
>> change
>>
>> I noticed the portlet preview in the customzier, and it does
>> change the
>> layout. As far as I can tell, it seems that you must have a
>> layout named
>> preview as well as a screen with the name of preview as well.
>>
>> Any insight would be appreciated.
>>
>> Jeremy Ford
>>
>> _________________________________________________________________
>> MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
>> http://join.msn.com/?page=features/virus
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>>
>
> **********************************************
> Vivendi Universal - HTTP://www.vivendiUniversal.com:
> The information transmitted is intended only for the person or entity
> to which it is addressed and may contain confidential and/or privileged
> material of Vivendi Universal which is for the exclusive use of the
> individual designated above as the recipient. Any review,
> retransmission,
> dissemination or other use of, or taking of any action in reliance
> upon,
> this information by persons or entities other than the intended
> recipient
> is prohibited. If you received this in error, please contact
> immediately
> the sender by returning e-mail and delete the material from any
> computer.
> If you are not the specified recipient, you are hereby notified that
> all
> disclosure, reproduction, distribution or action taken on the basis of
> this
> message is prohibited.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
>
BBCi at http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain
personal views which are not the views of the BBC unless specifically
stated.
If you have received it in error, please delete it from your system, do
not use, copy or disclose the information in any way nor act in
reliance on it and notify the sender immediately. Please note that the
BBC monitors e-mails sent or received. Further communication will
signify your consent to this.
Re: Change layout from default.vm to another
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Tuesday, August 12, 2003, at 06:06 AM, Ben Woodward wrote:
> Hi there,
>
> I've tried setting the layout both at the beginning of my portlet's
> getContent and just before I return the ConcreteElement. Unfortunately
> changing the layout here is not changing the velocity file I am using
> when my content is rendered to screen.
>
The layout specified in "rundata.setLayout" is not the layout used by
your Velocity template for your portlet.
It is the layout for the entire response. This is one example of where
Turbine is causing confusing semantics to the portlet developer.
At this point, in your getContent method for a portlet, it is too late
to change the layout for the entire Turbine response
> Are the any methods that we can override to change the layout 'before
> anything is written in the output stream'?
>
if you want to change the Turbine layout, set it from within the
Turbine page module, from an action or with a dynamic URL and redirect
> Also I was wandering what the difference between these two methods is.
>
> rundata.setLayout("preview");
> rundata.setLayoutTemplate("/html/preview.vm");
>
Look at the Turbine source.
They are slightly different.
Recommend using setLayoutTemplate
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646
+01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org
Re: Change layout from default.vm to another
Posted by David Sean Taylor <da...@bluesunrise.com>.
On Tuesday, August 12, 2003, at 06:06 AM, Ben Woodward wrote:
> Hi there,
>
> I've tried setting the layout both at the beginning of my portlet's
> getContent and just before I return the ConcreteElement. Unfortunately
> changing the layout here is not changing the velocity file I am using
> when my content is rendered to screen.
>
The layout specified in "rundata.setLayout" is not the layout used by
your Velocity template for your portlet.
It is the layout for the entire response. This is one example of where
Turbine is causing confusing semantics to the portlet developer.
At this point, in your getContent method for a portlet, it is too late
to change the layout for the entire Turbine response
> Are the any methods that we can override to change the layout 'before
> anything is written in the output stream'?
>
if you want to change the Turbine layout, set it from within the
Turbine page module, from an action or with a dynamic URL and redirect
> Also I was wandering what the difference between these two methods is.
>
> rundata.setLayout("preview");
> rundata.setLayoutTemplate("/html/preview.vm");
>
Look at the Turbine source.
They are slightly different.
Recommend using setLayoutTemplate
--
David Sean Taylor
Bluesunrise Software
david@bluesunrise.com
+01 707 773-4646
+01 707 529 9194