You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Jason van Zyl <jv...@zenplex.com> on 2001/11/01 18:50:48 UTC
Re: Multiple Layouts for Log-In, special sections, and then
ofcourse the "default"...
On 11/1/01 12:36 PM, "Joe Terry" <jo...@knowself.com> wrote:
> Jason,
>
> I have the "newapp" application running and the "Login.vm" template and
> "Login.vm" layout are a part of that example. ... but ...
>
> How do I activate another layout for another template?
>
> Is it a pattern by name?
By directory structure and name.
> I have a screen in a subdirectory of the "screens" directory and I want it
> to have a different layout. Where do I specify this?
screens/
chemistry/Index.vm
physics/Index.vm
layouts/
chemistry/Default.vm
physics/Default.vm
The Default.vm layout template in the layouts/chemistry directory
will be used for the screens/chemistry/Index.vm page.
You get the pattern, this is documented.
For template matching it call all be done by structure your
directories of templates correctly.
> A) TurbineResources.properties by installing a subclass of
> "VelocityNavigation.java" such as ...
>
> services.VelocityService.default.navigation=JoesVelocityNavigation
>
> B) In the screen itself?
>
> Administration.java
> ...
> import org.apache.turbine.services.logging.TurbineLogging;
> ...
> protected boolean isAuthorized( RunData data ) throws Exception
> {
> boolean isAuthorized = false;
>
> AccessControlList acl = data.getACL();
>
> if (acl == null )
> {
> data.setScreenTemplate(
> TurbineResources.getString("template.login"));
>
> isAuthorized = false;
> }
> else if(acl.hasRole("turbine_root"))
> {
> isAuthorized = true;
> }
> else if(acl.hasRole("turbine_admin"))
> {
> isAuthorized = true;
> }
>
> TurbineLogging.info("\nisAuthorized = "+isAuthorized+"\n", data);
>
> if ( isAuthorized == true )
> {
> data.setScreenTemplate(
> TurbineResources.getString("template.admin_layout"));
> }
>
> return isAuthorized;
> }
>
> ====================================================
>
> Also, Jason ....
>
> The line ....
>
> TurbineLogging.info("\nisAuthorized = "+isAuthorized+"\n", data);
>
> dosen't seem to be outputting anything to Turbine.log ... Other messages are
> going in the log, but not mine?
>
> What else should I look at?
>
> =============================
>
> Joet
> Software Sculptor
>
> =============================
>
>
> ----- Original Message -----
> From: "Jason van Zyl" <jv...@zenplex.com>
> To: "Turbine Users List" <tu...@jakarta.apache.org>
> Sent: Wednesday, October 31, 2001 9:13 PM
> Subject: Re: Multiple Layouts for Log-In, special sections, and then
> ofcourse the "default"...
>
>
>> On 10/31/01 11:03 PM, "Joe Terry" <jo...@knowself.com> wrote:
>>
>>> Anyone have an example of subclassing "VelocityNavigation".
>>>
>>> I need to have a layout for Log-In that is different from the layout for
>>> another section of the application, that is completely different from
> the
>>> "Default" layout.
>>
>> If you have a screen template named Login.vm than make a corresponding
>> layout template called Login.vm and the two will be used together.
>>
>>> I have built the Javadocs, I have the source. 2.2b1
>>>
>>> I'm not happy with the documentation, but Turbine rocks ... If only, I
> can
>>> meet my deadlines ...
>>>
>>> Cheers!
>>>
>>> Joet
>>>
>>
>> --
>>
>> 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>
>>
>
>
>
> --
> 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>