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
This commit is contained in:
Giancarlo Panichi 2013-11-28 13:40:35 +00:00
parent eadd94647d
commit 71c52df975
1 changed files with 26 additions and 2 deletions

View File

@ -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) {