On 7/20/01 12:06 AM, "Mike Haberman" <[EMAIL PROTECTED]> wrote:

>>  
>>> 1. In order to get the template that starts the whole shebang,
>>>    there is a line in the ClassicPipeLine that does this:
>>>    String layoutTemplate = Resolver.getTemplate("layouts", target);
>>>    where target is the screen target.
>>> 
>>>    Unfortunately, this relies on the fact that getTemplate will
>>>    return "layouts" + Default.vm if target is not found under "layouts".
>>>    But it won't work if target is found under "layouts" and it's
>>>    not obvious.
>> 
>>      Huh?
> 
> Let's say you have the screen "CreateAccount.vm"
> layoutTemplate = Resolver.getTemplate("layouts", target)
> 
> will look for CreateAccount in the directory layouts.  It doesn't exist
> so the default is to return moduleType + "Default.vm"  so you get
> "layouts/Default.vm" which works. But why are you choosing the layout
> template based on the screen name?

This is how 2.1 has worked for quite some time. It allows things
like changing the target template to say 'Login.vm' and having
a layout 'Login.vm' be used which is desirable because the layout
for a user who hasn't logged should probably not display any
application navigation.
 
> That's what isn't obvious.  You're relying on the implementation of
> getTemplate.

I'm relying on the Resolver in this case, but there is nothing that would
stop us from making the resolver pluggable which I have stated would
be a desirable thing in the notes. This would allow the search for
localized templates where the locale is embedded in the name, or
in a localized directory structure. Than you can do whatever you want.
 
I've also noted the problem about how sibling templates should be selected,
for example you may want to map a set of users to a particular layout.
These things have to be thought about, but adding a setLayoutTemplate is
meaningless in the context of the current design.

>>> 2.  I think we agreed that it's a good thing to be able to dynamically
>>>     set the layout in actions or screens.
>> 
>>       It may be desirable to control how sibling templates are set,
>>       but there is no notion of a layout template per se anymore.
> 
> What is the preferred way to set the first template that get's invoked?

This is all based on the ClassicPipeline and everything follows from
the target template. In the ClassicPipeline the layout and navigation
templates that are specific to the pipeline are found based on target
name. What is the scenerio you have where an exact match or the Default.vm
layout doesn't satisfy your requirements. This I'm interested in.
 
> thanks for clarifying this.
> 
> mike
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to