429: Workspace: uploading big files
Task-Url: https://support.d4science.org/issues/429 Updated polling Updated listeners remove static git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@119372 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
945030861f
commit
c6a54dd79d
|
@ -17,7 +17,6 @@ import com.google.gwt.core.client.GWT;
|
|||
import com.google.gwt.dom.client.Style.Unit;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.user.client.Timer;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.ui.Anchor;
|
||||
|
@ -210,7 +209,7 @@ public class DialogUploadStream extends ClosableDialog implements HasWorskpaceUp
|
|||
GWT.log("SubmitEvent");
|
||||
addLoading();
|
||||
enableButtons(false);
|
||||
final WorkspaceUploaderItem fakeUploader = new WorkspaceUploaderItem();
|
||||
WorkspaceUploaderItem fakeUploader = new WorkspaceUploaderItem();
|
||||
fakeUploader.setClientUploadKey(clientUploadKey);
|
||||
UploaderMonitor.getInstance().addNewSubmit(fakeUploader, fileUpload.getFilename());
|
||||
setVisible(false);
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.List;
|
|||
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.ConstantsWorkspaceUploader;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.DialogResult;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.HasWorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploadNotification.WorskpaceUploadNotificationListener;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderServiceAsync;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.shared.HandlerResultMessage;
|
||||
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploadFile;
|
||||
|
|
|
@ -45,7 +45,7 @@ public class UploaderMonitor {
|
|||
private MonitorPanel monitorPanel = new MonitorPanel(eventBus);
|
||||
private static Map<String, Timer> mapTimer = new HashMap<String, Timer>();
|
||||
private ClosableDialog dialogUploadMonitor = new ClosableDialog(monitorPanel, false, ConstantsWorkspaceUploader.MY_UPLOADS);
|
||||
private static List<WorskpaceUploadNotificationListener> listenersUpload = new ArrayList<WorskpaceUploadNotificationListener>();
|
||||
private List<WorskpaceUploadNotificationListener> listenersUpload = new ArrayList<WorskpaceUploadNotificationListener>();
|
||||
/**
|
||||
* Gets the single instance of UploaderMonitor.
|
||||
*
|
||||
|
@ -54,15 +54,18 @@ public class UploaderMonitor {
|
|||
public static synchronized UploaderMonitor getInstance() {
|
||||
if (instance == null){
|
||||
instance = new UploaderMonitor();
|
||||
bindEvents();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private UploaderMonitor(){
|
||||
bindEvents();
|
||||
}
|
||||
|
||||
/**
|
||||
* Bind events.
|
||||
*/
|
||||
private static void bindEvents() {
|
||||
private void bindEvents() {
|
||||
|
||||
eventBus.addHandler(CancelUploadEvent.TYPE, new CancelUploadEventHandler() {
|
||||
|
||||
|
@ -212,7 +215,7 @@ public class UploaderMonitor {
|
|||
* @param parentId the parent id
|
||||
* @param itemId the item id
|
||||
*/
|
||||
private static void notifyUploadCompleted(String parentId, String itemId){
|
||||
private void notifyUploadCompleted(String parentId, String itemId){
|
||||
for (WorskpaceUploadNotificationListener listener : listenersUpload) {
|
||||
listener.onUploadCompleted(parentId, itemId);
|
||||
}
|
||||
|
@ -224,7 +227,7 @@ public class UploaderMonitor {
|
|||
* @param parentId the parent id
|
||||
* @param itemId the item id
|
||||
*/
|
||||
private static void notifyUploadAborted(String parentId, String itemId){
|
||||
private void notifyUploadAborted(String parentId, String itemId){
|
||||
for (WorskpaceUploadNotificationListener listener : listenersUpload) {
|
||||
listener.onUploadAborted(parentId, itemId);
|
||||
}
|
||||
|
@ -237,7 +240,7 @@ public class UploaderMonitor {
|
|||
* @param itemId the item id
|
||||
* @param t the t
|
||||
*/
|
||||
private static void notifyUploadError(String parentId, String itemId, Throwable t){
|
||||
private void notifyUploadError(String parentId, String itemId, Throwable t){
|
||||
for (WorskpaceUploadNotificationListener listener : listenersUpload) {
|
||||
listener.onError(parentId, itemId, t);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue