3962: Workspace Uploader improvements: use a sequential get status instead of parallel during (multiple-)uploads

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

Added goNextUploaderAfterKey(clientKey) in several upload abort cases

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@128591 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2016-05-13 10:05:55 +00:00
parent 440630e953
commit fec942629e
3 changed files with 6 additions and 20 deletions

View File

@ -68,9 +68,6 @@ public class MonitorPanel extends ScrollPanel{
hpBottomPanel.setWidth("100%");
hpBottomPanel.add(labelNumbUpload);
// mainPanel.add(hpNumbUpload);
// mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
//LIST OF UPLOADS
vpListUpload.getElement().getStyle().setMargin(5, Unit.PX);
// setHeight("500px");
@ -78,14 +75,10 @@ public class MonitorPanel extends ScrollPanel{
ScrollPanel scroll = new ScrollPanel();
scroll.add(vpListUpload);
scroll.setHeight("200px");
// scroll.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
// scroll.getElement().getStyle().setBorderWidth(1.0, Unit.PX);
mainPanel.add(scroll);
//CLOSE MONITOR
// hpCloseMonitor.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
// hpCloseMonitor.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
Button bClose = new Button("Close");
bClose.addClickHandler(new ClickHandler() {
@ -95,8 +88,6 @@ public class MonitorPanel extends ScrollPanel{
}
});
// hpNumbUpload.add(bClose);
hpCloseMonitor.add(bClose);
hpCloseMonitor.addStyleName("align-right-close");
hpBottomPanel.add(hpCloseMonitor);

View File

@ -112,16 +112,6 @@ public class UploaderMonitor {
GWT.log("onResponseReceived "+result);
final HandlerResultMessage resultMessage = HandlerResultMessage.parseResult(result);
// timer.cancel();
// int indexQueue = getQueueIndexFromClientUploadKey(clientKey);
// goNextUploaderFromKey(clientKey, queue, indexQueue);
// deleteTimerEvent.getUploader().setUploadStatus(UPLOAD_STATUS.ABORTED);
// notifyUploadAborted(deleteTimerEvent.getUploader().getFile().getParentId(), null);
// if(timer!=null)
// timer.cancel();
// goNextUploaderAfterKey(clientKey);
GWT.log("Cancel Upload Stream result: "+resultMessage);
if(resultMessage==null)
return;
@ -130,6 +120,7 @@ public class UploaderMonitor {
case ERROR:{
GWT.log("ERROR: Error during stop upload "+resultMessage.getMessage());
Window.alert("Sorry, An error occurred during upload abort! "+resultMessage.getMessage());
goNextUploaderAfterKey(clientKey);
break;
}
case OK:{
@ -155,7 +146,9 @@ public class UploaderMonitor {
case UNKNOWN:
case WARN:{
GWT.log("UNKNOWN/WARN CASE: Error during stop upload "+resultMessage.getMessage());
goNextUploaderAfterKey(clientKey);
break;
}
}
}
@ -163,11 +156,13 @@ public class UploaderMonitor {
@Override
public void onError(Request request, Throwable exception) {
GWT.log("ERROR: Error during stop upload "+exception.getMessage());
goNextUploaderAfterKey(clientKey);
}
});
} catch (RequestException e) {
GWT.log("RequestException: Error during stop upload "+e.getMessage());
goNextUploaderAfterKey(clientKey);
}
}
});

View File

@ -212,7 +212,7 @@ public class WsUtil {
*/
public static void putWorkspaceUploaderInSession(final HttpSession httpSession, WorkspaceUploaderItem uploader) throws Exception
{
logger.trace("Put workspace uploader in session: "+uploader);
logger.trace("Put workspace uploader in session: "+uploader.getIdentifier() + ", STATUS: "+uploader.getUploadStatus());
final ASLSession session = getAslSession(httpSession);
if(uploader.getIdentifier()==null || uploader.getIdentifier().isEmpty())