You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Eigen Technology Pty Ltd <mi...@eigentechnology.com> on 2002/12/18 13:08:25 UTC

RE: AW: Velocity Format]

Thanks, I understand that now.

Suppose I have a new layout file call, newLayout.vm under the
app/layouts directory and have newTop.vm, newMenu.vm and newBottom.vm
under the app/navigations directory, and I have a new file named
newFile.vm under app/screens,  how do I specify in this newFile.vm to
use this new set of layouts ?

thanks again.
michael


> It's more easy, put it into app/layouts.
>
>> -----Ursprüngliche Nachricht-----
>> Von: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Gesendet: Mittwoch, 18. Dezember 2002 12:39
>> An: turbine-user@jakarta.apache.org
>> Betreff: Re: AW: Velocity Format
>>
>>
>> Thanks, below is the default Directory tree for newapp example. Where
>> do I suppose to set out this new Layout-Templates?  At the same level
>> as app / jsp / flux or as a subdirectory of app?
>>
>> |-- app
>> |   |-- GlobalMacros.vm
>> |   |-- layouts
>> |   |   |-- Default.vm
>> |   |   `-- Login.vm
>> |   |-- navigations
>> |   |   |-- DefaultBottom.vm
>> |   |   |-- DefaultTop.vm
>> |   |   `-- Menu.vm
>> |   `-- screens
>> |       |-- Error.vm
>> |       |-- Form.vm
>> |       |-- Index.vm
>> |       |-- Insert.vm
>> |       |-- Login.vm
>> |       |-- ServletInfo.vm
>> |       |-- Upload.vm
>> |       `-- UploadComplete.vm
>> |-- flux
>> |   |-- GlobalMacros.vm
>> |   |-- layouts
>> |   |   `-- FluxDefault.vm
>> |   |-- navigations
>> |   |   |-- FluxBottom.vm
>> |   |   |-- FluxMenu.vm
>> |   |   `-- FluxTop.vm
>> |   `-- screens
>> |       |-- FluxEmbeddedMenu.vm
>> |       |-- FluxError.vm
>> |       |-- FluxIndex.vm
>> |       |-- FluxLogin.vm
>> |       |-- group
>> |       |   |-- FluxGroupAlreadyExists.vm
>> |       |   |-- FluxGroupForm.vm
>> |       |   `-- FluxGroupList.vm
>> |       |-- permission
>> |       |   |-- FluxPermissionAlreadyExists.vm
>> |       |   |-- FluxPermissionForm.vm
>> |       |   `-- FluxPermissionList.vm
>> |       |-- role
>> |       |   |-- FluxRoleAlreadyExists.vm
>> |       |   |-- FluxRoleForm.vm
>> |       |   |-- FluxRoleList.vm
>> |       |   `-- FluxRolePermissionForm.vm
>> |       `-- user
>> |           |-- FluxMissingRequiredInputs.vm
>> |           |-- FluxUserAlreadyExists.vm
>> |           |-- FluxUserForm.vm
>> |           |-- FluxUserList.vm
>> |           `-- FluxUserRoleForm.vm
>> |-- jsp
>> |   |-- screens
>> |   |   |-- Index.jsp
>> |   |   `-- Login.jsp
>> |   `-- tld
>> |       `-- Test.tld
>>
>>
>>
>>
>> > Hi,
>> > you have to create additional Layout-Templates and set them in your
>> action or screen or in a link.
>> > In these Layout-templates you can individually specify which
>> > navigation-files you want to use.
>> > Hope that helps
>> > Marc
>> >
>> >> -----Ursprüngliche Nachricht-----
>> >> Von: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
>> Gesendet: Mittwoch, 18. Dezember 2002 12:01
>> >> An: turbine-user@jakarta.apache.org
>> >> Betreff: Velocity Format
>> >>
>> >>
>> >> Hi All,
>> >>
>> >> I would like to display a .vm page without the DefaultTop, Menu
>> and
>> Bottom. I know this can be achieved by getting rid of a few lines in
>> the layout/Default.vm file. But I would like the Top, Menu and Botton
>> to exist in some files but not others, is this possible?
>> >>
>> >> cheers
>> >> michael
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> 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>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Velocity Format

Posted by Eigen Technology Pty Ltd <mi...@eigentechnology.com>.
Thanks Chris, I have found your previous reply, see below.

I have two questions on them:

1. I followed your instruction and built a file structure as indicated.
When I First login to DOM1, TDK does not seem to be able to find the TOP
and BOTTOM part of the page.  And after login, I have this error message:

Horrible Exception: java.lang.Exception: Screen template '/Index.vm' not
found

2. In your previous reply, you use .dom1 and .dom2, are they suppose to be
subdirectories under
./WEB-INF/src/java/org/apache/turbine/flux/modules/screens/dom1/Default.java
?

/modules.screens
        MpiScreen.java
        Default.java
        .dom1
                Default.java
        .dom2
                Default.java
                .admin
                        Default.java (requires authentication)
                        Login.java
thanks
michael

I haven't ever used Flux, but I can answer your first question...

Just make the same directory structure in the layouts, screens, and
navigation templates, then mirror that structure with packages in your
modules.screens package.  You *should* be able to figure this out from the
Velocity Site Howto, but it took me a while to understand it.  For example,
I am building two websites domain1.com and domain2.com to run in the same
turbine instance.  My structure looks like this:

/templates
        /app
                layouts/
                        Default.vm (Turbine Requires this, it is blank)
                        dom1/
                                /Default.vm
                        dom2/
                                /Default.vm
                                admin/
                                        /Default.vm
                navigations/
                        dom1/
                                TopMenu.vm
                                LeftSideMenu.vm
                        dom2/
                                Menu.vm
                                admin/
                                        /Tabs.vm
                screens/
                        dom1/
                                /Index.vm
                                /Error.vm
                                /Whatever.vm
                        dom2/
                                /Index.vm
                                /Error.vm
                                /Whatever.vm
                                admin/
                                        Index.vm
                                        Error.vm
                                        Login.vm
                                        SamplesManagement.vm

/modules.screens
        MpiScreen.java
        Default.java
        .dom1
                Default.java
        .dom2
                Default.java
                .admin
                        Default.java (requires authentication)
                        Login.java

NOTES:
*Turbine tries to use a layout that matches the template request
*Turbine uses the first Default screen it finds starting in the subpackage
that most closely resembles the template request
*The Error.vm lets you have formatted error screens that match your current
"site" look and feel.
*Extend TemplateLink to automatically map the template paths for you:
        $link.setDom1Page("Whatever.vm") ==> /template/dom1,Whatever.vm
        instead of....
        $link.setPage("dom1,Whatever.vm")
*You can have as many different virtual sites as you need.
*My admin section is secured, the others are publicly accessible
*Incidentally, both dom1 and dom2 have common functionality such as a tile
sample shopping cart.











>> From: Eigen Technology Pty Ltd
>> nhow do I specify in this newFile.vm to
>> use this new set of layouts ?
>
> Sub folders work well for this too.
>
> If you create similar folder-trees in your /app/layout,
> /app/navigations, /app/screens and optionally your
> com.mycompany.modules.screens package, then Turbine will use the proper
> layout and navigation templates depending on which subfolder the
> requested template is in.  This feature saves you many calls to
> data.setLayoutTemplate().  Search the archives for a thread "additional
> root directories?" for more information if you want to pursue this
> route.
>
> Chris




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Velocity Format

Posted by Chris K Chew <ch...@fenetics.com>.
> From: Eigen Technology Pty Ltd
> nhow do I specify in this newFile.vm to
> use this new set of layouts ?

Sub folders work well for this too.

If you create similar folder-trees in your /app/layout, /app/navigations,
/app/screens and optionally your com.mycompany.modules.screens package, then
Turbine will use the proper layout and navigation templates depending on
which subfolder the requested template is in.  This feature saves you many
calls to data.setLayoutTemplate().  Search the archives for a thread
"additional root directories?" for more information if you want to pursue
this route.

Chris


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


AW: AW: Velocity Format]

Posted by Marc Lustig <ma...@marclustig.com>.
$data.setLayoutTemplate("yourtemplate.vm")

> -----Ursprüngliche Nachricht-----
> Von: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> Gesendet: Mittwoch, 18. Dezember 2002 13:08
> An: turbine-user@jakarta.apache.org
> Betreff: RE: AW: Velocity Format]
>
>
> Thanks, I understand that now.
>
> Suppose I have a new layout file call, newLayout.vm under the
> app/layouts directory and have newTop.vm, newMenu.vm and newBottom.vm
> under the app/navigations directory, and I have a new file named
> newFile.vm under app/screens,  how do I specify in this newFile.vm to
> use this new set of layouts ?
>
> thanks again.
> michael
>
>
> > It's more easy, put it into app/layouts.
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> >> Gesendet: Mittwoch, 18. Dezember 2002 12:39
> >> An: turbine-user@jakarta.apache.org
> >> Betreff: Re: AW: Velocity Format
> >>
> >>
> >> Thanks, below is the default Directory tree for newapp example. Where
> >> do I suppose to set out this new Layout-Templates?  At the same level
> >> as app / jsp / flux or as a subdirectory of app?
> >>
> >> |-- app
> >> |   |-- GlobalMacros.vm
> >> |   |-- layouts
> >> |   |   |-- Default.vm
> >> |   |   `-- Login.vm
> >> |   |-- navigations
> >> |   |   |-- DefaultBottom.vm
> >> |   |   |-- DefaultTop.vm
> >> |   |   `-- Menu.vm
> >> |   `-- screens
> >> |       |-- Error.vm
> >> |       |-- Form.vm
> >> |       |-- Index.vm
> >> |       |-- Insert.vm
> >> |       |-- Login.vm
> >> |       |-- ServletInfo.vm
> >> |       |-- Upload.vm
> >> |       `-- UploadComplete.vm
> >> |-- flux
> >> |   |-- GlobalMacros.vm
> >> |   |-- layouts
> >> |   |   `-- FluxDefault.vm
> >> |   |-- navigations
> >> |   |   |-- FluxBottom.vm
> >> |   |   |-- FluxMenu.vm
> >> |   |   `-- FluxTop.vm
> >> |   `-- screens
> >> |       |-- FluxEmbeddedMenu.vm
> >> |       |-- FluxError.vm
> >> |       |-- FluxIndex.vm
> >> |       |-- FluxLogin.vm
> >> |       |-- group
> >> |       |   |-- FluxGroupAlreadyExists.vm
> >> |       |   |-- FluxGroupForm.vm
> >> |       |   `-- FluxGroupList.vm
> >> |       |-- permission
> >> |       |   |-- FluxPermissionAlreadyExists.vm
> >> |       |   |-- FluxPermissionForm.vm
> >> |       |   `-- FluxPermissionList.vm
> >> |       |-- role
> >> |       |   |-- FluxRoleAlreadyExists.vm
> >> |       |   |-- FluxRoleForm.vm
> >> |       |   |-- FluxRoleList.vm
> >> |       |   `-- FluxRolePermissionForm.vm
> >> |       `-- user
> >> |           |-- FluxMissingRequiredInputs.vm
> >> |           |-- FluxUserAlreadyExists.vm
> >> |           |-- FluxUserForm.vm
> >> |           |-- FluxUserList.vm
> >> |           `-- FluxUserRoleForm.vm
> >> |-- jsp
> >> |   |-- screens
> >> |   |   |-- Index.jsp
> >> |   |   `-- Login.jsp
> >> |   `-- tld
> >> |       `-- Test.tld
> >>
> >>
> >>
> >>
> >> > Hi,
> >> > you have to create additional Layout-Templates and set them in your
> >> action or screen or in a link.
> >> > In these Layout-templates you can individually specify which
> >> > navigation-files you want to use.
> >> > Hope that helps
> >> > Marc
> >> >
> >> >> -----Ursprüngliche Nachricht-----
> >> >> Von: Eigen Technology Pty Ltd [mailto:michael@eigentechnology.com]
> >> Gesendet: Mittwoch, 18. Dezember 2002 12:01
> >> >> An: turbine-user@jakarta.apache.org
> >> >> Betreff: Velocity Format
> >> >>
> >> >>
> >> >> Hi All,
> >> >>
> >> >> I would like to display a .vm page without the DefaultTop, Menu
> >> and
> >> Bottom. I know this can be achieved by getting rid of a few lines in
> >> the layout/Default.vm file. But I would like the Top, Menu and Botton
> >> to exist in some files but not others, is this possible?
> >> >>
> >> >> cheers
> >> >> michael
> >> >>
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> 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>
>
>
>
>
> --
> 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>