Re: [Wicket-user] Image upload

2006-06-30 Thread Richard Livingstone
I guess the same can be provided for file links. For example, I am writing a demo application using Wicket for an online voting application for a UK broadcaster and one of the outputs is a file which gets emailed out to a user. I also want it to be accessible from a link (at the moment it exists

Re: [Wicket-user] Image upload

2006-05-06 Thread Eelco Hillenius
Though that will only work when your servlet container is configured to have access to that directory as one to serve files from, right? Eelco On 5/6/06, Timo Stamm [EMAIL PROTECTED] wrote: Igor Vaynberg schrieb: so what you need is something that maps to some url and when invoked streams

Re: [Wicket-user] Image upload

2006-05-06 Thread Timo Stamm
Eelco Hillenius schrieb: Though that will only work when your servlet container is configured to have access to that directory as one to serve files from, right? No, you can deliver files from anywhere Java has access to. The example was copied from production code. Timo On 5/6/06, Timo

Re: [Wicket-user] Image upload

2006-05-06 Thread Eelco Hillenius
What I meant is that it only concerns paths in the scope of the servlet context. And the problem with that is that you can't be sure you have access to that and/ or that that's a normal file system (it might be from a zip or jar/war). So you code might work for absolute paths outside the servlet

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
Hi Philip,Thanks so much for the sample code and wiki entry...it makes a lot of sense, however, it is a little bit of overkill for the app I built. You gave me a bazooka to take to a gun-fight!Really, what it comes down to is; I need to turn the byte array I'm pulling out of the file system and

Re: [Wicket-user] Image upload

2006-05-05 Thread Igor Vaynberg
this is already described in philip's wiki article under download image sectionwhat you want is a stripped down version of the image resource:public class ImageResource extends DynamicWebResource{ // CONSTANTS public static final Log logger = LogFactory.getLog(ImageResource.class); private

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
OK, the last part is what I think was missing. Wow, that's rather confusing for referencing a resource outside of the web app root.I'll see what I can do, thanks!On 5/5/06, Igor Vaynberg [EMAIL PROTECTED] wrote: this is already described in philip's wiki article under download image sectionwhat

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
I guess I'm still a little lost here. Why would I need to use a querystring to build the string? Do I? I'm thinking not.I'm not generating thumbnails...my version of this is much, much, much smaller. I'm uploading images to a pre-defined, static location. That part works great, no problems there.

Re: [Wicket-user] Image upload

2006-05-05 Thread Igor Vaynberg
hmmis the static location accessible from the web?!?!?!?-IgorOn 5/5/06, Vincent Jenks [EMAIL PROTECTED] wrote:I guess I'm still a little lost here. Why would I need to use a querystring to build the string? Do I? I'm thinking not. I'm not generating thumbnails...my version of this is much, much,

Re: [Wicket-user] Image upload

2006-05-05 Thread Philip A. Chapman
I added a section Registering and Using the Image Resource that documents how to register and use the ImageResource. On Fri, 2006-05-05 at 09:00 -0700, Igor Vaynberg wrote: this is already described in philip's wiki article under download image section what you want is a stripped down

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
Obviously not...or we wouldn't be having this conversation. It's a folder outside of the webroot.I'd have a list of strings, basically, to the effect of:C:\\app\\images\\img1.gifC:\\app\\images\\img2.gif C:\\app\\images\\img3.gif C:\\app\\images\\img4.gifI may just start storing them as blobs in

Re: [Wicket-user] Image upload

2006-05-05 Thread Philip A. Chapman
You don't *have* to use the ImageService. You can make the ImageResource fatter if you need. I documented the ImageService simply because that's what I have already and I think that using services is generally a good idea. On Fri, 2006-05-05 at 10:56 -0600, Vincent Jenks wrote: I guess I'm

Re: [Wicket-user] Image upload

2006-05-05 Thread Igor Vaynberg
so what you need is something that maps to some url and when invoked streams the image back to the user.i see two possible ways to do thisone:use a separate servlet to do thistwo:use a wicket shared resource in both approaches the code will be 90% identicalwhat you need is to somehow tell this

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
Once I do, is this something that should be added to Wicket? Using the uploader for what I'm doing, which I'd imagine would be fairly common, sort of sucks w/o the other half of itthe ability to call those images from non-web folders. On 5/5/06, Igor Vaynberg [EMAIL PROTECTED] wrote: so what

Re: [Wicket-user] Image upload

2006-05-05 Thread Igor Vaynberg
sure, it depends on how general you end up making it. i think we have sufficient infrastructure in wicket already, so maybe what is needed the most is a wiki example that is far less complicated then the one philip posted and a thin wrapper around our dynamic resource that streams a file from some

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
Ahh...I got it workingand yeah it was far easier once you guys showed me how to actually call the image as a resource. I was getting the byte[] all along w/o a problem...it was the display that I wasn't familiar with. I *really* stripped Philip's example down to the bare metal...but I can

Re: [Wicket-user] Image upload

2006-05-05 Thread Vincent Jenks
Yeah, exactly, just a shortcut component to do this or like you said, a realy basic wiki example - which I'd be happy to contribute once I get this cleaned up a little?On 5/5/06, Igor Vaynberg [EMAIL PROTECTED] wrote: sure, it depends on how general you end up making it. i think we have

Re: [Wicket-user] Image upload

2006-05-05 Thread Igor Vaynberg
sounds good! and thanks-IgorOn 5/5/06, Vincent Jenks [EMAIL PROTECTED] wrote: Yeah, exactly, just a shortcut component to do this or like you said, a realy basic wiki example - which I'd be happy to contribute once I get this cleaned up a little? On 5/5/06, Igor Vaynberg [EMAIL PROTECTED] wrote:

Re: [Wicket-user] Image upload

2006-05-05 Thread Timo Stamm
Igor Vaynberg schrieb: so what you need is something that maps to some url and when invoked streams the image back to the user. i see two possible ways to do this one: use a separate servlet to do this public class WeblibServlet extends HttpServlet { private static final String base =

Re: [Wicket-user] Image upload

2006-05-02 Thread Philip A. Chapman
How was it? Do I need to make any edits to make it easier to understand? On Mon, 2006-05-01 at 11:28 -0600, Vincent Jenks wrote: I'll read through this, thanks a ton! On 5/1/06, Philip A. Chapman [EMAIL PROTECTED] wrote: Sorry for the delay, but I spent the time

Re: [Wicket-user] Image upload

2006-05-02 Thread Vincent Jenks
I honestly haven't had the opportunity to integrate it into my app yet. I'm going to have to pick it apart a bit to conform to my shopping cart.I'll probably rip into it today sometime and I'll post my progress. I really appreciate the hand, thanks!On 5/2/06, Philip A. Chapman [EMAIL PROTECTED]

Re: [Wicket-user] Image upload

2006-05-01 Thread Vincent Jenks
This all sounds fantastic to me...and I'm sure it's second nature to you...but means nothing to me ;) I've never used struts. Is there an example in wicket-examples? It's not obvious to me if there is one in there. Sorry for the hand-holding but I'm not at all familiar w/ this concept yet.

Re: [Wicket-user] Image upload

2006-05-01 Thread Igor Vaynberg
yes, thats it.basically you would create a that resource that takes the filename/fileid/whatever off the url and streams the file. there is an example of this, i will ask one of my friends to post it here. stay tuned. -IgorOn 5/1/06, Vincent Jenks [EMAIL PROTECTED] wrote: Did you mean to say

Re: [Wicket-user] Image upload

2006-05-01 Thread Philip A. Chapman
Sorry for the delay, but I spent the time to create a wiki page so that hopefully others can benefit from what little I have to say on the subject: http://www.wicket-wiki.org.uk/wiki/index.php/UploadDownload On Mon, 2006-05-01 at 08:01 -0700, Igor Vaynberg wrote: yes, thats it.

Re: [Wicket-user] Image upload

2006-05-01 Thread Vincent Jenks
I'll read through this, thanks a ton!On 5/1/06, Philip A. Chapman [EMAIL PROTECTED] wrote: Sorry for the delay, but I spent the time to create a wiki page so that hopefully others can benefit from what little I have to say on the subject:

Re: [Wicket-user] Image upload

2006-04-28 Thread Vincent Jenks
What is this going to do to speed/scalability? This is for a shopping cart and these images will be what the users see on the first (and busiest) page of the app. On 4/27/06, Johan Compagner [EMAIL PROTECTED] wrote: WebDynamicResource is new in the latest 1.2 releases just a rename of

Re: [Wicket-user] Image upload

2006-04-28 Thread Igor Vaynberg
not much. if you used struts you would build it the same way.-IgorOn 4/28/06, Vincent Jenks [EMAIL PROTECTED] wrote:What is this going to do to speed/scalability?This is for a shopping cart and these images will be what the users see on the first (andbusiest) page of the app.On 4/27/06, Johan

Re: [Wicket-user] Image upload

2006-04-27 Thread Vincent Jenks
I definitely don't want to use blobs Where can I find an example of doing what I need using WebDynamicResource? I don't even see this class listed in the 1.2 Javadoc... Where do I start? Thanks! On 4/21/06, Eelco Hillenius [EMAIL PROTECTED] wrote: wicket-contrib-examples of wicket-stuff

Re: [Wicket-user] Image upload

2006-04-27 Thread Johan Compagner
WebDynamicResource is new in the latest 1.2 releasesjust a rename of DynamicByteArrayResourcejust make a ResourceState (inner class of DynamicByteArrayResource)and in getDate() you lazy load youre byte array from somewhere johanOn 4/27/06, Vincent Jenks [EMAIL PROTECTED] wrote: I definitely don't

[Wicket-user] image upload

2006-04-26 Thread Vincent Jenks
I'm sure this has been asked before but I couldn't find an example. I'm using JBoss 4 and Wicket 1.2RC2...and I'm trying to upload images into a specific folder inside of a deployed .ear project. The folder in the web app would be /ear-name/assets/images However, that folder doesn't exist after

Re: [Wicket-user] image upload

2006-04-26 Thread Igor Vaynberg
can you upload into the ear's unpacked folder? is that safe, will images still be there after you redeploy?usually you set a dir that you want to use that is outside the webserver, ie d:/assets/myapp/images and you pass that as a config param to your app. -IgorOn 4/26/06, Vincent Jenks [EMAIL

Re: [Wicket-user] image upload

2006-04-26 Thread Johan Compagner
you only have one directorly (besides tmp dir of java) where you can save youre files if you don;t have full control over youre app server:javax.servlet.context.tempdirsee http://tomcat.apache.org/tomcat-4.1-doc/config/host.htmljohanOn 4/26/06, Vincent Jenks [EMAIL PROTECTED] wrote:I'm sure this

Re: [Wicket-user] image upload

2006-04-26 Thread Igor Vaynberg
but again thats a temp directory, your prob dont want to use it for persistent files.-IgorOn 4/26/06, Johan Compagner [EMAIL PROTECTED] wrote:you only have one directorly (besides tmp dir of java) where you can save youre files if you don;t have full control over youre app server:

Re: [Wicket-user] Image upload

2006-04-22 Thread Eelco Hillenius
wicket-contrib-examples of wicket-stuff has the cdapp example that does this. It uses hibernate and stores uploaded images in the database as a blob. Eelco On 4/21/06, Steve Knight [EMAIL PROTECTED] wrote: I am creating a form that will allow users to upload image files that will be displayed

[Wicket-user] Image upload

2006-04-21 Thread Steve Knight
I am creating a form that will allow users to upload image files that will be displayed on other pages. How should I go about uploading the images so that they can be used in Wicket Image components on the other pages? The upload part is not problem, I just don't know where I should put them. On

Re: [Wicket-user] Image upload

2006-04-21 Thread Johan Compagner
you could save those images to a DB or to a working dir on the server.Then have a DynamicByteArrayResource or the 1.2 one: WebDynamicResource to load the image from the location you stored the image.johan On 4/21/06, Steve Knight [EMAIL PROTECTED] wrote: I am creating a form that will allow users

Re: [Wicket-user] Image upload

2006-04-21 Thread Nick Heudecker
I do this and save the files off to a working directory on the server, while the metadata is stored in the database. I didn't know about WebDynamicResource, so I wrote a simple servlet filter to handle it for me. On 4/21/06, Johan Compagner [EMAIL PROTECTED] wrote: you could save those images to a