Hi!

I still have doubts on the topic of my previous post.
This is the one: 

"I am trying to get my java module for the layout to be execyted, but somehow 
it seems to skip it. All my java screens associated with .vm's are executed as 
expected. Following the same organizational pattern with layouts it doesn't 
work.

Project structure example:

com.company.modules.layouts
|
---LayoutOne.java

com.company.modules.screens
|
---ScreenOne.java



templates
|
---screens
|        |
|        ---ScreenOne.vm
|
---layouts
         |
         ---LayoutOne.vm

I have added a properties file that specifies my modules packages. Ex:

module.packages = com.company.modules ,

and still it behaves like I said before. Can anyone please help me?"




Ok. Now the Turbine specification says the process of execution is as follows 
(I copy/paste -ed it):

      HTTP Client -> Execute Turbine Servlet -> Execute Page -> Execute 
Layout/Screen/Navigation -> Return Page Content 
      If Action is defined then...   
      Execute Action  

What does executing a layout refer to? Only the layout's .vm file? Then why 
does it say that I can override (or subclass...) turbine's modules 
(org.apache.turbine.modules) with my own (com.company.modules)? My 
understanding was that writing my own modules would lead to their executin in 
place (or at least prior) to those default to turbine 
(org.apache.turbine.modules). Might I add that the default module for the 
layout gets executed (I mean the actual java class written for the default 
layout template ... I assume - possibly wrong - that there is one) despite the 
fact that my custom module exists and it is mentioned in the properties file. I 
am relatively (2 -3 months) new to turbine framework and I may be wrong (the 
documentation is a little poor - no offense).

What I want to do is this:

- write a layout template (ex. MyLayout.vm)
- define it as a default layout module in the TurbineResources.properties file
- write a class with the same name (MyLayout.java) in the specified layout 
module (com.company.modules.layouts)
- set-up a screen to have this new layout 
(data.setLayoutTemplate("MyLayout.vm"))
- ... and voilla. I navigate to that screen, Turbine loads the layout for it 
(MyLayout.vm, executing the MyLayout.java too - here is the problem really), 
executes the screen's java file and gives back the html.

Do I want the impossible? If so, please wake me up from my dream :) If not, 
please tell me how it can be done.

Many many thanks!

Dan

Reply via email to