You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Channing Walton <ch...@teaminabox.co.uk> on 2002/08/09 13:12:28 UTC

newapp: Flux navigation, layouts and access control

Hi,
I have created a new app in the standard way and would like to modify it as
follows:

1. I would like anything to do with Flux to use the Flux layouts and
navigation, rather than the 'app' ones.
2. When a user with the appropriate role such as 'turbine_root', logs in,
they see a link to the flux pages so that they might make changes, other
users shouldn't.

For the first problem, I have looked hard at the docs and mailing lists and
cannot find how to do what I want (tdk has a steep learning curve :-).

For the second one, I have tried:

#if ($data.getACL.hasRole("turbine_root"))
...flux menu items
#end

But this doesn't work in that the condition is always false (no menu items
show up).Also, $flux.role returns null when I've logged in as 'turbine'
which seems odd.


Channing
 
-- 
Channing Walton
Team In A Box ­ Software without Tragedy
http://www.teaminabox.co.uk/
Tel: 07966 427 630


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


Re: SOS...working with sample app in turbine

Posted by Vijay <vi...@bigtec.org>.
Hi Eliot,

Let me be more precise on what am I looking for...
I am able to configure the index(default) page to my liking.
Now this is a Login page which would require authentication from
the Database( lets presume that I have my DTDs ready), how do I
handle the authentication part( this is different from the default
authentication
that Turbine provides), then upon validation, the user is taken to another
screen.

Please suggest me how to do this.  I would be grateful if you could help me
solve
this issue.

Thanks


----- Original Message -----
From: "Eliot" <tu...@juxti.co.uk>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Friday, August 16, 2002 10:17 PM
Subject: Re: SOS...working with sample app in turbine


> > I have read most of the documentation....but it doesnt seem to
> > help. Please tell me which part of the code do I look for if I
> > wish to navigate from one page to another.  Guess answering
> > that part would get me started off.
>
> To create the URL for a page you would use the following in a
> Velocity template:
>
> $link.setPage("company,AboutUs.vm")
>
> Put this in the href attribute of an anchor tag to create a
> working link.
>
> <a href="$link.setPage("company,AboutUs.vm")">About us</a>
>
> The screen template for this page would be located here:
>
> templates/
>          screens/
>                  company/
>                          AboutUs.vm
>
> I hope this is what you're looking for.  If it isn't then please
> ask.
>
> Eliot
>
> --
> 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: SOS...working with sample app in turbine

Posted by Eliot <tu...@juxti.co.uk>.
> I have read most of the documentation....but it doesnt seem to
> help. Please tell me which part of the code do I look for if I
> wish to navigate from one page to another.  Guess answering
> that part would get me started off.

To create the URL for a page you would use the following in a
Velocity template:

$link.setPage("company,AboutUs.vm")

Put this in the href attribute of an anchor tag to create a
working link.

<a href="$link.setPage("company,AboutUs.vm")">About us</a>

The screen template for this page would be located here:

templates/
         screens/
                 company/
                         AboutUs.vm

I hope this is what you're looking for.  If it isn't then please
ask.

Eliot

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


Re: SOS...working with sample app in turbine

Posted by Vijay <vi...@bigtec.org>.
Hi Eliot..

Thanx for your prompt response....

I have read most of the documentation....but it doesnt seem to help.
Please tell me which part of the code do I look for if I wish to navigate
from one page to another.  Guess answering that part would get me started
off.

Thanx

----- Original Message -----
From: "Eliot" <tu...@juxti.co.uk>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Friday, August 16, 2002 9:50 PM
Subject: Re: SOS...working with sample app in turbine


> These aren't answers to your questions, but they should help you a lot:
>
> http://jakarta.apache.org/turbine/tdk/tdk-howto.html
> http://jakarta.apache.org/turbine/turbine-2/howto/velocity-site-howto.html
>
> HTH,
> Eliot
>
> On Fri, 16 Aug 2002 20:47:32 +0530
> "Vijay" <vi...@bigtec.org> wrote:
>
> > Hi...
> > I am newbie...Please treat this as a distress call....
> >
> > Can somebody guide me through...working with the sample
application....Here
> > is what I am looking for..
> > 1.  Where can I find the code for navigation from one page to another.
> > 2.  Suppose I would like to load a page with a preset dynamic
content...what
> > do I do for such a thing.
> >  I am using tdk 2.1
> > Thanks
> >
> >
> > --
> > 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>
>
>


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


Re: SOS...working with sample app in turbine

Posted by Eliot <tu...@juxti.co.uk>.
These aren't answers to your questions, but they should help you a lot:

http://jakarta.apache.org/turbine/tdk/tdk-howto.html
http://jakarta.apache.org/turbine/turbine-2/howto/velocity-site-howto.html

HTH,
Eliot

On Fri, 16 Aug 2002 20:47:32 +0530
"Vijay" <vi...@bigtec.org> wrote:

> Hi...
> I am newbie...Please treat this as a distress call....
> 
> Can somebody guide me through...working with the sample application....Here
> is what I am looking for..
> 1.  Where can I find the code for navigation from one page to another.
> 2.  Suppose I would like to load a page with a preset dynamic content...what
> do I do for such a thing.
>  I am using tdk 2.1
> Thanks
> 
> 
> --
> 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>


SOS...working with sample app in turbine

Posted by Vijay <vi...@bigtec.org>.
Hi...
I am newbie...Please treat this as a distress call....

Can somebody guide me through...working with the sample application....Here
is what I am looking for..
1.  Where can I find the code for navigation from one page to another.
2.  Suppose I would like to load a page with a preset dynamic content...what
do I do for such a thing.
 I am using tdk 2.1
Thanks


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


Re: newapp: Flux navigation, layouts and access control

Posted by Channing Walton <ch...@teaminabox.co.uk>.
Thanks jmi, I get it now.

Channing

On 14/8/02 8:24 pm, "jmi" wrote:

> if you have no class under vm, the default class is precessed
> it is set in TR.props, i thing in VELOCITY section ..
> 
> jmi
> 
> ----- Original Message -----
> From: "Channing Walton" <ch...@teaminabox.co.uk>
> To: "Turbine" <tu...@jakarta.apache.org>
> Sent: Tuesday, August 13, 2002 11:05 AM
> Subject: Re: newapp: Flux navigation, layouts and access control
> 
> 
>> OK, thanks peter. Its good to know I've got it right.
>> 
>> Another strange layout issue I found was that if I created a new vm in my
>> templates/app/screens, the layout used will be the flux layout, unless I
>> created a subclass of VelocityScreen in my screens package.
>> 
>> Do you know what that¹s about?
>> 
>> Channing
>> 
>> On 13/8/02 9:48 am, "peter neubauer" wrote:
>> 
>>> That's right,
>>> my solution is in case you need to switch the layout dynamically during
>>> the application flow ...
>>> 
>>> /peter
>>> On Tue, 2002-08-13 at 10:23, Channing Walton wrote:
>>>> On 13/8/02 9:12 am, "peter neubauer" wrote:
>>>> 
>>>>> On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
>>>>>> Hi,
>>>>>> I have created a new app in the standard way and would like to modify
> it as
>>>>>> follows:
>>>>>> 
>>>>>> 1. I would like anything to do with Flux to use the Flux layouts and
>>>>>> navigation, rather than the 'app' ones.
>>>>> I wrestled with the same problem. After digging in the source code,I
>>>>> found the the rundata is available in the template as $data, and it
> has
>>>>> a convinience method data.setLayoutTemplate("/NewLayout.vm").
>>>>> However, it seems that the layout is resetted every time you make a
> new
>>>>> request. That means, all your screen templates that do not want the
>>>>> default layout should have a line
>>>>> $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
>>>>> seems that this is executed when the new response is built, so setting
>>>>> the layout in the calling screen will be without effect.
>>>>> Does anyone know how to "permanently" change the layout, until you
>>>>> change it explicitly again?
>>>> 
>>>> Hi, I found the cure to be to edit the Flux.properties file in
>>>> WEB-APPS/conf, and set this property:
>>>> 
>>>> flux.embedded.layout = /FluxDefault.vm
>>>> 
>>>> It was set to /Default.vm which is of course the app layout!!
>>>> 
>>>> This seems to work for me, I hope it is correct.
>>>> 
>>>> channing
>>>> 
>>>> 
>>>> --
>>>> 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>
>>> 
>>> 
>>> 
>> 
>> --
>> Channing Walton
>> Team In A Box ­ Software without Tragedy
>> http://www.teaminabox.co.uk/
>> Tel: 07966 427 630
>> 
>> 
>> --
>> 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>
> 
> 
> 

-- 
Channing Walton
Team In A Box ­ Software without Tragedy
http://www.teaminabox.co.uk/
Tel: 07966 427 630


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


Re: newapp: Flux navigation, layouts and access control

Posted by jmi <mi...@kepler.fmph.uniba.sk>.
if you have no class under vm, the default class is precessed
it is set in TR.props, i thing in VELOCITY section ..

jmi

----- Original Message -----
From: "Channing Walton" <ch...@teaminabox.co.uk>
To: "Turbine" <tu...@jakarta.apache.org>
Sent: Tuesday, August 13, 2002 11:05 AM
Subject: Re: newapp: Flux navigation, layouts and access control


> OK, thanks peter. Its good to know I've got it right.
>
> Another strange layout issue I found was that if I created a new vm in my
> templates/app/screens, the layout used will be the flux layout, unless I
> created a subclass of VelocityScreen in my screens package.
>
> Do you know what that¹s about?
>
> Channing
>
> On 13/8/02 9:48 am, "peter neubauer" wrote:
>
> > That's right,
> > my solution is in case you need to switch the layout dynamically during
> > the application flow ...
> >
> > /peter
> > On Tue, 2002-08-13 at 10:23, Channing Walton wrote:
> >> On 13/8/02 9:12 am, "peter neubauer" wrote:
> >>
> >>> On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
> >>>> Hi,
> >>>> I have created a new app in the standard way and would like to modify
it as
> >>>> follows:
> >>>>
> >>>> 1. I would like anything to do with Flux to use the Flux layouts and
> >>>> navigation, rather than the 'app' ones.
> >>> I wrestled with the same problem. After digging in the source code,I
> >>> found the the rundata is available in the template as $data, and it
has
> >>> a convinience method data.setLayoutTemplate("/NewLayout.vm").
> >>> However, it seems that the layout is resetted every time you make a
new
> >>> request. That means, all your screen templates that do not want the
> >>> default layout should have a line
> >>> $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
> >>> seems that this is executed when the new response is built, so setting
> >>> the layout in the calling screen will be without effect.
> >>> Does anyone know how to "permanently" change the layout, until you
> >>> change it explicitly again?
> >>
> >> Hi, I found the cure to be to edit the Flux.properties file in
> >> WEB-APPS/conf, and set this property:
> >>
> >> flux.embedded.layout = /FluxDefault.vm
> >>
> >> It was set to /Default.vm which is of course the app layout!!
> >>
> >> This seems to work for me, I hope it is correct.
> >>
> >> channing
> >>
> >>
> >> --
> >> 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>
> >
> >
> >
>
> --
> Channing Walton
> Team In A Box ­ Software without Tragedy
> http://www.teaminabox.co.uk/
> Tel: 07966 427 630
>
>
> --
> 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: newapp: Flux navigation, layouts and access control

Posted by Channing Walton <ch...@teaminabox.co.uk>.
OK, thanks peter. Its good to know I've got it right.

Another strange layout issue I found was that if I created a new vm in my
templates/app/screens, the layout used will be the flux layout, unless I
created a subclass of VelocityScreen in my screens package.

Do you know what that¹s about?

Channing

On 13/8/02 9:48 am, "peter neubauer" wrote:

> That's right,
> my solution is in case you need to switch the layout dynamically during
> the application flow ...
> 
> /peter
> On Tue, 2002-08-13 at 10:23, Channing Walton wrote:
>> On 13/8/02 9:12 am, "peter neubauer" wrote:
>> 
>>> On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
>>>> Hi,
>>>> I have created a new app in the standard way and would like to modify it as
>>>> follows:
>>>> 
>>>> 1. I would like anything to do with Flux to use the Flux layouts and
>>>> navigation, rather than the 'app' ones.
>>> I wrestled with the same problem. After digging in the source code,I
>>> found the the rundata is available in the template as $data, and it has
>>> a convinience method data.setLayoutTemplate("/NewLayout.vm").
>>> However, it seems that the layout is resetted every time you make a new
>>> request. That means, all your screen templates that do not want the
>>> default layout should have a line
>>> $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
>>> seems that this is executed when the new response is built, so setting
>>> the layout in the calling screen will be without effect.
>>> Does anyone know how to "permanently" change the layout, until you
>>> change it explicitly again?
>> 
>> Hi, I found the cure to be to edit the Flux.properties file in
>> WEB-APPS/conf, and set this property:
>> 
>> flux.embedded.layout = /FluxDefault.vm
>> 
>> It was set to /Default.vm which is of course the app layout!!
>> 
>> This seems to work for me, I hope it is correct.
>> 
>> channing
>> 
>> 
>> --
>> 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>
> 
> 
> 

-- 
Channing Walton
Team In A Box ­ Software without Tragedy
http://www.teaminabox.co.uk/
Tel: 07966 427 630


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


Re: newapp: Flux navigation, layouts and access control

Posted by peter neubauer <pe...@yahoo.se>.
That's right,
my solution is in case you need to switch the layout dynamically during
the application flow ...

/peter
On Tue, 2002-08-13 at 10:23, Channing Walton wrote:
> On 13/8/02 9:12 am, "peter neubauer" wrote:
> 
> > On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
> >> Hi,
> >> I have created a new app in the standard way and would like to modify it as
> >> follows:
> >> 
> >> 1. I would like anything to do with Flux to use the Flux layouts and
> >> navigation, rather than the 'app' ones.
> > I wrestled with the same problem. After digging in the source code,I
> > found the the rundata is available in the template as $data, and it has
> > a convinience method data.setLayoutTemplate("/NewLayout.vm").
> > However, it seems that the layout is resetted every time you make a new
> > request. That means, all your screen templates that do not want the
> > default layout should have a line
> > $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
> > seems that this is executed when the new response is built, so setting
> > the layout in the calling screen will be without effect.
> > Does anyone know how to "permanently" change the layout, until you
> > change it explicitly again?
> 
> Hi, I found the cure to be to edit the Flux.properties file in
> WEB-APPS/conf, and set this property:
> 
> flux.embedded.layout = /FluxDefault.vm
> 
> It was set to /Default.vm which is of course the app layout!!
> 
> This seems to work for me, I hope it is correct.
> 
> channing
> 
> 
> --
> 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: newapp: Flux navigation, layouts and access control

Posted by Channing Walton <ch...@teaminabox.co.uk>.
On 13/8/02 9:12 am, "peter neubauer" wrote:

> On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
>> Hi,
>> I have created a new app in the standard way and would like to modify it as
>> follows:
>> 
>> 1. I would like anything to do with Flux to use the Flux layouts and
>> navigation, rather than the 'app' ones.
> I wrestled with the same problem. After digging in the source code,I
> found the the rundata is available in the template as $data, and it has
> a convinience method data.setLayoutTemplate("/NewLayout.vm").
> However, it seems that the layout is resetted every time you make a new
> request. That means, all your screen templates that do not want the
> default layout should have a line
> $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
> seems that this is executed when the new response is built, so setting
> the layout in the calling screen will be without effect.
> Does anyone know how to "permanently" change the layout, until you
> change it explicitly again?

Hi, I found the cure to be to edit the Flux.properties file in
WEB-APPS/conf, and set this property:

flux.embedded.layout = /FluxDefault.vm

It was set to /Default.vm which is of course the app layout!!

This seems to work for me, I hope it is correct.

channing


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


Re: newapp: Flux navigation, layouts and access control

Posted by peter neubauer <pe...@yahoo.se>.
On Fri, 2002-08-09 at 13:12, Channing Walton wrote:
> Hi,
> I have created a new app in the standard way and would like to modify it as
> follows:
> 
> 1. I would like anything to do with Flux to use the Flux layouts and
> navigation, rather than the 'app' ones.
I wrestled with the same problem. After digging in the source code,I
found the the rundata is available in the template as $data, and it has
a convinience method data.setLayoutTemplate("/NewLayout.vm").
However, it seems that the layout is resetted every time you make a new
request. That means, all your screen templates that do not want the
default layout should have a line 
 $data.setLayoutTemplate("/NewLayout.vm") somewhere near the top. It
seems that this is executed when the new response is built, so setting
the layout in the calling screen will be without effect.
Does anyone know how to "permanently" change the layout, until you
change it explicitly again?

/peter
> 2. When a user with the appropriate role such as 'turbine_root', logs in,
> they see a link to the flux pages so that they might make changes, other
> users shouldn't.
> 
> For the first problem, I have looked hard at the docs and mailing lists and
> cannot find how to do what I want (tdk has a steep learning curve :-).
> 
> For the second one, I have tried:
> 
> #if ($data.getACL.hasRole("turbine_root"))
> ...flux menu items
> #end
> 
> But this doesn't work in that the condition is always false (no menu items
> show up).Also, $flux.role returns null when I've logged in as 'turbine'
> which seems odd.
> 
> 
> Channing
>  
> -- 
> Channing Walton
> Team In A Box ­ Software without Tragedy
> http://www.teaminabox.co.uk/
> Tel: 07966 427 630
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>


_____________________________________________________
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: newapp: Flux navigation, layouts and access control

Posted by Channing Walton <ch...@teaminabox.co.uk>.
On 9/8/02 12:12 pm, "Channing Walton" wrote:

> Hi,
> I have created a new app in the standard way and would like to modify it as
> follows:
> 
> 1. I would like anything to do with Flux to use the Flux layouts and
> navigation, rather than the 'app' ones.

OK, I don't know how but I have managed to sort this out.

-- 
Channing Walton
Team In A Box ­ Software without Tragedy
http://www.teaminabox.co.uk/
Tel: 07966 427 630


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