From c8c7b40cf977d494f4203bc3b8544ca302b98456 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 15 Jul 2014 15:53:56 +0000 Subject: [PATCH] Minor Update git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-unionwizard-widget@98659 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../client/UnionOperationInProgressCard.java | 16 +++++----- .../progress/UnionProgressBarUpdater.java | 12 ++++---- .../client/progress/UnionProgressUpdater.java | 30 +++++++++---------- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java index 167f4b4..07c342f 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/UnionOperationInProgressCard.java @@ -3,6 +3,7 @@ */ package org.gcube.portlets.user.td.unionwizardwidget.client; +import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException; import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession; import org.gcube.portlets.user.td.unionwizardwidget.client.progress.UnionProgressBarUpdater; @@ -15,6 +16,7 @@ import org.gcube.portlets.user.td.wizardwidget.client.WizardCard; import com.allen_sauer.gwt.log.client.Log; import com.google.gwt.user.client.Command; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.FlexTable; import com.sencha.gxt.core.client.util.Margins; import com.sencha.gxt.widget.core.client.FramedPanel; @@ -89,8 +91,8 @@ public class UnionOperationInProgressCard extends WizardCard implements } - public void importCodelistMapping() { - /*TDGWTServiceAsync.INSTANCE.startUnion(unionSession, + public void startUnion() { + TDGWTServiceAsync.INSTANCE.startUnion(unionSession, new AsyncCallback() { public void onSuccess(Void result) { @@ -105,14 +107,14 @@ public class UnionOperationInProgressCard extends WizardCard implements SessionExpiredType.EXPIREDONSERVER)); } else { showErrorAndHide( - "Error in import codelist mapping", - "An error occured in import codelist mapping: " + "Error in Union", + "An error occured in union: " + caught.getLocalizedMessage(), caught.getStackTrace().toString(), caught); } } }); - */ + } @Override @@ -122,7 +124,7 @@ public class UnionOperationInProgressCard extends WizardCard implements setNextButtonVisible(false); getWizardWindow().setEnableNextButton(false); getWizardWindow().setNextButtonToFinish(); - importCodelistMapping(); + startUnion(); } public void operationInitializing() { @@ -163,7 +165,7 @@ public class UnionOperationInProgressCard extends WizardCard implements new SessionExpiredEvent( SessionExpiredType.EXPIREDONSERVER)); } else { - AlertMessageBox d = new AlertMessageBox("Error in Codelist Mapping Import", + AlertMessageBox d = new AlertMessageBox("Error in Union", reason); d.addHideHandler(new HideHandler() { public void onHide(HideEvent event) { diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressBarUpdater.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressBarUpdater.java index 95fbde8..952f4c8 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressBarUpdater.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressBarUpdater.java @@ -36,8 +36,8 @@ public class UnionProgressBarUpdater implements UnionProgressListener { */ @Override public void operationComplete(TRId trId) { - Log.info("Import completed"); - progressBar.updateProgress(1, "Import completed."); + Log.info("Completed"); + progressBar.updateProgress(1, "Completed"); } @@ -46,13 +46,13 @@ public class UnionProgressBarUpdater implements UnionProgressListener { */ @Override public void operationFailed(Throwable caught, String reason, String failureDetails) { - Log.info("Import failed"); - progressBar.updateText("Import failed"); + Log.info("Failed"); + progressBar.updateText("Failed"); } @Override public void operationInitializing() { - Log.info("Inport Inizializing"); + Log.info("Inizializing"); progressBar.updateProgress(0, "Initializing..."); } @@ -63,7 +63,7 @@ public class UnionProgressBarUpdater implements UnionProgressListener { if (elaborated>0 && elaborated<1) { Log.trace("progress "+elaborated); int elab=new Float(elaborated*100).intValue(); - progressBar.updateProgress(elaborated,elab+"% Importing..."); + progressBar.updateProgress(elaborated,elab+"% Progress..."); } if (elaborated == 1) progressBar.updateProgress(1, "Completing..."); diff --git a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressUpdater.java b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressUpdater.java index 8238343..d2d44b8 100644 --- a/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressUpdater.java +++ b/src/main/java/org/gcube/portlets/user/td/unionwizardwidget/client/progress/UnionProgressUpdater.java @@ -6,7 +6,7 @@ package org.gcube.portlets.user.td.unionwizardwidget.client.progress; import java.util.ArrayList; import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync; -import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingMonitor; +import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionMonitor; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import com.allen_sauer.gwt.log.client.Log; @@ -33,7 +33,7 @@ public class UnionProgressUpdater extends Timer { public void run() { Log.debug("requesting operation progress"); TDGWTServiceAsync.INSTANCE - .getCodelistMappingMonitor(new AsyncCallback() { + .getUnionMonitor(new AsyncCallback() { public void onFailure(Throwable caught) { @@ -45,17 +45,17 @@ public class UnionProgressUpdater extends Timer { "Failed getting operation updates", message); } - public void onSuccess(CodelistMappingMonitor result) { - Log.info("retrieved CSVImportMonitor: " + public void onSuccess(UnionMonitor result) { + Log.info("retrieved Monitor: " + result.getStatus()); switch (result.getStatus()) { case INITIALIZING: - Log.info("CSV Import Initializing..."); + Log.info("Initializing..."); fireOperationInitializing(); break; case ABORTED: cancel(); - Log.info("CSV Import Operation Aborted"); + Log.info("Operation Aborted"); break; case IN_PROGRESS: fireOperationUpdate(result.getProgress()); @@ -77,7 +77,7 @@ public class UnionProgressUpdater extends Timer { break; case SUCCEDED: cancel(); - Log.info("Import fisnish:" + Log.info("Fisnish:" + result.getTrId()); fireOperationComplete(result.getTrId()); break; @@ -92,26 +92,26 @@ public class UnionProgressUpdater extends Timer { } - protected void errorMessage(CodelistMappingMonitor result) { - Log.info("Codelist Mapping Import Failed"); + protected void errorMessage(UnionMonitor result) { + Log.info("Union Failed"); Throwable th = null; String failure = null; String details = null; if (result.getError() != null) { th = result.getError(); - failure = "Failed Client Library Codelist Mapping Import"; + failure = "Failed Client Library on Union"; details = result.getError().getLocalizedMessage(); } else { th = new Throwable("Failed"); - failure = "Failed Client Library Codelist Mapping Import"; - details = "Error in codelist mapping import"; + failure = "Failed Client Library on Union"; + details = "Error in union"; } fireOperationFailed(th, failure, details); } - protected void stopMessage(CodelistMappingMonitor result) { - Log.info("Codelist Mapping Import Stopped"); + protected void stopMessage(UnionMonitor result) { + Log.info("Union Stopped"); String failure = null; String details = null; if (result.getError() != null) { @@ -119,7 +119,7 @@ public class UnionProgressUpdater extends Timer { details = result.getError().getLocalizedMessage(); } else { failure = "Stopped"; - details = "Stopped codelist mapping import"; + details = "Stopped Union"; } fireOperationStopped(result.getTrId(),failure, details);