You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Shing Hing Man <ma...@yahoo.com> on 2008/06/01 20:16:29 UTC
Tap 5.0.12 snapshot: How to access the application wide message catalog in a contribution
Hi,
In a contribution to a StrategyBuilder configuration, I would like to
access the application wide messaga catalog.
public static IComputeWorker buildComputeWorker(
Map<Class, IComputeWorker> configuration,
@InjectService("StrategyBuilder")
StrategyBuilder builder) {
StrategyRegistry<IComputeWorker> registry = StrategyRegistry
.newInstance(IComputeWorker.class, configuration);
return builder.build(registry);
}
public static void contributeComputeWorker(
MappedConfiguration<Class, IComputeWorker> configuration,
@InjectService("MaximaScriptExecuter")
IScriptExecuter maximaScriptExecuter,
Messages applWideCatalog) {
configuration.add(CrtBean.class, new CrtCW());
DerivativeCW derivativeCW = new DerivativeCW();
// Like to do : derivativeCW.setProperty(a value from applWideCatalog)
derivativeCW.setExecuter(maximaScriptExecuter);
configuration.add(DerivativeBean.class, derivativeCW);
Tex2ImCW tex2imWorker = new Tex2ImCW();
configuration.add(Latex2GifBean.class, tex2imWorker);
}
How to make the application wide catalog available in the above method contributeComputeWorker?
Thanks in advance for any assistance!
Shing
Home page : http://www.lombok.demon.co.uk/
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Tap 5.0.12 snapshot: How to access the application wide message catalog in a contribution
Posted by Shing Hing Man <ma...@yahoo.com>.
I have given up on the idea of accessing the application wide message catalog. Instead, I will store key/value pairs in the Application default symbol source and access the key/value pairs via the ApplicationDefaults
SymbolProvider.
public static void contributeComputeWorker(
MappedConfiguration<Class, IComputeWorker> configuration,
@InjectService("MaximaScriptExecuter")
IScriptExecuter maximaScriptExecuter,
@InjectService("ApplicationDefaults") SymbolProvider symbolProvider)
Shing
Home page : http://www.lombok.demon.co.uk/
--- On Mon, 2/6/08, Shing Hing Man <ma...@yahoo.com> wrote:
> From: Shing Hing Man <ma...@yahoo.com>
> Subject: Tap 5.0.12 snapshot: How to access the application wide message catalog in a contribution
> To: "tapestry Tapestry" <ta...@jakarta.apache.org>
> Date: Monday, 2 June, 2008, 2:16 AM
> Hi,
> In a contribution to a StrategyBuilder configuration, I
> would like to
> access the application wide messaga catalog.
>
>
> public static IComputeWorker buildComputeWorker(
> Map<Class, IComputeWorker> configuration,
> @InjectService("StrategyBuilder")
> StrategyBuilder builder) {
> StrategyRegistry<IComputeWorker> registry =
> StrategyRegistry
> .newInstance(IComputeWorker.class, configuration);
>
> return builder.build(registry);
> }
>
>
> public static void contributeComputeWorker(
> MappedConfiguration<Class, IComputeWorker>
> configuration,
> @InjectService("MaximaScriptExecuter")
> IScriptExecuter maximaScriptExecuter,
> Messages applWideCatalog) {
> configuration.add(CrtBean.class, new CrtCW());
>
> DerivativeCW derivativeCW = new DerivativeCW();
> // Like to do : derivativeCW.setProperty(a
> value from applWideCatalog)
>
> derivativeCW.setExecuter(maximaScriptExecuter);
>
> configuration.add(DerivativeBean.class, derivativeCW);
> Tex2ImCW tex2imWorker = new Tex2ImCW();
> configuration.add(Latex2GifBean.class, tex2imWorker);
>
> }
>
>
> How to make the application wide catalog available in the
> above method contributeComputeWorker?
> Thanks in advance for any assistance!
>
> Shing
>
>
> Home page : http://www.lombok.demon.co.uk/
>
>
>
>
> __________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail:
> users-help@tapestry.apache.org
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org