I actually did this exact same thing and used stitches for it. Person
registers and uploads their image. My library will resize the image in
different formats to be used by the imagedisplay components in the tapestry
pages. One thing to remember is that outputting gif images is tricky, and I
gave up after a day, and just output the resized gif as a jpg (the display
component will take this account, it's all behind the scenes).
One cool thing is that the stitches image display component will display the
full path of the image if the image was uploaded onto different server. For
example, say someone goes and uploads the image on production, and you want
to view the image using a tapestry app on a different server, the image
component will construct the url properly to point to the other server.
The app that I wrote that does all this image stuff is at
http://www.visitpa.com/visitpa/page.svc?page=PlaylistHome You will have to
register for an account and create a playlist to see the ajax stuff (just a
copy for's and updates) All the image displays are using the image display.
It's not bug free, we haven't promoted it yet....
One final thing is that each user now has their own "library" of images that
they upload to and can choose to use for profile, etc.. The imagedisplay
takes a parameter of the image siz ethey want to display.
Images are on the file system (not in db)
http://stitches.authsum.org
----- Original Message -----
From: "Brian Long" <[EMAIL PROTECTED]>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Wednesday, November 29, 2006 5:51 AM
Subject: dynamic image assets?
Hi,
I'm sure there's a simple solution to this problem, but I've yet to figure
out just what it is!
I have an image associated with each subscriber that registers with my
application, and on login I'd like to show them their picture along with
their subscriber details.
I know I can add an asset to the .page and have the Image component pick
this up and display it
<asset name="subscriber" path="/tmp/subscriber.gif" />
<component id="subscriberImage" type="Image">
<binding name="image" value="getAsset('subscriber')">
</component>
The problem with this is that if I have 1000 subscribers, I need 1000
assets
in my .page. I would like to store the image location as a property of my
subscriber data object and retrieve the asset like this:
<component id="subscriberImage" type="Image">
<binding name="image" value="getAsset('ognl:subscriber.pathToImage
')">
</component>
Unfortunately, tapestry won't evaluate the ognl expression in the getAsset
method call, and I get an error "value for parameter image in component is
null and a non-null value is required". If someone has a solution to this,
I'd be interested the hear about it.
Regards, Brian.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]