EasyUploads add-on

AFAIK the html5 spec (and browsers as well) has some limitations on this array :frowning: Multiple files are supported, but not multiple files inside folders (or a hierarchy of folders). But, its been long time since I worked on this area, so things might have changed. If you find a way to do that, I’m sure we can hack that for EasyUploads too.

cheers,
matti

From
this
thread it seems that there’s no way. It makes sense security wise. I’ll work around it with training I guess.

I’m not an HTML wiz but from the
working standard
it seems to be supported. If I understood it correctly File interface is just a name and the data. I don’t know why that couldn’t accommodate a folder. If this is supported or not in the current browsers is a different thing.

A couple more requirements:

  1. Ability to set the text displayed in getAreaText() (for internationalization purposes)
  2. Type of listener interface to listen to events (i.e. do something when the uploads are done like closing a window or displaying a message)

No, not the server. The problem appears to be on the client side. As a non administrative user, the file upload doesn’t work, but as an administrator (on the same machine), the file upload works fine.

Hello,

I’m trying to use this Widget with Maven.

I followed Vaadin tutorials to install the addon:

Tuto

First :
I’m able to build my project with mvn vaadin:update-widgetset install
Final message is Build Successful but during compilation I got :


[INFO]
 Updating widgetset fr.maatg.pandora.clients.data.management.portlet.EasyUploadsWidgetSet
[ERROR]
 Nov 16, 2011 11:34:41 AM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
 INFO: Widgetsets found from classpath:
[ERROR]
 	com.vaadin.terminal.gwt.DefaultWidgetSet in jar:file:/home/nicolas/.m2/repository/com/vaadin/vaadin/6.7.1/vaadin-6.7.1.jar!/
[ERROR]
 	org.vaadin.easyuploads.EasyuploadsWidgetset in jar:file:/home/nicolas/.m2/repository/org/vaadin/addons/easyuploads/0.4.9/easyuploads-0.4.9.jar!/
[ERROR]
 	fr.maatg.pandora.clients.data.management.portlet.EasyUploadsWidgetSet in file:/home/nicolas/workspace_git/data-management-portlet/src/main/java
[ERROR]
 
[ERROR]
 Nov 16, 2011 11:34:41 AM com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer getAvailableWidgetSets
[ERROR]
 INFO: Search took 5ms

I found on this forum that it seems to be normal with Maven. Can you confirm it ?

Then :
I deploy my portlet.
In my application, I just added this to my window:


    private UploadField uploadField;
    private MultiFileUpload multifileUpload;
    
    public Panel initPanelAndUploadField() {
    	Panel mainPanel = new Panel("Test Easy-Upload");
    	
    	mainPanel.setHeight("500px");
    	mainPanel.setWidth("1000px");
    	
    	multifileUpload = new MultiFileUpload() {
			private static final long serialVersionUID = 1L;
			@Override
			protected void handleFile(File file, String fileName, String mimeType, long length) {
				// TODO Auto-generated method stub
			}
		};
		multifileUpload.setUploadButtonCaption("Button Upload");
		multifileUpload.setWidth("900px");
		mainPanel.setContent(multifileUpload);
		return mainPanel;
    }

This is what I have when I launch my portlet:
http://img818.imageshack.us/img818/409/screenshotce.jpg

Can you help me ?

Thanks,
Regards.
Carl

Hi,

I guess you have “typical” issue with portals + Vaadin. In portals Vaadin apps most often use shared portal wide widget set. This is to limit the js and css stuff that needs to be loaded in cases where you have several Vaadin portlets in a portal. You should update that shared widget set to contain easy upload add-ons client side extensions.

If you are using Liferay, you could use this helper:
http://vaadin.com/directory#addon/vaadin-control-panel-for-liferay

Otherwise you need to update that widget set manually. I hope there is some instructions for that in the book or in wiki.

cheers,
matti

Thank you so much. I added this portlet and it seems be working :wink: .

Regards,
Carl.

Just a question:
You mentioned the Book and Wiki : where can I find it ? Is there any examples about manipulating this component ?
I looked for on Vaadin’s WebSite but didn’t find examples for this component.

Regards.


Book


Wiki

Hi,

I meant from the Book and Wiki you should find instructions how to deal with Vaadin Add-Ons in general. The EasyUploads add-on itself is my personal “hobby project”. Most of my enthusiasm with that has gone to the functionality itself and good examples of instructions are missing.

You could try to look at some usage examples from my test app:
http://dev.vaadin.com/svn/incubator/EasyUploads/src/org/vaadin/easyuploads/tests/UploadfieldExampleApplication.java

In case any EasyUploads users has some time, I’d be happy if somebody wrote a short manual for it. I sure it would help several Vaadin users.

cheers,
matti

Maati:

That’s exactly what I was looking for, thank you.

Regards.

Hello,

I’ve got a strange problem.
My portlet contains a main panel with two sub-panels.

  • 1st sub-panel contains a multiFileUpload component
  • 2nd panel contains a tree.

If I add a DropHandler to my Tree with the setDropHandler function, application crashes: a notification panel is displayed: Internal Error… Please notify the administrator…
And no exception appears in Tomcat or in the debug console of Vaadin.

Is it not possible to use a tree with drop handler when application contains a MultiFileUploads component ?

I hope you could help me.

Regards

Is that possible it’s a conflict between handlers of the two components ? :frowning:
Do you know if there is a workaround to get around this comportment ?

Regards

Hi,

Sorry, but I have been too busy elsewhere to debug your issue. It would help me or others to check it out if you would build a reduced test case (application where the issue can be reproduced).

cheers,
matti

Hi,

Ok, no problem.
Error appears when i do the following:


Tree tree = new Tree("This is a test tree");
Object itemId1 = tree.addItem();
tree.setItemCaption(itemId1, "Item1");
Object itemId2 = tree.addItem();
tree.setItemCaption(itemId2, "Item2");
tree.setDragMode(TreeDragMode.NODE);
tree.setDropHandler(new DropHandler() {
	
	@Override
	public AcceptCriterion getAcceptCriterion() {
		// TODO Auto-generated method stub
		return null;
	}
	
	@Override
	public void drop(DragAndDropEvent event) {
		// TODO Auto-generated method stub
		
	}
});

mainPanel.addComponent(multiFileUpload);
mainPanel.addComponent(tree);

Regards.

You are returning a null as the AcceptCriterion and the application crashes in Tree.paintContent() to that null pointer or did you have some other issue and the example code is accidentally reduced to that crashing version?

Hello,

I am using EasyUploads 0.4.9, Vaadin 6.7.0 and Liferay Portal 6.0.6. I also did install the Vaadin Control Panel for Liferay and Compiled Widgetsets.
Now here are my challenges:
IE7 - does not open the File Browser when I click the browse button for MultiFileUpload
IE8/IE9 - opens the file browser but gets stuck in the progress bar.
FF7/FF8 - works fine
Chrome - works fine

I don’t see any errors on the server logs.

Can you please show me some light on this matter?

Sincerely,

Mark

I experienced the same problems with my portlet runing in IE7, 8, 9. The portlet runs fine with Firefox and Chrome.
I also posted this on Liferay community hoping to get some help.
http://www.liferay.com/community/forums/-/message_boards/message/11958847

My portlet setup is Liferay 5.2.2 with Easyuploads 0.4.9 and vaadin 6.7.1.

Here is the error thrown by IE:

Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.1; MS-RTC LM 8)
Timestamp: Mon, 19 Dec 2011 16:24:41 UTC
Message: Exception thrown and not caught
Line: 451
Char: 2
Code: 0
URI: http://10.202.3.209:8080/html/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet/swfupload.js

Using IE9 developer tool, all I can find is this:
SCRIPT5022: Call to ReturnUploadStart failed
swfupload.js, line 451 character 2

The javascript file line 451 is this: “} catch (ex) {”

Any ideas on how to resolve IE upload problem?

My experience is if I drag/drop to upload, MIME will get correctly recognized, but if I use the upload button for native upload, MIME will be “todo/todo”. Anybody knows why?

Anyone out there used Easyuploads in Liferay portlet and actually got it to work in IE browser? I’d like to know so I could decide whether to abandon my portlet that was implemented using the Easyuploads. The multifileupload wouldn’t work in IE but works in firefox and chrome.