From 6e0a5f6da65f43f52bee177478246828733fc83a Mon Sep 17 00:00:00 2001
From: Francesco Mangiacrapa
Date: Wed, 14 Oct 2015 13:32:40 +0000
Subject: [PATCH] 429: Workspace: uploading big files
Task-Url: https://support.d4science.org/issues/429
Updated according to the latest feedback:
- new spinner and icons;
- vertical scroll bar;
- uploaded #/tot
- close buttons
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/workspace-uploader@119748 82a268e6-3cf1-43bd-a215-b396298e98cf
---
.../client/events/HideMonitorEvent.java | 40 ++++
.../events/HideMonitorEventHandler.java | 21 ++
.../client/resource/FileUpload.css | 2 +-
.../resource/WorkspaceUploaderIcons.java | 4 +-
.../client/resource/spinner.gif | Bin 0 -> 1737 bytes
.../client/uploader/DialogUpload.java | 55 ++++--
.../client/uploader/MonitorPanel.java | 181 ++++++++----------
.../client/uploader/UploaderMonitor.java | 12 ++
.../client/uploader/UploaderProgressView.java | 9 +-
.../public/workspaceuploader.css | 10 +-
.../server/WorkspaceUploadServlet.java | 4 +-
.../server/WorkspaceUploadServletStream.java | 32 ++--
.../upload/WorkspaceUploaderManager.java | 4 +-
.../server/upload/WorkspaceUploaderMng.java | 12 +-
14 files changed, 232 insertions(+), 154 deletions(-)
create mode 100644 src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEvent.java
create mode 100644 src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEventHandler.java
create mode 100644 src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/spinner.gif
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEvent.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEvent.java
new file mode 100644
index 0000000..29eaccf
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEvent.java
@@ -0,0 +1,40 @@
+package org.gcube.portlets.widgets.workspaceuploader.client.events;
+
+import com.google.gwt.event.shared.GwtEvent;
+
+/**
+ * The Class HideMonitorEvent.
+ *
+ * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it Oct 14, 2015
+ */
+public class HideMonitorEvent extends GwtEvent {
+ public static Type TYPE = new Type();
+
+ /**
+ * Instantiates a new cancel upload event.
+ */
+ public HideMonitorEvent() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
+ */
+ @Override
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared
+ * .EventHandler)
+ */
+ @Override
+ protected void dispatch(HideMonitorEventHandler handler) {
+ handler.onHideMonitor(this);
+ }
+}
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEventHandler.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEventHandler.java
new file mode 100644
index 0000000..328dfa9
--- /dev/null
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/events/HideMonitorEventHandler.java
@@ -0,0 +1,21 @@
+package org.gcube.portlets.widgets.workspaceuploader.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+
+
+
+/**
+ * The Interface HideMonitorEventHandler.
+ *
+ * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
+ * Oct 14, 2015
+ */
+public interface HideMonitorEventHandler extends EventHandler {
+
+ /**
+ * On hide monitor.
+ *
+ * @param hideMonitorEvent the hide monitor event
+ */
+ void onHideMonitor(HideMonitorEvent hideMonitorEvent);
+}
\ No newline at end of file
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/FileUpload.css b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/FileUpload.css
index 8befaf8..59a2078 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/FileUpload.css
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/FileUpload.css
@@ -19,7 +19,7 @@
font: 13px/20px 'Lucida Grande', Tahoma, Verdana, sans-serif;
color: #404040;
margin: 0px auto;
- width: 320px;
+ width: 330px;
}
.bar-container > div {
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/WorkspaceUploaderIcons.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/WorkspaceUploaderIcons.java
index 2d3d4cb..d1372f9 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/WorkspaceUploaderIcons.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/WorkspaceUploaderIcons.java
@@ -19,7 +19,7 @@ public interface WorkspaceUploaderIcons extends ClientBundle {
*
* @return the image resource
*/
- @Source("loader2.gif")
+ @Source("spinner.gif")
ImageResource loading();
/**
@@ -43,7 +43,7 @@ public interface WorkspaceUploaderIcons extends ClientBundle {
*
* @return the image resource
*/
- @Source("delete.gif")
+ @Source("cancel.png")
ImageResource cancel();
/**
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/spinner.gif b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/resource/spinner.gif
new file mode 100644
index 0000000000000000000000000000000000000000..4cf7523866c1c5281a7ab68cfccd5b2e928bf06e
GIT binary patch
literal 1737
zcmaLXeN31;w)o+db{@V2Ip~W{op5E}|
zp2VNrQ8)IYKkc}%sqE@?C6Eb*ZwwD^y(n<(WL9=1KCFh6o-1={A5~K
z+a;*!JoWdPP=Cj(m#37^^}tVe>0j)tKQ)?4-r)v1_q{zTKiEV3dNA;(k;84{&<_)L
zKg^v)Y_($rS(;RJ$eQopUXEn5RueWo6dFUG+$PwuQ%Xao=qJLq
zr<81XN=do$w`PlA!sSUSX>^7boS-xmpB>Kt9hse5*ajI;5SnK`hvOh&^OZIj0TMUX
zW+?j<$`Nwg2r
zNQkv&HQC|u<
zf>Ks{qTPlWt!cMuoF}bYkVpQx_&w`ty5@(v%tV>c9T#xYP=
zZno`=$TyLMQlqCUpUN|WjG{ya$`*tGmx>n@?RgReDh)w6@(EBAxW*8V)&a4pEa=*s
z3!I6TpgSoZ;H7#6vu`a%rj=$W)Ic{2)lzU4i>DyWTC{rTq#PGK61}Eo<9e98n(>Fk
zu(!r1Q;ITah?iXJlcZ-yX~dMn#1~t&S{DB?VGN1uO-9-!kFo-5xs-u?I|9I>CxSNr
ze&Ds~f=EQ}dF&d4gtOaN>Y%;B0}x(2v%f9`pk7sDOm#`h_PS^jgT?O-6WloV&D1+xCs$4U!o$QmbEeT^RH$jlKsb0T%%(3?
zP$-gyXdxY9Ow6%1s?7%48S6rTPJ4fw=qYagvvm#O5&j?9Z~E3nu*2oqrPsH~S8Mz7
z|8TUTo select multiple files, press and hold down the Ctrl key, and then click each item
that you want to select
");
- msg.getElement().getStyle().setFontSize(10, Unit.PX);
- hpBottom.add(msg);
- }
-
- panel.add(hpBottom);
-
+
HorizontalPanel hp = new HorizontalPanel();
- hp.getElement().setId("hpID");
+// hp.getElement().setId("hpID");
hp.getElement().getStyle().setWidth(100, Unit.PCT);
+ hp.getElement().getStyle().setMarginTop(5, Unit.PX);
hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
- hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
+ hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
anchorMyUploads = new Anchor(ConstantsWorkspaceUploader.MY_UPLOADS);
anchorMyUploads.addClickHandler(new ClickHandler() {
@@ -134,6 +126,39 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
});
hp.add(anchorMyUploads);
panel.add(hp);
+
+ hpBottom = new HorizontalPanel();
+ hpBottom.setWidth("100%");
+// hpBottom.getElement().getStyle().setMarginTop(5, Unit.PX);
+ hpBottom.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
+
+ if(uploadType.equals(UPLOAD_TYPE.File)){
+ HTML msg = new HTML("To select multiple files, press and hold down the Ctrl key, and then
click each item that you want to select
");
+ 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);
+ hp2.addStyleName("align-right-close");
+
+ Button bClose = new Button("Close");
+ bClose.addClickHandler(new ClickHandler() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ DialogUpload.this.hide();
+ }
+ });
+
+
+ hp2.add(bClose);
+ hpBottom.add(hp2);
+ panel.add(hpBottom);
+
add(formPanel);
}
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/MonitorPanel.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/MonitorPanel.java
index 1113d7b..3dc8cd2 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/MonitorPanel.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/MonitorPanel.java
@@ -6,18 +6,24 @@ package org.gcube.portlets.widgets.workspaceuploader.client.uploader;
import java.util.HashMap;
import java.util.Map;
+import org.gcube.portlets.widgets.workspaceuploader.client.events.HideMonitorEvent;
import org.gcube.portlets.widgets.workspaceuploader.client.resource.ProgressBarCssAndImages;
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploaderItem;
import org.gcube.portlets.widgets.workspaceuploader.shared.WorkspaceUploaderItem.UPLOAD_STATUS;
import com.google.gwt.core.shared.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.event.logical.shared.CloseEvent;
import com.google.gwt.event.logical.shared.CloseHandler;
import com.google.gwt.event.shared.HandlerManager;
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;
import com.google.gwt.user.client.ui.VerticalPanel;
@@ -31,34 +37,90 @@ import com.google.gwt.user.client.ui.VerticalPanel;
*/
public class MonitorPanel extends ScrollPanel{
- private static final int MAX_CHARS = 50;
- private VerticalPanel verticalPanel = new VerticalPanel();
+ private VerticalPanel vpListUpload = new VerticalPanel();
+ private VerticalPanel mainPanel = new VerticalPanel();
private Map mapUploading = new HashMap();
-// private Map mapTimer = new HashMap();
-// private Map mapDialog= new HashMap();
private Map mapPanels = new HashMap();
private HandlerManager eventBus;
private HorizontalPanel hpNoUploads = new HorizontalPanel();
+ private HTML labelNumbUpload = new HTML("Uploaded 0 of 0");
+ private HorizontalPanel hpBottomPanel = new HorizontalPanel();
+
+ private HorizontalPanel hpCloseMonitor = new HorizontalPanel();
+
static {
ProgressBarCssAndImages.INSTANCE.css().ensureInjected();
}
/**
* Instantiates a new monitor panel.
*
- * @param eventBus the event bus
+ * @param bus the event bus
*/
- public MonitorPanel(HandlerManager eventBus) {
- this.eventBus = eventBus;
+ public MonitorPanel(HandlerManager bus) {
+ this.eventBus = bus;
initPanelNoUploads();
addCloseHandler();
- verticalPanel.getElement().getStyle().setMargin(5, Unit.PX);
- add(verticalPanel);
+
+ //NUMBER OF UPLOADS
+ hpBottomPanel.getElement().setId("hpBottomPanel");
+// hpNumbUpload.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
+ hpBottomPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
+ hpBottomPanel.setWidth("100%");
+ hpBottomPanel.add(labelNumbUpload);
- verticalPanel.add(hpNoUploads);
+// mainPanel.add(hpNumbUpload);
+// mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
+
+ //LIST OF UPLOADS
+ vpListUpload.getElement().getStyle().setMargin(5, Unit.PX);
+// setHeight("500px");
+ vpListUpload.add(hpNoUploads);
+ 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() {
+
+ @Override
+ public void onClick(ClickEvent event) {
+ eventBus.fireEvent(new HideMonitorEvent());
+ }
+ });
+
+// hpNumbUpload.add(bClose);
+
+ hpCloseMonitor.add(bClose);
+ hpCloseMonitor.addStyleName("align-right-close");
+ hpBottomPanel.add(hpCloseMonitor);
+ hpBottomPanel.getElement().getStyle().setMarginTop(5.0, Unit.PX);
+ mainPanel.setWidth("100%");
+ mainPanel.add(hpBottomPanel);
+
+ add(mainPanel);
// RootPanel.get("workspace-uploader").add(verticalPanel);
}
+
+ private void updateNumberUpload(){
+ int numCompleted = 0;
+ for (String uploadKey : mapUploading.keySet()) {
+ WorkspaceUploaderItem uploader = mapUploading.get(uploadKey);
+ if(uploader.getUploadStatus().equals(UPLOAD_STATUS.COMPLETED) || uploader.getUploadStatus().equals(UPLOAD_STATUS.FAILED))
+ numCompleted++;
+ }
+
+ labelNumbUpload.setHTML("Uploaded "+numCompleted +" of "+mapUploading.size());
+ }
+
private void initPanelNoUploads(){
hpNoUploads = new HorizontalPanel();
hpNoUploads.addStyleName("noUploads");
@@ -68,7 +130,7 @@ public class MonitorPanel extends ScrollPanel{
private void removeNoUploads(){
try{
- verticalPanel.remove(hpNoUploads);
+ vpListUpload.remove(hpNoUploads);
}catch(Exception e){
}
@@ -89,6 +151,8 @@ public class MonitorPanel extends ScrollPanel{
}else{
GWT.log("Skip update, uploader: "+uploader.getClientUploadKey() +" "+uploader.getFile().toString()+", not found!");
}
+
+ updateNumberUpload();
}
/**
@@ -104,98 +168,11 @@ public class MonitorPanel extends ScrollPanel{
mapPanels.put(uploader.getClientUploadKey(), upv);
VerticalPanel upvPanel = upv.getPanel();
upvPanel.addStyleName("upladerMargin");
- verticalPanel.add(upvPanel);
+ vpListUpload.add(upvPanel);
+
+ updateNumberUpload();
}
-
- /**
- * Handle cancel upload.
- *
- * @param uploader the uploader
- * @param vp the hp
- * @return the image
- */
- /*private Image handleCancelUpload(final WorkspaceUploaderItem uploader, final VerticalPanel vp){
-
- Image cancel = WorkspaceUploaderResources.getImageCancel();
- cancel.setTitle("Cancel upload");
- cancel.addStyleName("cancel-upload");
- cancel.addClickHandler(new ClickHandler() {
-
- @Override
- public void onClick(ClickEvent event) {
- GWT.log("Click cancel");
- String fileName = uploader.getFile()!=null? uploader.getFile().getFileName(): "";
- if(Window.confirm("Confirm cancel uploading "+fileName+"?")){
- vp.clear();
- HTML html = new HTML();
- vp.add(html);
- String text = "";
- String msg = StringUtil.ellipsize("Aborting upload: "+fileName, MAX_CHARS, 0);
- text+="
"+msg+" ";
- html.setHTML(text);
- eventBus.fireEvent(new CancelUploadEvent(uploader, vp, fileName));
- }
- }
- });
- return cancel;
- }*/
-
-// /**
-// * Update info.
-// *
-// * @param vp the hp
-// * @param uploader the uploader
-// */
-// private void updateInfo(VerticalPanel vp, WorkspaceUploaderItem uploader){
-// vp.clear();
-// HTML html = new HTML();
-// vp.add(html);
-// String text;
-// switch(uploader.getUploadStatus()){
-// case COMPLETED:
-// text = "";
-// text+="
"+StringUtil.ellipsize(uploader.getFile().getFileName()+" uploaded successfully!", MAX_CHARS, 0)+" ";
-//// GWT.log(text);
-// html.setHTML(text);
-// html.setTitle(uploader.getStatusDescription());
-// break;
-// case FAILED:
-// text = "";
-// text+="
"+StringUtil.ellipsize(uploader.getStatusDescription(), MAX_CHARS, 0)+" ";
-//// GWT.log(text);
-// html.setHTML(text);
-// html.setTitle(uploader.getStatusDescription());
-// break;
-// case IN_PROGRESS:
-// text = "";
-// String msg = StringUtil.ellipsize(uploader.getUploadProgress().getLastEvent().getReadPercentage()+"% "+uploader.getFile().getFileName(), MAX_CHARS, 0);
-// text+="
"+msg+"";
-// text+="
";
-//// GWT.log(text);
-// html.setHTML(text);
-// html.setTitle(uploader.getStatusDescription());
-// if(uploader.getUploadProgress().getLastEvent().getReadPercentage()!=100)
-// vp.add(handleCancelUpload(uploader, vp));
-// break;
-// case WAIT:
-// text = "";
-//
-// String descr = "";
-// if(uploader.getFile()!=null && uploader.getFile().getFileName()!=null)
-// descr = uploader.getFile().getFileName();
-// else
-// descr = uploader.getStatusDescription();
-//
-// text+="
"+descr+"";
-// text+="
";
-//// GWT.log(text);
-// html.setHTML(text);
-//// hp.add(handleCancelUplad(uploader, hp));
-// break;
-// }
-// }
-
/**
* Adds the close handler.
*/
@@ -225,8 +202,6 @@ public class MonitorPanel extends ScrollPanel{
// Window.alert("bye bye Closed");
}
});
-
-
}
}
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderMonitor.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderMonitor.java
index 850097b..d7c6621 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderMonitor.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderMonitor.java
@@ -12,6 +12,8 @@ import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceExplorerList
import org.gcube.portlets.widgets.workspaceuploader.client.WorkspaceUploaderServiceAsync;
import org.gcube.portlets.widgets.workspaceuploader.client.events.CancelUploadEvent;
import org.gcube.portlets.widgets.workspaceuploader.client.events.CancelUploadEventHandler;
+import org.gcube.portlets.widgets.workspaceuploader.client.events.HideMonitorEvent;
+import org.gcube.portlets.widgets.workspaceuploader.client.events.HideMonitorEventHandler;
import org.gcube.portlets.widgets.workspaceuploader.client.events.NotifyUploadEvent;
import org.gcube.portlets.widgets.workspaceuploader.client.events.NotifyUploadEvent.UPLOAD_EVENT_TYPE;
import org.gcube.portlets.widgets.workspaceuploader.client.resource.WorkspaceUploaderResources;
@@ -59,6 +61,7 @@ public class UploaderMonitor {
}
private UploaderMonitor(){
+ dialogUploadMonitor.setWidth("400px");
bindEvents();
}
@@ -129,6 +132,15 @@ public class UploaderMonitor {
}
}
});
+
+
+ monitorEventBus.addHandler(HideMonitorEvent.TYPE, new HideMonitorEventHandler() {
+
+ @Override
+ public void onHideMonitor(HideMonitorEvent hideMonitorEvent) {
+ dialogUploadMonitor.hide();
+ }
+ });
}
/**
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderProgressView.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderProgressView.java
index 384ab49..9c7f33d 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderProgressView.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/client/uploader/UploaderProgressView.java
@@ -101,11 +101,7 @@ public class UploaderProgressView {
html.setHTML(text);
html.setTitle(uploader.getStatusDescription());
bar.update(uploader.getUploadProgress().getLastEvent().getReadPercentage());
- try{
-// hpBar.remove(cancelImg);
- }catch (Exception e) {}
try{
-// hpBar.remove(bar);
hpBar.clear();
}catch (Exception e) {}
break;
@@ -116,7 +112,10 @@ public class UploaderProgressView {
// GWT.log(text);
html.setHTML(text);
html.setTitle(uploader.getStatusDescription());
- bar.update(uploader.getUploadProgress().getLastEvent().getReadPercentage());
+// bar.update(uploader.getUploadProgress().getLastEvent().getReadPercentage());
+ try{
+ hpBar.clear();
+ }catch (Exception e) {}
break;
case IN_PROGRESS:
setVisibleBar(true);
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/public/workspaceuploader.css b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/public/workspaceuploader.css
index fd9041c..be3e55c 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/public/workspaceuploader.css
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/public/workspaceuploader.css
@@ -97,17 +97,23 @@ h1 {
min-width: 350px;
}
-.noUploads{
+.noUploads {
min-width: 350px;
font-size: 15px;
font-family: "Lucida Grande", Verdana, "Bitstream Vera Sans", Arial,
sans-serif;
}
-.upladerMargin{
+.upladerMargin {
margin-bottom: 3px;
}
+.align-right-close {
+ width: auto;
+ margin-right: 0px;
+ margin-left: auto;
+}
+
/* .baloonGoTop :HOVER { */
/* cursor: pointer; */
/* color: #FFF; */
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServlet.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServlet.java
index 5d86de7..6cfc387 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServlet.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServlet.java
@@ -331,10 +331,10 @@ public class WorkspaceUploadServlet extends HttpServlet {
return workspaceUploader;
} catch (Exception e) {
logger.error("Error during WorkspaceUploaderItem save in session workspace uploader: "+workspaceUploader,e);
- throw new Exception("An error occurred during uploading. Try again");
+ throw new Exception("An error occurred in the upload. Try again");
}
}
- throw new Exception("An error occurred during uploading. Workspace Uploader not found. Abort and try again");
+ throw new Exception("An error occurredin the upload. Workspace Uploader not found. Abort and try again");
}
/**
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServletStream.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServletStream.java
index 8a9fcea..a92899e 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServletStream.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/WorkspaceUploadServletStream.java
@@ -345,13 +345,13 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
workspaceUploader = WsUtil.getWorkspaceUploaderInSession(request.getSession(), clientUploadKey);
} catch (Exception e) {
logger.error("Error during workspace uploader retrieving", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". Error processing request in upload servlet", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". Error processing request in upload servlet", request.getSession());
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error processing request in upload servlet");
return;
}
//TODO DEBUG REMOVE THIS
-// saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". Error processing request in upload servlet", request.getSession());
+// saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". Error processing request in upload servlet", request.getSession());
// response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error processing request in upload servlet");
// return;
@@ -361,14 +361,14 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
wa = WsUtil.getWorkspace(request.getSession());
} catch (Exception e) {
logger.error("Error during workspace retrieving", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". Error processing request in upload servlet", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". Error processing request in upload servlet", request.getSession());
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, "Error processing request in upload servlet");
return;
}
if (wa == null) {
logger.error("Now workspace found in session");
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". No workspace in session", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". No workspace in session", request.getSession());
sendError(response, "Internal error: No workspace in session");
return;
}
@@ -379,14 +379,14 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
item = wa.getItem(destinationId);
} catch (ItemNotFoundException e) {
logger.error("Error, no destination folder found", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". No destination folder found", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". No destination folder found", request.getSession());
sendError(response, "Internal error: No destination folder found");
return;
}
if (item.getType() != WorkspaceItemType.FOLDER && item.getType() != WorkspaceItemType.SHARED_FOLDER) {
logger.error("Error processing request in upload servlet: Wrong destination item");
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading "+fileName+". Wrong destination item", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred during upload: "+fileName+". Wrong destination item", request.getSession());
sendError(response, "Internal error: Wrong destination item");
return;
}
@@ -486,22 +486,22 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
// file.delete();
} catch (InsufficientPrivilegesException e) {
logger.error("Error creating elements", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading. Insufficient privileges", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred in the upload. Insufficient privileges", request.getSession());
sendError(response, "Internal error: Insufficient privileges");
return;
} catch (InternalErrorException e) {
logger.error("Error creating elements", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading:"+e.getMessage(), request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred in the upload:"+e.getMessage(), request.getSession());
sendError(response, "Internal error: "+e.getMessage());
return;
} catch (ItemAlreadyExistException e) {
logger.error("Error creating elements", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading. An item with that name already exists", request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred in the upload. An item with that name already exists", request.getSession());
sendError(response, "Internal error: An item with that name already exists");
return;
}catch (Exception e) {
logger.error("Error creating elements", e);
- saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred when uploading. "+e.getMessage(), request.getSession());
+ saveWorkspaceUploaderStatus(workspaceUploader, UPLOAD_STATUS.FAILED, "An error occurred in the upload. "+e.getMessage(), request.getSession());
// sendError(response, "Internal error: An error occurred on uploading the file, try again later");
return;
}finally{
@@ -574,10 +574,10 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
} catch (Exception e) {
logger.error("Error during WorkspaceUploaderItem save in session workspace uploader: "+workspaceUploader,e);
- throw new Exception("An error occurred during uploading. Try again");
+ throw new Exception("An error occurred in the upload. Try again");
}
}else
- throw new Exception("An error occurred during uploading. Workspace Uploader not found. Abort and try again");
+ throw new Exception("An error occurred in the upload. Workspace Uploader not found. Abort and try again");
}
//TEST TIME
@@ -714,12 +714,12 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
} catch (WrongDestinationException e) {
logger.error("Error creating elements", e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading. Wrong Destination");
+ workspaceUploader.setStatusDescription("An error occurred in the upload. Wrong Destination");
sendError(response, "Internal error: Wrong Destination");
} catch (WorkspaceFolderNotFoundException e) {
logger.error("Error creating elements", e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading. Workspace Folder Not Found");
+ workspaceUploader.setStatusDescription("An error occurred in the upload. Workspace Folder Not Found");
sendError(response, "Internal error: Workspace Folder Not Found");
}finally{
try {
@@ -776,12 +776,12 @@ public class WorkspaceUploadServletStream extends HttpServlet implements Servlet
} catch (WrongDestinationException e) {
logger.error("Error creating elements", e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading. Wrong Destination");
+ workspaceUploader.setStatusDescription("An error occurred in the upload. Wrong Destination");
sendError(response, "Internal error: Wrong Destination");
} catch (WorkspaceFolderNotFoundException e) {
logger.error("Error creating elements", e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading. Workspace Folder Not Found");
+ workspaceUploader.setStatusDescription("An error occurred in the upload. Workspace Folder Not Found");
sendError(response, "Internal error: Workspace Folder Not Found");
}finally{
try {
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderManager.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderManager.java
index a4278c3..ae83d6f 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderManager.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderManager.java
@@ -222,7 +222,7 @@ public class WorkspaceUploaderManager {
return createWorkspaceUploaderFile(request, workspaceUploader, request.getSession(), isOverwrite, wa, file, itemName, destinationFolder, contentType, totolaBytes);
} catch (Exception e) {
logger.error("Error when uploading file to HL : ",e);
- throw new Exception("An error occurred when uploading "+itemName+". Try again");
+ throw new Exception("An error occurred during upload: "+itemName+". Try again");
}
}
@@ -246,7 +246,7 @@ public class WorkspaceUploaderManager {
} catch (Exception e) {
logger.error("Error when uploading Archive to HL creation: ",e);
- throw new Exception("An error occurred when uploading "+itemName+". Try again");
+ throw new Exception("An error occurred during upload: "+itemName+". Try again");
}
}
diff --git a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderMng.java b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderMng.java
index 487822a..24fbce9 100644
--- a/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderMng.java
+++ b/src/main/java/org/gcube/portlets/widgets/workspaceuploader/server/upload/WorkspaceUploaderMng.java
@@ -89,7 +89,7 @@ public class WorkspaceUploaderMng {
WorkspaceUploadServletStream.notifyUploadInSharedFolder(httpSession, wa, createdItem.getId(), createdItem.getParent().getId(), isOvewrite);
}else{
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading \""+itemName + "\". Try again");
+ workspaceUploader.setStatusDescription("An error occurred during upload: \""+itemName + "\". Try again");
}
try {
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
@@ -101,7 +101,7 @@ public class WorkspaceUploaderMng {
| IOException e) {
logger.error("Error during upload: ",e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading "+itemName+": "+e.getMessage());
+ workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+": "+e.getMessage());
try {
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
} catch (Exception e1) {
@@ -110,7 +110,7 @@ public class WorkspaceUploaderMng {
} catch (ItemNotFoundException | WrongItemTypeException | WorkspaceFolderNotFoundException | WrongDestinationException e) {
logger.error("Error during overwrite: ",e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading "+itemName+": "+e.getMessage());
+ workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+": "+e.getMessage());
try {
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
} catch (Exception e1) {
@@ -160,7 +160,7 @@ public class WorkspaceUploaderMng {
} catch (InternalErrorException e) {
logger.error("Error during uploading: ",e);
workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED);
- workspaceUploader.setStatusDescription("An error occurred when uploading "+itemName+": "+e.getMessage());
+ workspaceUploader.setStatusDescription("An error occurred during upload: "+itemName+": "+e.getMessage());
try {
WsUtil.putWorkspaceUploaderInSession(httpSession, workspaceUploader);
} catch (Exception e1) {
@@ -200,7 +200,7 @@ public class WorkspaceUploaderMng {
return createWorkspaceUploaderFile(workspaceUploader, httpSession, isOverwrite, wa, file, itemName, destinationFolder, contentType, totolaBytes);
} catch (Exception e) {
logger.error("Error when uploading file to HL : ",e);
- throw new Exception("An error occurred when uploading "+itemName+". Try again");
+ throw new Exception("An error occurred during upload: "+itemName+". Try again");
}
}
@@ -224,7 +224,7 @@ public class WorkspaceUploaderMng {
} catch (Exception e) {
logger.error("Error when uploading Archive to HL creation: ",e);
- throw new Exception("An error occurred when uploading "+itemName+". Try again");
+ throw new Exception("An error occurred during upload:: "+itemName+". Try again");
}
}