From 71c52df9753089e06e62e57bfd5e8301082da3da Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 28 Nov 2013 13:40:35 +0000 Subject: [PATCH] Updated Client Library git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@86318 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/server/TDGWTServiceImpl.java | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 80e6173..7fdf89b 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -75,6 +75,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.file.FileUploadState; import org.gcube.portlets.user.td.gwtservice.shared.file.HeaderPresence; import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportMonitor; import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXImportSession; +import org.gcube.portlets.user.td.gwtservice.shared.task.State; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; @@ -602,6 +603,26 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements throw new TDGWTServiceException("OperationDescriptor not found"); } + + protected State matchTaskState(TaskStatus status){ + switch (status) { + case INITIALIZING: + return State.INITIALIZING; + case FAILED: + return State.FAILED; + case ABORTED: + return State.ABORTED; + case IN_PROGRESS: + return State.IN_PROGRESS; + case SUCCEDED: + return State.SUCCEDED; + case FALLBACK: + return State.FAILED; + default: + return State.FAILED; + } + } + /** * {@inheritDoc} @@ -634,7 +655,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } else { logger.debug("Service Task.getStatus(): " + task.getStatus()); - importMonitor.setStatus(task.getStatus().ordinal()); + + importMonitor.setStatus(matchTaskState(task.getStatus())); + switch (importMonitor.getStatus()) { case SUCCEDED: importMonitor.setProgress(task.getProgress()); @@ -990,7 +1013,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements "Error in importCSV Status null"); } else { logger.debug("Status: " + task.getStatus()); - importMonitor.setStatus(task.getStatus().ordinal()); + + importMonitor.setStatus(matchTaskState(task.getStatus())); switch (importMonitor.getStatus()) { case FAILED: if (task.getResult() != null) {