429: Workspace: uploading big files

Task-Url: https://support.d4science.org/issues/429

Removed unused code

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@119750 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2015-10-14 13:53:30 +00:00
parent 54d67ecc44
commit ca01c0158d
3 changed files with 3 additions and 73 deletions

View File

@ -10,7 +10,6 @@ import org.gcube.portlets.widgets.workspaceuploader.client.DialogResult;
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceExplorerListenerController;
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.events.HideMonitorEvent;
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderServiceAsync;
import org.gcube.portlets.widgets.workspaceuploader.shared.HandlerResultMessage;
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploaderItem;
@ -24,13 +23,13 @@ import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Anchor;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler;
import com.google.gwt.user.client.ui.FormPanel.SubmitEvent;
import com.google.gwt.user.client.ui.FormPanel.SubmitHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
@ -137,9 +136,7 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
msg.getElement().getStyle().setFontSize(10, Unit.PX);
hpBottom.add(msg);
}
HorizontalPanel hp2 = new HorizontalPanel();
hp2.getElement().getStyle().setMarginTop(5, Unit.PX);
// hp2.getElement().getStyle().setWidth(100, Unit.PCT);
@ -153,8 +150,7 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
DialogUpload.this.hide();
}
});
hp2.add(bClose);
hpBottom.add(hp2);
panel.add(hpBottom);
@ -241,18 +237,6 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
setVisible(false);
removeLoading();
UploaderMonitor.getInstance().pollWorkspaceUploader(fakeUploader);
//WAITING 0.5 SEC TO FIRST UPDATES
/*new Timer() {
@Override
public void run() {
removeLoading();
UploaderMonitor.getInstance().pollWorkspaceUploader(fakeUploader);
}
}.schedule(500);*/
}
});
@ -331,56 +315,6 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
// upload.setEnabled(bool);
}
/**
* Adds the listeners.
*/
/*protected void addListeners() {
btnUpload.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
GWT.log("btnSubmit click");
if (fileUpload.getFilename()==null || !(fileUpload.getFilename().length()>2)) {
GWT.log("No file specified ");
return;
}
GWT.log("fileUpload.getFilename() "+fileUpload.getFilename());
//TODO: recall: Some browser would write in fileUploadField.getValue() C:\fakepath\$fileName
String normalizedFileName = fileUpload.getFilename();
if (normalizedFileName.contains("\\")) {
normalizedFileName = normalizedFileName.substring(normalizedFileName.lastIndexOf("\\")+1); //remove C:\fakepath\ if exists
}
final String label = normalizedFileName;
WorkspaceUploaderServiceAsync.Util.getInstance().itemExistsInWorkpaceFolder(parentIdentifier, normalizedFileName, new AsyncCallback<String>() {
@Override
public void onSuccess(final String itemId) {
GWT.log("itemExistsInWorkpaceFolder: "+itemId);
if(itemId!=null){
// HANDLE OWERWRITE
if(Window.confirm(label + " exists in folder. Overwrite?")){
removeItemAndSubmitForm(itemId);
updateItemSubmitForm(itemId);
}
}else
submitForm(); //ITEM does NOT EXIST SO SUBMIT FORM;
}
@Override
public void onFailure(Throwable caught) {
GWT.log("Sorry an error occurred on the server "+caught.getLocalizedMessage() + ". Please try again later");
Window.alert(caught.getMessage());
}
});
}
});
}*/
/**
* Submit form.
*/

View File

@ -22,7 +22,6 @@ import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.Window.ClosingEvent;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.ScrollPanel;

View File

@ -233,9 +233,6 @@ public class UploaderMonitor {
private void notifyUploadCompleted(String parentId, String itemId){
GWT.log("notifyUploadCompleted in monitor");
WorkspaceExplorerListenerController.getEventBus().fireEvent(new NotifyUploadEvent(UPLOAD_EVENT_TYPE.COMPLETED, parentId, itemId));
// for (WorskpaceUploadNotificationListener listener : listenersUpload) {
// listener.onUploadCompleted(parentId, itemId);
// }
}
/**