From 61cee757aca8bfed76f5dabeb5f781fd4d60e10e Mon Sep 17 00:00:00 2001 From: Massimiliano Assante Date: Tue, 9 Jan 2018 14:07:47 +0000 Subject: [PATCH] Issue #10831, Workspace download folder tomcat temp occupation issue. the zipped file is deleted from the gateway temp right after it is copied to the storage volatile area. An http link to download the file via the URI Resolver is then given to the user git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/workspace-tree-widget@162013 82a268e6-3cf1-43bd-a215-b396298e98cf --- distro/changelog.xml | 6 ++++- pom.xml | 4 +-- .../client/util/FolderDownloadDialog.java | 26 +++++-------------- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/distro/changelog.xml b/distro/changelog.xml index 53a87a4..5e95d4b 100644 --- a/distro/changelog.xml +++ b/distro/changelog.xml @@ -1,4 +1,8 @@ - + + + Issue #10831, Workspace download folder tomcat temp occupation issue + Feature #9760: WS-Thredds synch folder integration diff --git a/pom.xml b/pom.xml index b6b21d0..a3ab9a2 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ org.gcube.portlets.user workspace-tree-widget - 6.18.0-SNAPSHOT + 6.19.0-SNAPSHOT gCube Workspace Tree Widget gCube Workspace Tree Widget is a widget to navigate and interact with gCube Workspace @@ -36,7 +36,7 @@ 1.7 1.8 - -Xdoclint:none + UTF-8 UTF-8 diff --git a/src/main/java/org/gcube/portlets/user/workspace/client/util/FolderDownloadDialog.java b/src/main/java/org/gcube/portlets/user/workspace/client/util/FolderDownloadDialog.java index 142cfc7..308f30d 100644 --- a/src/main/java/org/gcube/portlets/user/workspace/client/util/FolderDownloadDialog.java +++ b/src/main/java/org/gcube/portlets/user/workspace/client/util/FolderDownloadDialog.java @@ -16,6 +16,7 @@ import com.github.gwtbootstrap.client.ui.Icon; import com.github.gwtbootstrap.client.ui.Paragraph; import com.github.gwtbootstrap.client.ui.constants.IconType; import com.google.gwt.core.client.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.http.client.RequestBuilder; @@ -23,6 +24,7 @@ import com.google.gwt.typedarrays.shared.ArrayBuffer; import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; +import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.HasAlignment; import com.google.gwt.user.client.ui.VerticalPanel; @@ -37,14 +39,14 @@ public class FolderDownloadDialog extends GCubeDialog implements WebSocketListen private VerticalPanel topPanel = new VerticalPanel(); private Icon loading = new Icon(); Button close = new Button("Cancel Download"); - private Paragraph toShow = new Paragraph("Locating folder, please wait ..."); + private HTML toShow = new HTML("Locating folder, please wait ..."); private String webSocketURL; public FolderDownloadDialog(final FileDownloadEvent folder2Download, String username) { this.webSocket.setListener( this ); this.username = username; setText("Preparing folder download"); - + toShow.getElement().getStyle().setFontSize(14, Unit.PX); loading.setSpin(true); loading.setType(IconType.ROTATE_RIGHT); @@ -144,20 +146,12 @@ public class FolderDownloadDialog extends GCubeDialog implements WebSocketListen break; default: //the thread zipping has finished, is sending the zipped filepath on the server - toShow.setText("Compressing folder success, starting download"); - triggerDownloadFile(textData); + toShow.setHTML("Compressing folder success, click here to download"); loading.setIcon(IconType.OK_SIGN); loading.setSpin(false); - close.setText("Hide"); + close.setText("Close"); this.setModal(false); webSocket.close(); - Timer t = new Timer() { - @Override - public void run() { - hide(); - } - }; - t.schedule(1000); break; } } @@ -171,14 +165,6 @@ public class FolderDownloadDialog extends GCubeDialog implements WebSocketListen toShow.setText("Error contacting the server socket, please refresh this page and retry"); } - private void triggerDownloadFile(String filePathOnServer) { - try { - new RequestBuilderWorkspaceValidateItem(RequestBuilder.GET,ConstantsExplorer.DOWNLOAD_WORKSPACE_FOLDER_SERVLET, "filepath="+filePathOnServer, "_self", downloadHandlerCallback); - } catch (Exception e) { - new MessageBoxAlert("Error", e.getMessage(), null); - } - } - public AsyncCallback downloadHandlerCallback = new AsyncCallback() { @Override