You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Dave <re...@leader-bg.com> on 2002/01/26 00:59:10 UTC

multiple sub-screens in a portal like environment

I am new to Turbine/Velocity. I looked in the docs and in the list archive, 
but did not find the information I am looking for.

What I am trying to do is an app that would have a screen, customizable by 
the user, that will display multiple sub-screens. As an example, let's take 
http://finance.yahoo.com/

On the same screen, there are many sections, for example Market Summary, 
Business News Headlines, and so on. Let's say each of those sections is a 
separate Velocity screen with a separate SubScreen.vm and SubScreen.class. 
The user should be able to select the sub-screens he wants, which means the 
screen has to be built dynamically. Is such a setup possible with 
Turbine/Velocity?

Another similar question, with Navigations, can each navigation template 
instantiate its own Java class to provide the data?

Thanks in advance for your answers!

Dave

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: multiple sub-screens in a portal like environment

Posted by John McNally <jm...@collab.net>.
Jason van Zyl wrote:
> 
> On 1/25/02 8:21 PM, "John McNally" <jm...@collab.net> wrote:
> 
> > In turbine-2 the first was not easily possible, though one java class
> > per template was standard.
> >
> > In turbine-3 the layout of the page is completely configurable, it seems
> > it is not possible to have a java class per template.
> 
> What do you mean java class per template? You mean being able to have a
> module execute for any given screen, navigation or layout template?
> 
> If that's not working I'll add a test and get it working again.
> 

Earlier the renderer executed a Module prior to rendering a template, so
a java class was always run prior to rendering a template.  This led to
an annoying behavior in that the screen module was executed twice.  As
it had already been run previously in order to make sure the
isAuthorized method was called.

I had suggested moving the isAuthorized call out of the doBuild method
so that it could be called independently.  Then isAuthorized would be
called on the Module corresponding to the target template prior to any
templates being rendered.  The renderer would still execute the Module
method responsible for building the context (build, doBuild,
doBuildTemplate, not sure exactly which one off the top of my head). 
You stated you would prefer that the isAuthorized be separated from the
Module all together and that there be a (pluggable?) policy service of
some sort that would handle that duty.  So I left things as they were
until I, you, or someone else could implement this.

Mike in the mean time went with a different solution to the double
execution of the target Module and separated the jobs of running the
module and rendering the template and added a new class, Runner, to do
the former and left the Renderer with only the latter.  

So now in a template, you could do (code below may not be 100% accurate,
but this is the idea)

$runner.run("navigations/LeftNav.vm")
$renderer.render("navigations/LeftNav.vm")

$renderer.render($target)


So you could still execute a module prior to rendering a template, but
you had to explicitly request that it be done and you did not need to do
so for the target template because that was always done before any
rendering started.

Now the $runner is not added to the context by the default valves, so
one will have to write their own valve to have the ability to run
modules from within a template.

Maybe we could provide a default PushRenderer that recombined the the
ability to have a Module automatically executed prior to rendering a
template.  Or just add the Runner back to the context.  Not sure.  Or
maybe I have just missed it and this ability still exists?

john mcnally

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: multiple sub-screens in a portal like environment

Posted by Jason van Zyl <jv...@zenplex.com>.
On 1/25/02 8:21 PM, "John McNally" <jm...@collab.net> wrote:

> In turbine-2 the first was not easily possible, though one java class
> per template was standard.
> 
> In turbine-3 the layout of the page is completely configurable, it seems
> it is not possible to have a java class per template.

What do you mean java class per template? You mean being able to have a
module execute for any given screen, navigation or layout template?

If that's not working I'll add a test and get it working again.

> It was
> originally, but I think that has been removed.  I am of the opinion that
> it should be an option that is available as an valve the comes with
> turbine.  In turbine-3 it is quite easy to use a valve that does what
> you need.  This part of turbine-3 is undergoing redesign.



> john mcnally
> 
> Dave wrote:
>> 
>> I am new to Turbine/Velocity. I looked in the docs and in the list archive,
>> but did not find the information I am looking for.
>> 
>> What I am trying to do is an app that would have a screen, customizable by
>> the user, that will display multiple sub-screens. As an example, let's take
>> http://finance.yahoo.com/
>> 
>> On the same screen, there are many sections, for example Market Summary,
>> Business News Headlines, and so on. Let's say each of those sections is a
>> separate Velocity screen with a separate SubScreen.vm and SubScreen.class.
>> The user should be able to select the sub-screens he wants, which means the
>> screen has to be built dynamically. Is such a setup possible with
>> Turbine/Velocity?
>> 
>> Another similar question, with Navigations, can each navigation template
>> instantiate its own Java class to provide the data?
>> 
>> Thanks in advance for your answers!
>> 
>> Dave
>> 
>> --
>> To unsubscribe, e-mail:
>> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
>> <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- 

jvz.

Jason van Zyl

http://tambora.zenplex.org
http://jakarta.apache.org/turbine
http://jakarta.apache.org/velocity
http://jakarta.apache.org/alexandria
http://jakarta.apache.org/commons



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: multiple sub-screens in a portal like environment

Posted by John McNally <jm...@collab.net>.
In turbine-2 the first was not easily possible, though one java class
per template was standard.

In turbine-3 the layout of the page is completely configurable, it seems
it is not possible to have a java class per template.  It was
originally, but I think that has been removed.  I am of the opinion that
it should be an option that is available as an valve the comes with
turbine.  In turbine-3 it is quite easy to use a valve that does what
you need.  This part of turbine-3 is undergoing redesign.

john mcnally

Dave wrote:
> 
> I am new to Turbine/Velocity. I looked in the docs and in the list archive,
> but did not find the information I am looking for.
> 
> What I am trying to do is an app that would have a screen, customizable by
> the user, that will display multiple sub-screens. As an example, let's take
> http://finance.yahoo.com/
> 
> On the same screen, there are many sections, for example Market Summary,
> Business News Headlines, and so on. Let's say each of those sections is a
> separate Velocity screen with a separate SubScreen.vm and SubScreen.class.
> The user should be able to select the sub-screens he wants, which means the
> screen has to be built dynamically. Is such a setup possible with
> Turbine/Velocity?
> 
> Another similar question, with Navigations, can each navigation template
> instantiate its own Java class to provide the data?
> 
> Thanks in advance for your answers!
> 
> Dave
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: multiple sub-screens in a portal like environment

Posted by Steve <tu...@knology.net>.
<quote>
On the same screen, there are many sections, for example Market Summary,
Business News Headlines, and so on. Let's say each of those sections is a
separate Velocity screen with a separate SubScreen.vm and SubScreen.class.
The user should be able to select the sub-screens he wants, which means the
screen has to be built dynamically. Is such a setup possible with
Turbine/Velocity?
</quote>

If you want to separate the content in one html page into several templates,
Velocity has both a #include directive (acts like a SSI--does not parse) and
a #parse directive that acts like a SSI, but parses the template as well.
I'm not sure this is exactly what you want, but I think it would work.

As for your second question,

<quote>
Another similar question, with Navigations, can each navigation template
instantiate its own Java class to provide the data?
</quote>

All the template classes, layouts, navigations & screens may have a java
class behind it.

HTH,
Steve

-----Original Message-----
From: Dave [mailto:rega+list-turbine-user@leader-bg.com]
Sent: Friday, January 25, 2002 5:59 PM
To: turbine-user@jakarta.apache.org
Subject: multiple sub-screens in a portal like environment


I am new to Turbine/Velocity. I looked in the docs and in the list archive,
but did not find the information I am looking for.

What I am trying to do is an app that would have a screen, customizable by
the user, that will display multiple sub-screens. As an example, let's take
http://finance.yahoo.com/

On the same screen, there are many sections, for example Market Summary,
Business News Headlines, and so on. Let's say each of those sections is a
separate Velocity screen with a separate SubScreen.vm and SubScreen.class.
The user should be able to select the sub-screens he wants, which means the
screen has to be built dynamically. Is such a setup possible with
Turbine/Velocity?
Another similar question, with Navigations, can each navigation template
instantiate its own Java class to provide the data?
Thanks in advance for your answers!

Dave

--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>