You should not directly use VelocitySecureScreen (that's why it is
abstract).  You need to extended it like:

com.mycompany.modules.newapp.screens.app.Default extends
VelocitySecureScreen.  And for your login screen, create a specific screen
class com.mycompany.modules.newapp.screens.app.LoginScreenName extends
VelocityScreen.

Another approach that I like is creating multiple Default screen classes.
One for secure and one for non-secure and place them to different packages
that match your directory structure:

newapp
 |
 |--templates
     |
     |--screens
         |
         |--app
             |
             |--securescreens
             |
             |--weakscreens

then create these 2 Default classes:
com.mycompany.modules.newapp.screens.app.securescreens.Default extends
VelocitySecureScreen
com.mycompany.modules.newapp.screens.app.weaksceens.Default extends
VelocityScreen

Then create your templates in either the securescreens or weakscreens
directory depending on the security requirements.  Now all screens without
specific screen classes will use the respective Default screen class for
processing.

I have gone as far as to build a service (invoked from isAuthorized() )that
looks at the name of screen (like: foo,bar) and then checks the ACL of the
current user against the required security for that screen (stored within an
XML file), that way I can have secure templates of different "strengths" use
the same screen class.


If you want to use slashes "/" instead of commas "," in the $link tool, you
will need to change 

tool.request.link=org.apache.turbine.util.template.TemplateLink
to
tool.request.link=org.apache.turbine.util.template.TemplateLinkWithSlash

in your TR.props file.

Scott



-----Original Message-----
From: Pugh, Eric [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 5:32 PM
To: 'Turbine Users List'
Subject: RE: Does every .vm screen need a .java screen?


I went back and played around with the newapp application.  It turns out
that because VelocitySecureScreen is abstract, I can't make it my default
choice.  Because all my pages EXCEPT the login are Secure pages, I needed to
set my default choice as SecureSecreen (based right off of the SecureScreen
in newapp).

The other issue that caused problems and confused me was that I was trying
to set a link as $link.setPage('variants/SplitVariant.vm"); However, it
appears it needs to be $link.setPage('variants,SplitVariant.vm");  

I think there is a bug in the documentation at
http://jakarta.apache.org/turbine/turbine-2/howto/velocity-site-howto.html:
<snip>
In index.vm, if you want to link to UserAdmin.vm, you would add something
like this to the HTML: 

   
 <a href="$link.setPage("admin,UserAdmin.vm")">User Admin Screen</a>
  
   

As you can see above, I used a "," instead of a "/". You can use either one
here. The above will create a fully formed URI with the session information
encoded into the link if the clients brower has cookies turned off. 

</snip>

Using "/" definitly causes problems!  

Thanks for the help,
Eric

-----Original Message-----
From: Jason van Zyl [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 04, 2002 4:40 PM
To: Turbine Users List
Subject: Re: Does every .vm screen need a .java screen?


On 1/4/02 4:22 PM, "Pugh, Eric" <[EMAIL PROTECTED]> wrote:

> Does every .vm need a screen?

No.

> I am trying to create a .vm file with no
> corresponding .java class.  However, using TDK2.1, I get errors.  I looked
> in the source, and it seems to throw an exception whenever it can't find
the
> screen.  Is there anyway to change this behavoir from the configuration?

It throws an exception when it can't find a template, not a screen class.
There is a default screen class that can be specified so that if a screen
class doesn't exist than the default screen class will. The sample app in
the 2.1 TDK is a full example of how this works.
 
> It seems that many people (per the other posts) are not using .java
screens,
> but just .vm and pull tools.

Yup.
 
> Eric
> 
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

-- 

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:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to