On Fri, 01 Aug 2014 09:41:18 -0300, Stephan Windmüller <[email protected]> wrote:

I had a look at the implementation of TapestryModule and had the feeling
that the MasterObjectProvider only covers global objects without a
reference to the calling component. Did I miss something?

I believe you're right. MasterObjectProvider is Tapestry-IoC level, not Tapestry(-core) level. For component-aware injection, you'd need to write a ComponentClassTransformWorker.

What we did now is introducing a new axis (the product line) for the
component resource locator as explained in [0]. A custom
PageRenderRequestFilter parses the activation context and sets the
current product line. The modified resource locator then adds the
modified property-files to the list of parsed resources. This way we can
add a new product-line easily just by adding files like
"Component-productlinename(_locale).properties" which only override
specific keys. The advantages are:

- No more setting the product line in onActivate
- Same keys in all property-files
- Same message prefix as before, existing code does not have to be
  changed
- Works for both TML expressions and injected messages
- Product lines may be added by adding a JAR file to the classpath

We are currently preparing an example application based on the Maven
archetype. I can post the link once it is available, if you are interested.

I really, really like this solution. I had totally forgot about template skinning and axis. Thanks for sharing this! :)

Again, thank you very much for your continued support on this mailing
list, it is greatly appreciated!

;)

--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to