Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99437 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-09-03 15:42:56 +00:00
parent b31f8630f0
commit 4b965e266a
3 changed files with 26 additions and 15 deletions

View File

@ -75,7 +75,7 @@ public class SessionUtil {
ASLSession session;
if (username == null) {
logger.warn("no user found in session, using test one");
throw new TDGWTSessionExpiredException("Session Expired!");
throw new TDGWTSessionExpiredException("Session Expired!");
// Remove comment for Test
/*

View File

@ -1619,7 +1619,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getMetadata(ValidSinceMetadata.class);
if (validSinceMeta != null && validSinceMeta.getValue() != null) {
Calendar validSinceC=validSinceMeta.getValue();
t.setValidFrom(sdfDate.format(validSinceC));
t.setValidFrom(sdfDate.format(validSinceC.getTime()));
} else {
}
@ -1632,7 +1632,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getMetadata(ValidUntilMetadata.class);
if (validUntilMeta != null && validUntilMeta.getValue() != null) {
Calendar validUntilC=validUntilMeta.getValue();
t.setValidUntilTo(sdfDate.format(validUntilC));
t.setValidUntilTo(sdfDate.format(validUntilC.getTime()));
} else {
}

View File

@ -15,6 +15,7 @@ import org.gcube.data.analysis.tabulardata.model.table.Table;
import org.gcube.data.analysis.tabulardata.service.TabularDataService;
import org.gcube.data.analysis.tabulardata.service.impl.TabularDataServiceFactory;
import org.gcube.data.analysis.tabulardata.service.operation.Job;
import org.gcube.data.analysis.tabulardata.service.operation.Task;
import org.gcube.data.analysis.tabulardata.service.operation.ValidationJob;
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResourceId;
@ -26,6 +27,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.task.JobS;
import org.gcube.portlets.user.td.gwtservice.shared.task.State;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskS;
import org.gcube.portlets.user.td.gwtservice.shared.task.TaskWrapper;
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsJobS;
@ -81,7 +83,7 @@ public class OperationMonitorCreator {
OperationMonitor operationMonitor = new OperationMonitor(
operationMonitorSession.getTaskId(),
taskWrapper.getOperationId());
if (taskWrapper == null || taskWrapper.getTask() == null
|| taskWrapper.getTask().getId() == null
|| taskWrapper.getTask().getId().getValue() == null
@ -90,17 +92,26 @@ public class OperationMonitorCreator {
throw new TDGWTServiceException(
"Error in Operation Monitor task is null");
} else {
operationMonitor
.setTaskId(taskWrapper.getTask().getId().getValue());
TaskStatus status = taskWrapper.getTask().getStatus();
if (status == null) {
logger.debug("Services TaskStatus : null");
throw new TDGWTServiceException(
"Error in OperationMonitor Status is null");
} else {
operationMonitor.setTaskId(taskWrapper.getTask().getId()
.getValue());
if (operationMonitorSession.isAbort()) {
Task task = taskWrapper.getTask();
task.abort();
TaskS taskS = createTaskS();
taskS.setState(State.ABORTED);
operationMonitor.setTask(taskS);
} else {
TaskStatus status = taskWrapper.getTask().getStatus();
if (status == null) {
logger.debug("Services TaskStatus : null");
throw new TDGWTServiceException(
"Error in OperationMonitor Status is null");
} else {
TaskS taskS = createTaskS();
operationMonitor.setTask(taskS);
}
}
SessionUtil.setTaskStarted(session, taskWrapper);
postOperation(operationMonitor);
@ -227,12 +238,12 @@ public class OperationMonitorCreator {
operationMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
logger.debug("CurrentTabResource :"+tabResource);
logger.debug("CurrentTabResource :" + tabResource);
if (tabResource != null) {
tabResource.setTrId(trId);
SessionUtil.setTabResource(session, tabResource);
} else {
tabResource=new TabResource();
tabResource = new TabResource();
tabResource.setTrId(trId);
SessionUtil.setTabResource(session, tabResource);
}