Mark Glass wrote:
>
> I have adapted the new app application to examine the users role and
> select a different screen according to the users role. (Actually I want
> to change the screen color depending on the users role).
> I created two new screens called BlueIndex.vm and GreenIndex.vm. by
> copying Index.vm in the Screens directory. I then added the following code
I changed a couple things, the sample app might be a bit out of date.
If you are dealing with templates then you always use the RunData
methods
that deal with templates:
>
> public void doBuildTemplate( RunData data, Context context )
> {
> context.put("entries", getEntries());
> if ( data.getACL ().hasRole ("accounting") )
> {
> // Set the template, the layout will automatically be matched up.
> data.setScreenTemplate("GreenIndex.vm");
> }
> else if ( data.getACL ().hasRole ("development") )
> {
> data.setScreenTemplate ("BlueIndex.vm");
>
> }
> }
>
> to the Index class in the package org.mycompany.newapp.modules.screens.
>
> For some reason the default screen is always chosen. Why? How can I make
> this happen?
>
> Thanks,
> Mark Glass
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
--
jvz.
Jason van Zyl
[EMAIL PROTECTED]
http://jakarta.apache.org/velocity
http://jakarta.apache.org/turbine
http://jakarta.apache.org/commons
http://tambora.zenplex.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]