cancel
Showing results for 
Search instead for 
Did you mean: 

wizard framework and file upload

strinchero
Champ in-the-making
Champ in-the-making
Hello,
i defined a new type, created the action to & wizard to create it, without problems. Now, i need to upload a file, and i need to do it on the some page on wich are the object properties (customer explicit request).

Correct me if i'm wrong, but since the upload of a file requires a special form, i can't mix it with the other properties. Wich approach do you suggest to solve that ?

I thought of using your servlet as a 'bridge' encoding the form paramenters on the 'return-page' parameter, so that the upload manages the file, then the return-page carries on the other fields… can something like that work, and be considered a good solution ?

thanks in advance for any answer
4 REPLIES 4

gavinc
Champ in-the-making
Champ in-the-making
Hi,

I'm not sure your approach would work with JSF as it does not support parameters being passed on a GET request, which is what you'd be doing if you pass them on using the return-page parameter.

I would recommend looking at the add-content-dialog.jsp in the /jsp/content folder as a way to mix properties and the special upload form, however, the upload field will either have to be at the start or end of the form as you probably know.

Another solution is to use the MyFaces fileupload component in your application, this will depend on whether you need to support portals though (the reason for having the special upload form). If you don't need to support portals the file upload component in MyFaces could be used to intermix the properties and file.

Hope that helps.

strinchero
Champ in-the-making
Champ in-the-making
Hi,

I'm not sure your approach would work with JSF as it does not support parameters being passed on a GET request, which is what you'd be doing if you pass them on using the return-page parameter.

On top of that, it's not exaclty an elegant solution…

I would recommend looking at the add-content-dialog.jsp in the /jsp/content folder as a way to mix properties and the special upload form, however, the upload field will either have to be at the start or end of the form as you probably know.

Having the upload file ant the and of the form is perfectly acceptable, but add-content-dialog mimic a 2-steps  wizards (please correct me if i'm wrong…), wich is against our customer request: he wants to one-click submit the whole forrm.

application, this will depend on whether you need to support portals though

The finished applcation will be run into a portal container, Liferay probably, so even that solution is not applicabile. I can use the apapche-commons fileupload classes, i will check if JSF can parse multipart forms (i'm new to the jsf world)

Thanks for your prompt answers

strinchero
Champ in-the-making
Champ in-the-making
I have found that bug report:
http://issues.apache.org/jira/browse/MYFACES-434

wich refers to this:
http://palab.blogspot.com/2006/09/myfaces-bridge-08-released.html

It's a bridge to allow Myfaces filters to do their job when used with portletes, and it looks like it will be merged into myfaces.
You see any problem in using something like that with alfresco in a portal environment ?

kevinr
Star Contributor
Star Contributor
We have been waiting for this to allow us to implement multi-file upload in both the servlet and portlet world. It's been a shame that we haven't been able to do it up to till. We have some nice solutions for the servlet world, including auto-form submit after a file upload (e.g. removing the extra UI step the user is required to make) but we haven't added it to the codeline as it doesn't yet work in the Portal world.

Thanks,

Kevin