Justin Moore ha scritto:
I need some help - maybe a personal excerpt or a resource on the web
(document or book) that can talk about extending struts to load tiles
definitions from a database.  I assume that because this is an extensoin
point, I will be doing this via a plugin.

Not by a plugin but through a DefinitionsFactory. With Struts-Tiles (the current implementation) you can tell Tiles what is the DefinitionsFactory to use in struts-config.xml this way:
<snip>
 <plug-in className="org.apache.struts.tiles.TilesPlugin">
<set-property property="definitions-factory-class" value="name.of.your.definitions.factory.class"/>
<!-- All the rest-->
 </plug-in>
</snip>

Your DefinitionsFactory must implement the DefinitionsFactory interface (in your case I won't suggest to extend DefinitionsFactory class because it seems to be tightly coupled to the use of XML) or maybe should extend FactorySet class, in case you need to use some sort of a key to differentiate between DefinitionsFactories.
Tiles by default has a
RuleSet that uses a digester to load all the tiles defs from an xml
definition.  I need to be able to data drive these definitions that the
framework will utilize.  My thinking was that I would keep my defintions
in a table load them on application start via the init call and cache
the bindings in memory.

You could use DefinitionsFactory.init method. Maybe you could put a DataSource in ServletContext. In this case you could write a plugin that loads before Tiles loads, puts a DataSource configured somewhere in your ServletContext, then let Tiles load, that loads your DefinitionsFactory that can reach the DataSource.... pheeeww it is a long run!
Has anyone done this or can point me to where I can find more about
this?

I did not use a DB to store my Tiles definitions, anyway you could check Dimensions to see how to extend Struts Tiles:
http://mutidimensions.sf.net/
Anyway notice that soon Standalone Tiles will be released and it will have a new way to load definitions (I think it's better).
HTH
Ciao
Antonio


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

Reply via email to