Ajax upload - expert help needed

View: New views
1 Messages — Rating Filter:   Alert me  

Ajax upload - expert help needed

by lodewijkdans :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am pretty new to Wicket, yet not new to development and the web (at all). I want to hear your advise on the following functionality which I intend to build using Wicket:

I want to make two components that work together through ajax.

1) The first is an upload component that instead of sending its the upload to an iframe sends its information to a normal hidden frame. This enables the user to keep on browsing the website without having to wait for the upload to finish.

2) The second is an ajax status component that informs the user of the status of his or her ajax process, e.g. their upload. The upload components is thus dependent on the upload component.

I envision it like this:

* the user starts the upload and the upload process start as an ajax process in the hidden frame
* the upload ajax process is registered in a process pool on the server as a running event for a particular user (based on their session)
* the user receives a cookie that tells the browser that it should poll for updates on an ajax event
* a running timer in the browser detects the cookie and when it does it sends a polling request to the server for a status update
* when the server receives the status update request, it checks its pool of running processes to see if their is a process running for that particular user. If so it returns a json object that the ajax status component translates into a message, e.g. "upload 51% complete".
* when the process is complete the client side polling mechanism writes its final message to the client after which the the cookie is removed or emptied and the process removed from the pool.

I want to include error handling and process timeouts.

Question: which parts of Wicket can I (re)use for this plan?
 - I have seen the AjaxBehaviour object and see a use for it. Does somebody have a suggestion on how?
 - I have seen the UploadComponent and studied it a bit, but decided to only reuse some of the code via copy-paste.
 - Is there a pool object for processes I could use in Wicket? Is there a good way of integrating the pool with the wicket Application?

Many thanks for your replies,

lobo
 
LightInTheBox - Buy quality products at wholesale price!