Re: Tiles, Modules, and Multiple Definition Files

2003-02-19 Thread Cedric Dumoulin

 Hi,

 All your explanations are absolutly right. Can I use them for a future 
faq ;-) ?

 The extends mechanism across modules will be improve in the next 
release. It has not been done in the current release due to the lack of 
time.

  Cedric

Derek Richardson wrote:

Since I heard nothing from the list, I did my own testing and am donating my findings to the archive:

4) Tiles works with modules. It has two modes: non-module-aware and module-aware:
 a) non-module-aware: all modules use the same tiles definition files, which are the ones specified in the struts-config for the default module, if there is a default module, or else following some other rule (I think it is first module listed in web.xml, but don't quote me without research to confirm). The tiles plugin must be present in each of the modules' struts-config.
 b) module-aware: each module has one or more tiles definition files which it uses. A module cannot see definitions in a tiles definition files used by other modules unless it uses that file itself. A module can see all the definition files configured for it and a definition in file B can extend a definition in file A if both are configured for the module in question. The one or more definition files used by a module are listed in the module's struts-config.xml file in the tile plugin section as comma-separated values for the property "definitions-config". Struts 1.1 has no concept of supermodule/submodule relationships, so there is no way to inherit from other modules, not even from the default module. All definitions for a given module share a namespace. If both definition files A and B are referenced for the same module and both contain a definition for "foo", the last file listed in struts-config wins.

Derek Richardson

 

-Original Message-
From: Derek Richardson 
Sent: Friday, February 14, 2003 7:52 PM
To: Struts Users Mailing List
Subject: Tiles, Modules, and Multiple Definition Files


I am using 1.1b3.

I have a default module and several explicit modules (say A 
and B). The default module and the explicit modules all use 
tiles. I would like to access the default module's 
definitions in the explicit modules. So this is what I want:

Module   Accessable Definitions
Default  Default
ADefault, A
BDefault, B

Furthermore, I would like the definitions for A and B to be 
able to extend the definitions for Default.

From reading the archives, I understand that struts modules 
have no heirarchical structure. So there's no way to say that 
default is the supermodule and A and B are submodules and 
have the inheritance imply visibility. Thus the cleanest way 
of implementing what I want is not possible.

The next cleanest is to declare multiple tiles definition 
files in the TilesPlugin in the struts-config of each module. 
As I understand it, this will make the definitions from all 
and only the declared files available within the module they 
are declared (assuming moduleAware=true). Which achieves my 
accessibility goals.

My real question is: how are the namespaces handled with 
multiple tiles definition files? Are they all read and dumped 
into the same space, as if they had been in one file? Or is 
there some sort of partitioning? Can definitions from one 
tiles definition file extends definitions from another, 
assuming they are both loaded in the Plugin? What if there is 
a naming conflict - how is that resolved?

The worst solution would be to have to cut-n-paste the 
default definitions into the subapp definition files. From 
what I've read, I don't think this is necessary.

I have done some reading on this issue, but there does not 
seem to be a comprehensive treament of the issue in any one 
place. Not only would I appreciate knowing more about the 
details of this topic, but I think it would be a useful 
addition to the archives.

Thanks,

Derek Richardson

-
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]




RE: Tiles, Modules, and Multiple Definition Files

2003-02-18 Thread Derek Richardson
Since I heard nothing from the list, I did my own testing and am donating my findings 
to the archive:

4) Tiles works with modules. It has two modes: non-module-aware and module-aware:
  a) non-module-aware: all modules use the same tiles definition files, which are the 
ones specified in the struts-config for the default module, if there is a default 
module, or else following some other rule (I think it is first module listed in 
web.xml, but don't quote me without research to confirm). The tiles plugin must be 
present in each of the modules' struts-config.
  b) module-aware: each module has one or more tiles definition files which it uses. A 
module cannot see definitions in a tiles definition files used by other modules unless 
it uses that file itself. A module can see all the definition files configured for it 
and a definition in file B can extend a definition in file A if both are configured 
for the module in question. The one or more definition files used by a module are 
listed in the module's struts-config.xml file in the tile plugin section as 
comma-separated values for the property "definitions-config". Struts 1.1 has no 
concept of supermodule/submodule relationships, so there is no way to inherit from 
other modules, not even from the default module. All definitions for a given module 
share a namespace. If both definition files A and B are referenced for the same module 
and both contain a definition for "foo", the last file listed in struts-config wins.

Derek Richardson

> -Original Message-
> From: Derek Richardson 
> Sent: Friday, February 14, 2003 7:52 PM
> To: Struts Users Mailing List
> Subject: Tiles, Modules, and Multiple Definition Files
> 
> 
> I am using 1.1b3.
> 
> I have a default module and several explicit modules (say A 
> and B). The default module and the explicit modules all use 
> tiles. I would like to access the default module's 
> definitions in the explicit modules. So this is what I want:
> 
> Module   Accessable Definitions
> Default  Default
> ADefault, A
> BDefault, B
> 
> Furthermore, I would like the definitions for A and B to be 
> able to extend the definitions for Default.
> 
> From reading the archives, I understand that struts modules 
> have no heirarchical structure. So there's no way to say that 
> default is the supermodule and A and B are submodules and 
> have the inheritance imply visibility. Thus the cleanest way 
> of implementing what I want is not possible.
> 
> The next cleanest is to declare multiple tiles definition 
> files in the TilesPlugin in the struts-config of each module. 
> As I understand it, this will make the definitions from all 
> and only the declared files available within the module they 
> are declared (assuming moduleAware=true). Which achieves my 
> accessibility goals.
> 
> My real question is: how are the namespaces handled with 
> multiple tiles definition files? Are they all read and dumped 
> into the same space, as if they had been in one file? Or is 
> there some sort of partitioning? Can definitions from one 
> tiles definition file extends definitions from another, 
> assuming they are both loaded in the Plugin? What if there is 
> a naming conflict - how is that resolved?
> 
> The worst solution would be to have to cut-n-paste the 
> default definitions into the subapp definition files. From 
> what I've read, I don't think this is necessary.
> 
> I have done some reading on this issue, but there does not 
> seem to be a comprehensive treament of the issue in any one 
> place. Not only would I appreciate knowing more about the 
> details of this topic, but I think it would be a useful 
> addition to the archives.
> 
> Thanks,
> 
> Derek Richardson
> 
> -
> 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]




Re: Tiles, Modules, and Multiple Definition Files

2003-02-14 Thread Craig R. McClanahan


On Fri, 14 Feb 2003, Derek Richardson wrote:

>
> I am using 1.1b3.
>
> I have a default module and several explicit modules (say A and B). The default 
>module and the explicit modules all use tiles. I would like to access the default 
>module's definitions in the explicit modules. So this is what I want:
>
> Module   Accessable Definitions
> Default  Default
> ADefault, A
> BDefault, B
>
> Furthermore, I would like the definitions for A and B to be able to
> extend the definitions for Default.
>

The whole topic of "extension" or "inheritance" is on the roadmap for
Struts 1.2 -- it's a cool idea, but not going to be addressed for 1.1.

I will have to let Cedric speak to the rest of the questions - I am by no
means a Tiles guru.

Craig

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