Hi Greg sorry for being late but I had to work hard yesterday afternoon.

Greg Reddin ha scritto:
Are you talking about readDefinitions(), addDefinitions(), etc. Could you post the changes you made to DefinitionsFactory and UrlDefinitionsFactory? I think that would give me a better idea of the impact.

You can see it at:
http://issues.apache.org/struts/browse/SB-28
Anyway I will show you an example. For "addDefinitions" now it has this signature:

public void addDefinitions(ComponentDefinitions definitions, TilesContext tilesContext)
           throws DefinitionsFactoryException;

The UrlDefinitionsFactory implementation simply takes the Locale out of TilesContext (with a simple tilesContext.getRequestLocale()) and the rest is unchanged.

The patch contains also a change in the way TilesContextFactory is designed, so that it is now a (potentially) configurable normal class.


XmlDefinitionsFactory (or whatever the class name is extended DefinitionsFactory, but added features that were really part of core Tiles functionality rather than simply part of an XML-based implementation. It seems we are doing the same thing here by putting some "core" functionality in a default implementation of the DefinitionsFactory. But maybe the UrlDefinitionsFactory is generic enough that it wouldn't matter.

I think XML dependency was removed since a generic DefinitionsReader is used. Anyway Dimensions' DefinitionsFactory is a subclass of UrlDefinitionsFactory.


But I think that most of the time addDefinitions() will be called at servlet init time and many of the components in TilesContext will not be available. But there are already cases where that situation exists.

If there is no TilesContext, probably there would not be a Locale either (but I could miss something) and the non-locale definitions are read by DefinitionsFactory.readDefinitions(). I don't get the point...

I hope that my patch is useful.
Ciao
Antonio

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

Reply via email to