From 0e223944866283f6c64cd88620a74c1fcda1b378 Mon Sep 17 00:00:00 2001 From: francesco Date: Tue, 13 Oct 2020 17:19:34 +0200 Subject: [PATCH] added logs --- .classpath | 10 +++++-- .settings/org.eclipse.wst.common.component | 28 +++++++++++++------ pom.xml | 1 - .../MetadataProfileFormBuilder.gwt.xml | 6 ++-- .../client/ui/upload/ProgressBar.ui.xml | 6 ++-- .../client/ui/upload/SingleUploadMonitor.java | 3 +- .../client/ui/upload/TimerUpload.java | 9 ++++-- ...tadataProfileFormBuilderUploadServlet.java | 1 + .../shared/upload/FileUploaded.java | 7 +++-- .../shared/upload/FileUploadingState.java | 4 +-- .../shared/upload/UploadProgress.java | 8 ++++-- .../MetadataProfileFormBuilder.gwt.xml | 6 ++-- 12 files changed, 58 insertions(+), 31 deletions(-) diff --git a/.classpath b/.classpath index 30fb155..cc87779 100644 --- a/.classpath +++ b/.classpath @@ -6,13 +6,19 @@ - + - + + + + + + + diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index 340db2b..374e13f 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,45 +1,55 @@ - + + - + + - + + - + + - + + - + + + - + + - + + - + + diff --git a/pom.xml b/pom.xml index 873f903..98da155 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,6 @@ commons-fileupload commons-fileupload - provided org.gcube.portal diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml index 5dcfe6d..f5ca028 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml @@ -6,8 +6,7 @@ - + @@ -19,8 +18,7 @@ - + diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/ProgressBar.ui.xml b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/ProgressBar.ui.xml index 6fd613c..2c6bf10 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/ProgressBar.ui.xml +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/ProgressBar.ui.xml @@ -1,9 +1,11 @@ + xmlns:g="urn:import:com.google.gwt.user.client.ui" + xmlns:b="urn:import:com.github.gwtbootstrap.client.ui">
- + 0% diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/SingleUploadMonitor.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/SingleUploadMonitor.java index e8f06b7..a0e0ece 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/SingleUploadMonitor.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/SingleUploadMonitor.java @@ -3,6 +3,7 @@ package org.gcube.portlets.widgets.mpformbuilder.client.ui.upload; import java.util.HashMap; import java.util.Map; +import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder; import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent; import org.gcube.portlets.widgets.mpformbuilder.client.ui.upload.events.NotifyUploadEvent.UPLOAD_EVENT_TYPE; @@ -44,7 +45,7 @@ public class SingleUploadMonitor { */ private void startTimer(TimerUpload timer){ String clientUploadKey = timer.getInitWorkspaceUploader().getClientUploadKey(); - GWT.log("Starting new timer for key: "+clientUploadKey); + ConstantsMPFormBuilder.jslog("Starting new timer for key: "+clientUploadKey); currentTimersRun.put(clientUploadKey, timer); timer.scheduleRepeating(2000); } diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/TimerUpload.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/TimerUpload.java index 0c47a6d..bf14e2a 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/TimerUpload.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/client/ui/upload/TimerUpload.java @@ -56,12 +56,17 @@ public class TimerUpload extends Timer{ @Override public void run() { + ConstantsMPFormBuilder.jslog("Timer run called"); + final SingleUploadMonitor monitor = SingleUploadMonitor.getInstance(); + ConstantsMPFormBuilder.jslog("Calling getUpload Status..."); + MetadataProfileFormBuilderServiceAsync.Util.getInstance().getUploadStatus(initWorkspaceUploader.getClientUploadKey(), new AsyncCallback() { @Override public void onSuccess(final FileUploadingState result) { + ConstantsMPFormBuilder.jslog("getUploadStatus returned: "+result); try{ synchronized(this){ lastWorkspaceUploader = result; @@ -110,7 +115,7 @@ public class TimerUpload extends Timer{ upv.update(result);; }else{ // monitor.deleteUploaderByClientKey(workspaceUploader.getClientUploadKey()); - GWT.log("Timer is null or already closed or completed"); + ConstantsMPFormBuilder.jslog("Timer is null or already closed or completed"); cancel(); monitor.removeTimer(initWorkspaceUploader.getClientUploadKey()); } @@ -140,7 +145,7 @@ public class TimerUpload extends Timer{ */ @Override public void cancel() { - GWT.log("Cancelling timer for "+lastWorkspaceUploader); + ConstantsMPFormBuilder.jslog("Cancelling timer for "+lastWorkspaceUploader); super.cancel(); } diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/server/MetadataProfileFormBuilderUploadServlet.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/server/MetadataProfileFormBuilderUploadServlet.java index 4a0f86d..c43f890 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/server/MetadataProfileFormBuilderUploadServlet.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/server/MetadataProfileFormBuilderUploadServlet.java @@ -531,6 +531,7 @@ public class MetadataProfileFormBuilderUploadServlet extends HttpServlet impleme workspaceUploader.setStatusDescription("File uploaded correclty"); workspaceUploader.setUploadStatus(UPLOAD_STATUS.COMPLETED); saveWorkspaceUploaderInSession(workspaceUploader, request.getSession()); + logger.info("File uploaded at: "+tempFile.getAbsolutePath()); }catch (Exception e) { workspaceUploader.setStatusDescription("Error on uploading: "+fileName+". "+e.getMessage()); workspaceUploader.setUploadStatus(UPLOAD_STATUS.FAILED); diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploaded.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploaded.java index 24a6cc7..65cf9e4 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploaded.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploaded.java @@ -5,6 +5,8 @@ package org.gcube.portlets.widgets.mpformbuilder.shared.upload; import java.io.Serializable; +import com.google.gwt.user.client.rpc.IsSerializable; + /** * The Class FileUploaded. @@ -13,12 +15,13 @@ import java.io.Serializable; * * Oct 8, 2020 */ -public class FileUploaded implements Serializable{ +public class FileUploaded implements Serializable, IsSerializable{ + /** * */ - private static final long serialVersionUID = -3849355202624924112L; + private static final long serialVersionUID = -7869956386977214114L; /** The file name. */ private String fileName; diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploadingState.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploadingState.java index e091a27..460072b 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploadingState.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/FileUploadingState.java @@ -17,11 +17,11 @@ import com.google.gwt.user.client.rpc.IsSerializable; */ public class FileUploadingState implements Serializable, IsSerializable{ + /** * */ - private static final long serialVersionUID = 2858520729654840274L; - + private static final long serialVersionUID = 5634754596251776526L; /** * The Enum UPLOAD_STATUS. diff --git a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/UploadProgress.java b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/UploadProgress.java index 3cbdf91..39dba08 100644 --- a/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/UploadProgress.java +++ b/src/main/java/org/gcube/portlets/widgets/mpformbuilder/shared/upload/UploadProgress.java @@ -4,18 +4,22 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.List; +import com.google.gwt.user.client.rpc.IsSerializable; + /** * The Class UploadProgress. * * @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it * Sep 1, 2015 */ -public final class UploadProgress implements Serializable{ +public final class UploadProgress implements Serializable, IsSerializable{ + /** * */ - private static final long serialVersionUID = 419707497192632320L; + private static final long serialVersionUID = 8859140133243692103L; + private List events = new ArrayList(); /** diff --git a/src/main/resources/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml b/src/main/resources/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml index 5dcfe6d..f5ca028 100644 --- a/src/main/resources/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml +++ b/src/main/resources/org/gcube/portlets/widgets/mpformbuilder/MetadataProfileFormBuilder.gwt.xml @@ -6,8 +6,7 @@ - + @@ -19,8 +18,7 @@ - +