Hi,

I've implemented a working solution using the method on this page:

http://wiki.apache.org/tapestry/Tapestry5HowToReadSymbolsFromPropertiesFile
I implemented a SymbolProvider, a buildFileSymbolProvider method and a 
contributeSymbolSource method.

How is your method different from that one? Should I prefer your method? What 
will happen when I use my method?

Regards,
Daniel P.

-----Ursprüngliche Nachricht-----
Von: Thiago H de Paula Figueiredo [mailto:thiag...@gmail.com] 
Gesendet: Dienstag, 28. Juli 2015 16:56
An: Tapestry users
Betreff: Re: Contributing a Symbol Provider

On Tue, 28 Jul 2015 10:31:55 -0300, Poggenpohl, Daniel 
<daniel.poggenp...@isst.fraunhofer.de> wrote:

> Hello,

Hi!

> I want to provide additional configuration on startup to my Tapestry 
> application. I want to store the additional configuration in a file 
> containing lines "key=value".
> I know I can contribute a symbol provider to load a file and access 
> the symbols this way.
>
> But I can't find the documentation for
> - How to write a Symbol Provider

Implement the SymbolProvider interface. It has a single method, String 
valueForSymbol(String symbolName). It should return a String if that 
implementation provides a value for that symbol name and null if not.

> - what method to write in the AppModule to contribute the Symbol 
> Provider

public static void
contributeSymbolProvider(OrderedConfiguration<SymbolProvider>
configuration) {
        configuration.add("MyProvider", new YourSymbolProviderImplementation(),
"before:*");
}

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to