I now understand why the sample app fails to find layout templates unless
a custom screen class is defined.
If no screen class exists, then turbine finds the screen:
o.a.t.flux.modules.screens.Default
This class has a doBuildTempate() method which calls isAuthorized(). It
includes the following code, which overwrites the layout template.
if
(TurbineResources.getString("flux.mode").equalsIgnoreCase("embedded"))
{
data.getTemplateInfo().setLayoutTemplate(
TurbineResources.getString("flux.embedded.layout"));
}
I suspect that the fix is for the sample app to include a
com.appname.modules.screens.Default screen class that extends
VelocitySecureScreen? This way, it will be found before the flux
Default, and so the layout template will not be overwritten.
If folk agree, I'm happy to try and patch the construction of the sample
app.
J.
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 8/8/01, 1:24:28 AM, John McNally <[EMAIL PROTECTED]> wrote regarding
Re Layout only found when a screen class is [EMAIL PROTECTED]:
> It should not be necessary to define the screen class to get the layout
> you want. If it is, then this is a bug. If you care to help solve it,
> look at the TemplateService. Otherwise submit a bug report.
> john mcnally
> Jason Grant wrote:
> >
> > No responses to the initial post - hope it made sense.
> >
> > The essence is, why is a screen class required before the corresponding
> > layout template is used? Bug or feature?
> >
> > J.
> >
> > >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> >
> > On 8/6/01, 9:42:30 AM, Jason Grant <[EMAIL PROTECTED]> wrote
> > regarding Layout only found when a screen class is defined?:
> >
> > > I've just discovered why my Layout templates were not being found, but do
> > > not understand the fix, and was hoping that someone could explain.
> >
> > > After adding a screen template Jason.vm and a layout template Jason.vm to
> > > the TDK2.1 sample app, I found that the Default.vm layout was still being
> > > used when I accessed the page with a URL like
> >
> > > http://localhost:8080/turbine/newapp/turbine/template/Jason.vm
> >
> > > I've subsequently found that, once a Jason.java SecureScreen derivative
> > > is added to my modules.screens package, the new Layout is found.
> >
> > > On reading the Turbine code, I couldn't see why this is so. I also don't
> > > understand this requirement in functional terms.
> >
> > > Enlightenment appreciated.
> >
> > > J.
> >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]