views:

201

answers:

1

Using the 3rd party tapestry-upload component, I can upload a File from the client on the server.

Using the chenillekit's thumbnail component, a can make a thumbnail from an Asset.

How can I convert my File into an Asset in order for the Thumbnail component to provide me the image thumbnail ?

A: 

There are a few threads on the mailing list that deal with this. Basically, you need to contribute a custom AssetFactory that reads the image from disk (or the database). You might also look at URIAssetFactory which is part of ChenilleKit itself.

Here are a few links to help:

https://issues.apache.org/jira/browse/TAP5-423

http://www.mail-archive.com/[email protected]/msg33692.html

Brian Deterling
Thanks, this seems to be the good way, but it's a shame it requires patching Tapestry (I've looked at the patch, there is a lot of added files, but there are also some changes in the Tapestry code :( ).I would have no problem providing some kind of new module and tell Tapestry to use it, but I don't want to do some patch on the Tapestry jar I use (because I don't want to maintain it internally!).
temsa
It should be possible to contribute your own asset type without having to modify the core code. I think the JIRA was to try to get it added to the base product so other people wouldn't have to roll their own, but it doesn't seem to have worked yet.
Brian Deterling