If getMessages() is already implemented, the enhancement worker shouldn't try to create the method. Have you tried just overriding getMessages()?
-----Original Message----- From: Paul Cantrell [mailto:[EMAIL PROTECTED] Sent: Monday, May 15, 2006 12:36 PM To: Tapestry users Subject: Re: component that will get localized resources from database? There is no obligation to use Hivemind if it is not appropriate to your problem. Hivemind is useful for decoupling parts of the system, and for making "aspecty" customization that cut across the framework. If you don't need decoupling, and don't need to customize across the whole framework, perhaps you don't need to bother with Hivemind. So there may be a Hivemind way to inject a different message worker into only certain classes, but I would guess overriding getMessages() is probably just fine. Did you try it? Does it work? Is it simple? If so, no worries! Cheers, P On May 15, 2006, at 10:57 AM, Lutz Hühnken wrote: > Hi there, > > assume you want to create a localized tapestry application, but there > are localized messages that you don't want to store in a properties > file / text file. > > In a plain Java application, you could just write your own > implementation of ResourceBundle, that could take the messages from > anywhere, e.g., a database, and use that instead of > PropertyResourceBundle. > > With Tapestry, it seems to be more complicated, though. If I > understand correctly, the "AbstractComponent" is "enhanced" by an > "InjectMessagesWorker", as defined in "tapestry.enhance.xml". The > "InjectMessagesWorker" will inject a getMessages() method that will > return the result of ComponentMessagesSource.getMessages(IComponent). > > Now, that's not what I want... > > A straight-forward approach would be to override "getMessages()" in my > own component. Would that work? To me it seems to collide with the > Hivemind enhancement/injection approach. > > Alternatively, I could probably change the InjectMessagesWorker to > something of my own liking. But that would affect *all* components > (that inherit from AbstractComponent), while I would like the modified > behaviour just for my own. Plus, I don't really want to mess with the > "tapestry.enhance.xml", since it is part of the packaged Tapestry > distribution. > > So what would be the proper way to do it? Can I override the > "inject-messages" command from "tapestry.enhance.xml" for my own > components? How? > > Thanks in advance, > > Lutz > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > _________________________________________________________________ Piano music podcast: http://inthehands.com Other interesting stuff: http://innig.net --------------------------------------------------------------------- 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]
