Em Tue, 18 Nov 2008 18:19:24 -0300, aldana <[EMAIL PROTECTED]> escreveu:
But I cannot find the last step to ad it to the viable AssetSource. By
default it seems that AssetSourceImpl is active which only supports
context and classpath style. So how do I ad my new Asset type to the
AssetSource and how do I register so I can use something like
@Path("filesystem:/foo/bar.png") annotation?
You do it through a contribution to the AssetSource service through
Tapestry-IoC. In a module class, add the following method:
public static void contributeAssetSource(MappedConfiguration<String,
AssetFactory> configuration) {
configuration.add("filesystem", yourFilesystemAssetFactory);
}
To know how something in Tapestry is configured, take a look at the
TapestryModule class and search for the contribute[ServiceName]() methods.
For example, the AssetSource is configured exactly like this:
public void contributeAssetSource(MappedConfiguration<String,
AssetFactory> configuration,
@ContextProvider AssetFactory
contextAssetFactory,
@ClasspathProvider AssetFactory
classpathAssetFactory)
{
configuration.add("context", contextAssetFactory);
configuration.add("classpath", classpathAssetFactory);
}
manuel aldana
software-engineering blog: http://www.aldana-online.de
Just curious: your name is very Portuguese but your URL and university
information in your site is German . . . :)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]