You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by peter neubauer <pe...@yahoo.se> on 2002/08/07 16:51:44 UTC

Newbie: Multiple screen elements in one page?

Hello,
I'm wondering how to include multiple screens in my page? Is there only
one $screen_placeholder defined?
I would like to do something like


#if ( $data.getMessage() )
{
    $data.getMessage()
}

<table width="100%">

<tr>
    <td>$navigation.setTemplate("/default_top.vm")</td>
</tr>
<tr>
    <td>$screen_placeholder_for_headlines_only</td>
</tr>
<tr>
    <td>$screen_placeholder_for_articles</td>
</tr>
<tr>
    <td>$navigation.setTemplate("/default_bottom.vm")</td>
</tr>

</table>

Any hints?

/peter

_____________________________________________________
Gratis e-mail resten av livet p� www.yahoo.se/mail
Busenkelt!

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


Re: Newbie: Multiple screen elements in one page?

Posted by Rodney Schneider <rl...@arcalink.com>.
On Thu, 8 Aug 2002 00:51, you wrote:

> Hello,
> I'm wondering how to include multiple screens in my page? Is there only
> one $screen_placeholder defined?

It depends what you are using for your default Velocity layout class.  Check 
the following setting in your TurbineResources.properties file: 
services.VelocityService.default.layout = VelocityOnlyLayout

Take a look in the "org.apache.turbine.modules.layouts" package to see the 
layout classes that come with Turbine.  The most commonly used layout classes 
in Turbine 2.x are VelocityECSLayout and VelocityOnlyLayout.  These layout 
classes allow you to only have a single $screen_placeholder defined in your 
layout template.  This placeholder ends up being replaced by the screen the 
client is requesting (ie: the "template" parameter in the request).

However, if you really need to have more than one screen in a single page 
(ie: if you are creating a portal style site), you can use 
VelocityDirectLayout and you should be able to do what you want by using the 
following references in your layout template...

$screen_placeholder
    This will be replaced by the screen the user is requesting.
$screen_placeholder.setScreen("Headlines")
    This will be replaced by the output of the "Headlines" screen

> I would like to do something like
>
>
> #if ( $data.getMessage() )
> {
>     $data.getMessage()
> }
>
> <table width="100%">
>
> <tr>
>     <td>$navigation.setTemplate("/default_top.vm")</td>
> </tr>
> <tr>
>     <td>$screen_placeholder_for_headlines_only</td>
> </tr>
> <tr>
>     <td>$screen_placeholder_for_articles</td>
> </tr>
> <tr>
>     <td>$navigation.setTemplate("/default_bottom.vm")</td>
> </tr>
>
> </table>
>
> Any hints?

I am not sure that using VelocityDirectLayout is the best solution to your 
problem.  An alternative is to use a navigation template for your headlines 
and a screen template for your articles.  Another alternative is to just 
place all your required display logic within a single screen...  it really 
depends on your requirements.

If you need more help, you may want to explain your requirements in more 
depth.

Cheers!

-- Rodney

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


Re: Newbie: Multiple screen elements in one page?

Posted by peter neubauer <pe...@yahoo.se>.
Thanks for the help.
I will use a Navigation screen that puts the articles i need into the
context.

/peter
On Thu, 2002-08-08 at 03:14, Rodney Schneider wrote:
> On Thu, 8 Aug 2002 00:51, you wrote:
> 
> > Hello,
> > I'm wondering how to include multiple screens in my page? Is there only
> > one $screen_placeholder defined?
> 
> It depends what you are using for your default Velocity layout class.  Check 
> the following setting in your TurbineResources.properties file: 
> services.VelocityService.default.layout = VelocityOnlyLayout
> 
> Take a look in the "org.apache.turbine.modules.layouts" package to see the 
> layout classes that come with Turbine.  The most commonly used layout classes 
> in Turbine 2.x are VelocityECSLayout and VelocityOnlyLayout.  These layout 
> classes allow you to only have a single $screen_placeholder defined in your 
> layout template.  This placeholder ends up being replaced by the screen the 
> client is requesting (ie: the "template" parameter in the request).
> 
> However, if you really need to have more than one screen in a single page 
> (ie: if you are creating a portal style site), you can use 
> VelocityDirectLayout and you should be able to do what you want by using the 
> following references in your layout template...
> 
> $screen_placeholder
>     This will be replaced by the screen the user is requesting.
> $screen_placeholder.setScreen("Headlines")
>     This will be replaced by the output of the "Headlines" screen
> 
> > I would like to do something like
> >
> >
> > #if ( $data.getMessage() )
> > {
> >     $data.getMessage()
> > }
> >
> > <table width="100%">
> >
> > <tr>
> >     <td>$navigation.setTemplate("/default_top.vm")</td>
> > </tr>
> > <tr>
> >     <td>$screen_placeholder_for_headlines_only</td>
> > </tr>
> > <tr>
> >     <td>$screen_placeholder_for_articles</td>
> > </tr>
> > <tr>
> >     <td>$navigation.setTemplate("/default_bottom.vm")</td>
> > </tr>
> >
> > </table>
> >
> > Any hints?
> 
> I am not sure that using VelocityDirectLayout is the best solution to your 
> problem.  An alternative is to use a navigation template for your headlines 
> and a screen template for your articles.  Another alternative is to just 
> place all your required display logic within a single screen...  it really 
> depends on your requirements.
> 
> If you need more help, you may want to explain your requirements in more 
> depth.
> 
> Cheers!
> 
> -- Rodney
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


_____________________________________________________
F�lj VM p� n�ra h�ll p� Yahoo!s officielle VM-sajt www.yahoo.se/vm2002
H�ll dig ajour med nyheter och resultat, med vinnare och f�rlorare...

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


Re: torque: linking custom tables to TURBINE_USER?

Posted by peter neubauer <pe...@yahoo.se>.
Btw.
Torque installs my Flux table into the application database. But that
means that the generated classes get into
com.mycompany.myapp.om.TurbineUser etc. structure. Now when I link
something to these classes, it becomes incompatible with the default
behavior:

Schema (this is in the turbine-schema, I should probably use your
suggestion, but this one works right now):
<table name="AUTHOR" idMethod="idbroker">
    <column name="AUTHOR_ID" required="true" primaryKey="true"
type="INTEGER"/>
    <column name="NAME" size="255" type="VARCHAR"/>
    <column name="USER_ID" type="INTEGER"/>
    <foreign-key foreignTable="TURBINE_USER">
      <reference local="USER_ID" foreign="USER_ID"/>
    </foreign-key>
  </table>

Velocity:
User: $user.class.name
User: $article.Author.TurbineUser.class.name
HTML:

User: org.apache.turbine.om.security.TurbineUser 
User: com.techtor.fotonytt.om.TurbineUser



Is there a way around it? Now I cannot cast these classes against each
other. Is there a config for that? Can I get FLux to use my classes
instead of the default binary ones?

/peter

On Thu, 2002-08-08 at 11:42, Scott Eade wrote:
> Peter,
> 
> You need to look at the extend-user howto up on the turbine site:
> 
> http://jakarta.apache.org/turbine/turbine-2/howto/extend-user-howto.html
> 
> This is based on turbine 2.1.  I am pretty sure this is not a solution for
> turbine 2.2 or 3.0.  Someone in the know will need to update this for
> turbine 2.2 if the same approach is indeed appropriate.  I was going to look
> at this today, but other things have cropped up that have demanded my
> immediate attention.  Hopefully I will get some time to have a look at it
> next week or so.
> 
> HTH,
> 
> Scott
> -- 
> Scott Eade
> Backstage Technologies Pty. Ltd.
> Web: http://www.backstagetech.com.au
> 
> 
> > From: peter neubauer <pe...@yahoo.se>
> > Reply-To: "Turbine Users List" <tu...@jakarta.apache.org>
> > Date: 08 Aug 2002 11:22:56 +0200
> > To: Turbine Users List <tu...@jakarta.apache.org>
> > Subject: torque: linking custom tables to TURBINE_USER?
> > 
> > Hello,
> > I would like to create a link between a custom table and the user table
> > in the turbine-schema.xml in order to be able to connect the user and my
> > custom object. when I try to reference that table in my-schema.xml, I
> > get an error that the table is not existent, running "ant init". Do I
> > have to include my schema in the same file as turbine-schema.xml in
> > order to make it work? Both schemas are using the same databse.
> > 
> > /peter
> > 
> > _____________________________________________________
> > 
> > Gratis e-mail resten av livet på www.yahoo.se/mail
> > 
> > Busenkelt!
> > 
> > 
> > --
> > 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>


_____________________________________________________
Följ VM på nära håll på Yahoo!s officielle VM-sajt www.yahoo.se/vm2002
Håll dig ajour med nyheter och resultat, med vinnare och förlorare...

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


Re: torque: linking custom tables to TURBINE_USER?

Posted by Scott Eade <se...@backstagetech.com.au>.
Peter,

You need to look at the extend-user howto up on the turbine site:

http://jakarta.apache.org/turbine/turbine-2/howto/extend-user-howto.html

This is based on turbine 2.1.  I am pretty sure this is not a solution for
turbine 2.2 or 3.0.  Someone in the know will need to update this for
turbine 2.2 if the same approach is indeed appropriate.  I was going to look
at this today, but other things have cropped up that have demanded my
immediate attention.  Hopefully I will get some time to have a look at it
next week or so.

HTH,

Scott
-- 
Scott Eade
Backstage Technologies Pty. Ltd.
Web: http://www.backstagetech.com.au


> From: peter neubauer <pe...@yahoo.se>
> Reply-To: "Turbine Users List" <tu...@jakarta.apache.org>
> Date: 08 Aug 2002 11:22:56 +0200
> To: Turbine Users List <tu...@jakarta.apache.org>
> Subject: torque: linking custom tables to TURBINE_USER?
> 
> Hello,
> I would like to create a link between a custom table and the user table
> in the turbine-schema.xml in order to be able to connect the user and my
> custom object. when I try to reference that table in my-schema.xml, I
> get an error that the table is not existent, running "ant init". Do I
> have to include my schema in the same file as turbine-schema.xml in
> order to make it work? Both schemas are using the same databse.
> 
> /peter
> 
> _____________________________________________________
> 
> Gratis e-mail resten av livet på www.yahoo.se/mail
> 
> Busenkelt!
> 
> 
> --
> 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>


torque: linking custom tables to TURBINE_USER?

Posted by peter neubauer <pe...@yahoo.se>.
Hello,
I would like to create a link between a custom table and the user table
in the turbine-schema.xml in order to be able to connect the user and my
custom object. when I try to reference that table in my-schema.xml, I
get an error that the table is not existent, running "ant init". Do I
have to include my schema in the same file as turbine-schema.xml in
order to make it work? Both schemas are using the same databse.

/peter

_____________________________________________________
Gratis e-mail resten av livet p� www.yahoo.se/mail
Busenkelt!

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