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:
parent
440630e953
commit
fec942629e
|
@ -68,9 +68,6 @@ public class MonitorPanel extends ScrollPanel{
|
||||||
hpBottomPanel.setWidth("100%");
|
hpBottomPanel.setWidth("100%");
|
||||||
hpBottomPanel.add(labelNumbUpload);
|
hpBottomPanel.add(labelNumbUpload);
|
||||||
|
|
||||||
// mainPanel.add(hpNumbUpload);
|
|
||||||
// mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
|
||||||
|
|
||||||
//LIST OF UPLOADS
|
//LIST OF UPLOADS
|
||||||
vpListUpload.getElement().getStyle().setMargin(5, Unit.PX);
|
vpListUpload.getElement().getStyle().setMargin(5, Unit.PX);
|
||||||
// setHeight("500px");
|
// setHeight("500px");
|
||||||
|
@ -78,14 +75,10 @@ public class MonitorPanel extends ScrollPanel{
|
||||||
ScrollPanel scroll = new ScrollPanel();
|
ScrollPanel scroll = new ScrollPanel();
|
||||||
scroll.add(vpListUpload);
|
scroll.add(vpListUpload);
|
||||||
scroll.setHeight("200px");
|
scroll.setHeight("200px");
|
||||||
// scroll.getElement().getStyle().setBorderStyle(BorderStyle.SOLID);
|
|
||||||
// scroll.getElement().getStyle().setBorderWidth(1.0, Unit.PX);
|
|
||||||
|
|
||||||
mainPanel.add(scroll);
|
mainPanel.add(scroll);
|
||||||
|
|
||||||
//CLOSE MONITOR
|
//CLOSE MONITOR
|
||||||
// hpCloseMonitor.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
|
|
||||||
// hpCloseMonitor.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM);
|
|
||||||
Button bClose = new Button("Close");
|
Button bClose = new Button("Close");
|
||||||
bClose.addClickHandler(new ClickHandler() {
|
bClose.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@ -95,8 +88,6 @@ public class MonitorPanel extends ScrollPanel{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// hpNumbUpload.add(bClose);
|
|
||||||
|
|
||||||
hpCloseMonitor.add(bClose);
|
hpCloseMonitor.add(bClose);
|
||||||
hpCloseMonitor.addStyleName("align-right-close");
|
hpCloseMonitor.addStyleName("align-right-close");
|
||||||
hpBottomPanel.add(hpCloseMonitor);
|
hpBottomPanel.add(hpCloseMonitor);
|
||||||
|
|
|
@ -112,16 +112,6 @@ public class UploaderMonitor {
|
||||||
GWT.log("onResponseReceived "+result);
|
GWT.log("onResponseReceived "+result);
|
||||||
|
|
||||||
final HandlerResultMessage resultMessage = HandlerResultMessage.parseResult(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);
|
GWT.log("Cancel Upload Stream result: "+resultMessage);
|
||||||
if(resultMessage==null)
|
if(resultMessage==null)
|
||||||
return;
|
return;
|
||||||
|
@ -130,6 +120,7 @@ public class UploaderMonitor {
|
||||||
case ERROR:{
|
case ERROR:{
|
||||||
GWT.log("ERROR: Error during stop upload "+resultMessage.getMessage());
|
GWT.log("ERROR: Error during stop upload "+resultMessage.getMessage());
|
||||||
Window.alert("Sorry, An error occurred during upload abort! "+resultMessage.getMessage());
|
Window.alert("Sorry, An error occurred during upload abort! "+resultMessage.getMessage());
|
||||||
|
goNextUploaderAfterKey(clientKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case OK:{
|
case OK:{
|
||||||
|
@ -155,7 +146,9 @@ public class UploaderMonitor {
|
||||||
case UNKNOWN:
|
case UNKNOWN:
|
||||||
case WARN:{
|
case WARN:{
|
||||||
GWT.log("UNKNOWN/WARN CASE: Error during stop upload "+resultMessage.getMessage());
|
GWT.log("UNKNOWN/WARN CASE: Error during stop upload "+resultMessage.getMessage());
|
||||||
|
goNextUploaderAfterKey(clientKey);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -163,11 +156,13 @@ public class UploaderMonitor {
|
||||||
@Override
|
@Override
|
||||||
public void onError(Request request, Throwable exception) {
|
public void onError(Request request, Throwable exception) {
|
||||||
GWT.log("ERROR: Error during stop upload "+exception.getMessage());
|
GWT.log("ERROR: Error during stop upload "+exception.getMessage());
|
||||||
|
goNextUploaderAfterKey(clientKey);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (RequestException e) {
|
} catch (RequestException e) {
|
||||||
GWT.log("RequestException: Error during stop upload "+e.getMessage());
|
GWT.log("RequestException: Error during stop upload "+e.getMessage());
|
||||||
|
goNextUploaderAfterKey(clientKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class WsUtil {
|
||||||
*/
|
*/
|
||||||
public static void putWorkspaceUploaderInSession(final HttpSession httpSession, WorkspaceUploaderItem uploader) throws Exception
|
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);
|
final ASLSession session = getAslSession(httpSession);
|
||||||
|
|
||||||
if(uploader.getIdentifier()==null || uploader.getIdentifier().isEmpty())
|
if(uploader.getIdentifier()==null || uploader.getIdentifier().isEmpty())
|
||||||
|
|
Loading…
Reference in New Issue