Re: merging global message catalogs T5.2.5 (SOLVED)
Hi Thiago! thanks, it's solved (see my mail based on Igor's sample) Jens Am 10.08.11 21:07, schrieb Thiago H. de Paula Figueiredo: On Wed, 10 Aug 2011 13:09:38 -0300, Jens Breitenstein wrote: Hi Thiago! Hi! puh, this is more a less a real time chat not a mailinglist :-) That's definetely a plus of Tapestry. :) thanks for your answer, I tried it but it is not working. a) my global props are back (good 90% "missing keys" gone!!) b) my XY properties are now missing (10% back..) I know that there is a lot of hidden magic in T5 but how should the configuration. add assume it's a 2nd global message catalog when omiting the global message catalog key...? In this case there's not magic really. I can't check the Tapestry sources right now, but, as far as I can remember, the catalogs are chained: when a given key is not found in one, it checks its parent catalog. Have you tried adding "after:*" or "before:*" as sorting constraint in configuration.add()? - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: merging global message catalogs T5.2.5
On Wed, 10 Aug 2011 13:09:38 -0300, Jens Breitenstein wrote: Hi Thiago! Hi! puh, this is more a less a real time chat not a mailinglist :-) That's definetely a plus of Tapestry. :) thanks for your answer, I tried it but it is not working. a) my global props are back (good 90% "missing keys" gone!!) b) my XY properties are now missing (10% back..) I know that there is a lot of hidden magic in T5 but how should the configuration. add assume it's a 2nd global message catalog when omiting the global message catalog key...? In this case there's not magic really. I can't check the Tapestry sources right now, but, as far as I can remember, the catalogs are chained: when a given key is not found in one, it checks its parent catalog. Have you tried adding "after:*" or "before:*" as sorting constraint in configuration.add()? -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: merging global message catalogs T5.2.5
Wished I found that in your book (or I missed it?) Many thanks Igor, it works.. for all of you having the same problem. This is the contrib section based on Igor's solution: @Contribute(ComponentMessagesSource.class) public static void provideMessages(final @Value("/de/domain/client/xy.properties") Resource resource, final OrderedConfiguration configuration) { configuration.add(SymbolConstants.APPLICATION_CATALOG + ".XY, resource); } CU Jens Am 10.08.11 18:20, schrieb Igor Drobiazko: You can contribute as many catalogs as you want. See the contribution to the ComponentMessagesSource service here: https://github.com/drobiazko/tapestry5inaction/blob/master/showcase/src/main/java/com/tapestry5inaction/services/AppModule.java On Wed, Aug 10, 2011 at 5:52 PM, Jens Breitensteinwrote: Hi all! We have a WebApp and are currently developing a more or less similar App with extended / slightly changed functionality (yes a customized versision). Instead of C&P we use inheritance through all technical layers (starting from Hibernate-DB over Spring-Services to T5-classes) to implement our changes which works just perfect. Perfect beside reuse / extending the global message catalog. Contribution of a second message catalog via public static void contributeApplicationDefaults(**final MappedConfiguration configuration) { configuration.add(**SymbolConstants.APPLICATION_**CATALOG, "xy.properties"); } fails, because T5 complains that the key already exists... Unfortunately I have to admit T5 is right in complaining :-) "override" is not an option as we loose our existing catalog thus 90% of the inherited UI shows "missing key". I want to avoid the pain of page / component based messages if possible. Is there any way to merge catalogs between all *Modules? Do I have to override an internal T5 service and if so which one?? Or do I really have to C&P all properties??? Any idea or hint is welcome Thanks in advance Jens --**--**- To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org For additional commands, e-mail: users-h...@tapestry.apache.org - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: merging global message catalogs T5.2.5
You can contribute as many catalogs as you want. See the contribution to the ComponentMessagesSource service here: https://github.com/drobiazko/tapestry5inaction/blob/master/showcase/src/main/java/com/tapestry5inaction/services/AppModule.java On Wed, Aug 10, 2011 at 5:52 PM, Jens Breitenstein wrote: > Hi all! > > We have a WebApp and are currently developing a more or less similar App > with extended / slightly changed functionality (yes a customized versision). > Instead of C&P we use inheritance through all technical layers (starting > from Hibernate-DB over Spring-Services to T5-classes) to implement our > changes which works just perfect. Perfect beside reuse / extending the > global message catalog. Contribution of a second message catalog via > >public static void contributeApplicationDefaults(**final > MappedConfiguration configuration) >{ >configuration.add(**SymbolConstants.APPLICATION_**CATALOG, > "xy.properties"); >} > > fails, because T5 complains that the key already exists... Unfortunately I > have to admit T5 is right in complaining :-) > > "override" is not an option as we loose our existing catalog thus 90% of > the inherited UI shows "missing key". I want to avoid the pain of page / > component based messages if possible. Is there any way to merge catalogs > between all *Modules? Do I have to override an internal T5 service and if so > which one?? Or do I really have to C&P all properties??? > > Any idea or hint is welcome > > Thanks in advance > > > Jens > > > > > --**--**- > To unsubscribe, e-mail: > users-unsubscribe@tapestry.**apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > -- Best regards, Igor Drobiazko http://tapestry5.de
Re: merging global message catalogs T5.2.5
On Wed, 10 Aug 2011 12:52:00 -0300, Jens Breitenstein wrote: Hi all! Hi! public static void contributeApplicationDefaults(final MappedConfiguration configuration) { configuration.add(SymbolConstants.APPLICATION_CATALOG, "xy.properties"); } Have you tried something like configuration.add("myproperties", "xy.properties")? Your code is trying to add a second contribution with the same id, so use another. :) -- Thiago H. de Paula Figueiredo Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, Ars Machina Tecnologia da Informação Ltda. http://www.arsmachina.com.br - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
merging global message catalogs T5.2.5
Hi all! We have a WebApp and are currently developing a more or less similar App with extended / slightly changed functionality (yes a customized versision). Instead of C&P we use inheritance through all technical layers (starting from Hibernate-DB over Spring-Services to T5-classes) to implement our changes which works just perfect. Perfect beside reuse / extending the global message catalog. Contribution of a second message catalog via public static void contributeApplicationDefaults(final MappedConfiguration configuration) { configuration.add(SymbolConstants.APPLICATION_CATALOG, "xy.properties"); } fails, because T5 complains that the key already exists... Unfortunately I have to admit T5 is right in complaining :-) "override" is not an option as we loose our existing catalog thus 90% of the inherited UI shows "missing key". I want to avoid the pain of page / component based messages if possible. Is there any way to merge catalogs between all *Modules? Do I have to override an internal T5 service and if so which one?? Or do I really have to C&P all properties??? Any idea or hint is welcome Thanks in advance Jens - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org