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
This commit is contained in:
parent
a2754c67f3
commit
6e0a5f6da6
|
@ -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<HideMonitorEventHandler> {
|
||||
public static Type<HideMonitorEventHandler> TYPE = new Type<HideMonitorEventHandler>();
|
||||
|
||||
/**
|
||||
* Instantiates a new cancel upload event.
|
||||
*/
|
||||
public HideMonitorEvent() {
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<HideMonitorEventHandler> 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);
|
||||
}
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
||||
/**
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
|
@ -10,6 +10,7 @@ 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;
|
||||
|
@ -29,6 +30,7 @@ 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;
|
||||
|
@ -77,7 +79,7 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
|
|||
*/
|
||||
public DialogUpload(String headerTitle, final String parentId, UPLOAD_TYPE uploadType){
|
||||
super(false, true, headerTitle);
|
||||
|
||||
setWidth("400px");
|
||||
fileUpload = new FileUpload();
|
||||
|
||||
//ONLY IN CASE OF FILE MULTIPLE UPLOAD IS AVAILABLE
|
||||
|
@ -105,24 +107,14 @@ public class DialogUpload extends ClosableDialog implements HasWorskpaceUploadNo
|
|||
|
||||
initJsonClientKeys();
|
||||
panel.add(jsonClientKeys);
|
||||
|
||||
panel.add(fileUpload);
|
||||
hpBottom = new HorizontalPanel();
|
||||
hpBottom.getElement().getStyle().setMarginTop(10, Unit.PX);
|
||||
|
||||
if(uploadType.equals(UPLOAD_TYPE.File)){
|
||||
HTML msg = new HTML("<p>To select multiple files, press and hold down the Ctrl key, and then click each item </p><p style='margin:-3px 0;'> that you want to select</p>");
|
||||
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("<p>To select multiple files, press and hold down the Ctrl key, and then</p><p style='margin:-3px 0;'>click each item that you want to select</p>");
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<String, WorkspaceUploaderItem> mapUploading = new HashMap<String, WorkspaceUploaderItem>();
|
||||
// private Map<String, Timer> mapTimer = new HashMap<String, Timer>();
|
||||
// private Map<String, DialogBox> mapDialog= new HashMap<String, DialogBox>();
|
||||
private Map<String, UploaderProgressView> mapPanels = new HashMap<String, UploaderProgressView>();
|
||||
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 = "<div><img src='"+WorkspaceUploaderResources.getImageCancel().getUrl()+"'>";
|
||||
String msg = StringUtil.ellipsize("Aborting upload: "+fileName, MAX_CHARS, 0);
|
||||
text+="<span style='margin-left:5px; vertical-align: top;'>"+msg+"</span></div>";
|
||||
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 = "<div><img src='"+WorkspaceUploaderResources.getImageCompleted().getUrl()+"'>";
|
||||
// text+="<span style='margin-left:5px; vertical-align: top;'>"+StringUtil.ellipsize(uploader.getFile().getFileName()+" uploaded successfully!", MAX_CHARS, 0)+"</span></div>";
|
||||
//// GWT.log(text);
|
||||
// html.setHTML(text);
|
||||
// html.setTitle(uploader.getStatusDescription());
|
||||
// break;
|
||||
// case FAILED:
|
||||
// text = "<div><img src='"+WorkspaceUploaderResources.getImageFailed().getUrl()+"'>";
|
||||
// text+="<span style='margin-left:5px; vertical-align: top;'>"+StringUtil.ellipsize(uploader.getStatusDescription(), MAX_CHARS, 0)+"</span></div>";
|
||||
//// GWT.log(text);
|
||||
// html.setHTML(text);
|
||||
// html.setTitle(uploader.getStatusDescription());
|
||||
// break;
|
||||
// case IN_PROGRESS:
|
||||
// text = "<div><img src='"+WorkspaceUploaderResources.getImageUpload().getUrl()+"'>";
|
||||
// String msg = StringUtil.ellipsize(uploader.getUploadProgress().getLastEvent().getReadPercentage()+"% "+uploader.getFile().getFileName(), MAX_CHARS, 0);
|
||||
// text+="<span style='margin-left:5px; vertical-align: top;'>"+msg+"</span>";
|
||||
// text+="</div>";
|
||||
//// 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 = "<div><img src='"+WorkspaceUploaderResources.getImageLoading().getUrl()+"'>";
|
||||
//
|
||||
// String descr = "";
|
||||
// if(uploader.getFile()!=null && uploader.getFile().getFileName()!=null)
|
||||
// descr = uploader.getFile().getFileName();
|
||||
// else
|
||||
// descr = uploader.getStatusDescription();
|
||||
//
|
||||
// text+="<span style='margin-left:5px; vertical-align: top;'>"+descr+"</span>";
|
||||
// text+="</div>";
|
||||
//// 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");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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; */
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue