Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111606 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-03 09:53:51 +00:00
parent 05bab63e7f
commit a62a11db11
4 changed files with 72 additions and 59 deletions

View File

@ -6685,7 +6685,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TaskS taskS = new TaskS(task.getId().getValue(),
task.getProgress(), state, task.getErrorCause(),
task.getSubmitter(), task.getStartTime(),
task.getEndTime(), jobSList, collateralTRIds);
task.getEndTime(), jobSList, collateralTRIds, null);
taskSList.add(taskS);
}

View File

@ -201,7 +201,7 @@ public class BackgroundOperationMonitorCreator {
.getTask().getSubmitter(), taskWrapper.getTask()
.getStartTime(),
taskWrapper.getTask().getEndTime(), jobSList,
collateralTRIds);
collateralTRIds, String.valueOf(taskWrapper.getTask().getTabularResourceId().getValue()));
} catch (Throwable e) {
logger.error("error retrieving information about the task, "

View File

@ -59,16 +59,13 @@ public class OperationMonitorCreator {
"yyyy-MM-dd HH:mm");
@SuppressWarnings("unused")
private static SimpleDateFormat sdfDate = new SimpleDateFormat(
"yyyy-MM-dd");
private static SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-MM-dd");
private HttpSession session;
private TaskWrapper taskWrapper;
private OperationMonitorSession operationMonitorSession;
private ASLSession aslSession;
/**
*
* @param task
@ -83,9 +80,6 @@ public class OperationMonitorCreator {
this.taskWrapper = taskWrapper;
this.operationMonitorSession = operationMonitorSession;
}
/**
@ -205,11 +199,16 @@ public class OperationMonitorCreator {
taskWrapper.getTask().getErrorCause(), taskWrapper
.getTask().getSubmitter(), taskWrapper.getTask()
.getStartTime(),
taskWrapper.getTask().getEndTime(), jobSList, collateralTRIds);
taskWrapper.getTask().getEndTime(), jobSList,
collateralTRIds, String.valueOf(taskWrapper.getTask()
.getTabularResourceId().getValue()));
} catch (Throwable e) {
logger.error("error retrieving information about the task, "+e.getLocalizedMessage());
logger.error("error retrieving information about the task, "
+ e.getLocalizedMessage());
e.printStackTrace();
throw new TDGWTServiceException("error retrieving information about the task, "+e.getLocalizedMessage());
throw new TDGWTServiceException(
"error retrieving information about the task, "
+ e.getLocalizedMessage());
}
logger.debug("Retrieved task information");
return taskS;
@ -409,13 +408,17 @@ public class OperationMonitorCreator {
TRId newTRId;
if (viewTable == null) {
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(table.getId()
newTRId = new TRId(
String.valueOf(tr.getId().getValue()),
TabularResourceTypeMap.map(tr.getTabularResourceType()),
tr.getTableType(), String.valueOf(table.getId()
.getValue()), table.getTableType().getName());
} else {
newTRId = new TRId(String.valueOf(tr.getId().getValue()),
TabularResourceTypeMap.map(tr.getTabularResourceType()), tr.getTableType(), String.valueOf(viewTable.getId()
newTRId = new TRId(
String.valueOf(tr.getId().getValue()),
TabularResourceTypeMap.map(tr.getTabularResourceType()),
tr.getTableType(), String.valueOf(viewTable.getId()
.getValue()), viewTable.getTableType()
.getName(), String.valueOf(table.getId()
.getValue()), true);
@ -429,8 +432,7 @@ public class OperationMonitorCreator {
throw e;
} catch (SecurityException e) {
e.printStackTrace();
throw new TDGWTServiceException(
SECURITY_EXCEPTION_RIGHTS);
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
} catch (Throwable e) {
e.printStackTrace();
throw new TDGWTServiceException("Error Retrieving Basic Data: "
@ -484,7 +486,6 @@ public class OperationMonitorCreator {
}
}
/**
* Save export json data on Workspace
*
@ -531,8 +532,8 @@ public class OperationMonitorCreator {
}
}
private String retrieveTabularResourceIdFromTable(
TableId tableId) throws TDGWTServiceException {
private String retrieveTabularResourceIdFromTable(TableId tableId)
throws TDGWTServiceException {
try {
AuthorizationProvider.instance.set(new AuthorizationToken(
aslSession.getUsername(), aslSession.getScope()));
@ -556,5 +557,4 @@ public class OperationMonitorCreator {
}
}

View File

@ -15,15 +15,16 @@ public class TaskS implements Serializable {
private static final long serialVersionUID = 8228657333318157153L;
protected String id;
protected float progress;
protected State state;
protected Throwable errorCause;
protected String submitter;
protected Date startTime;
protected Date endTime;
protected ArrayList<JobS> jobs;
protected ArrayList<TRId> collateralTRIds;
private String id;
private float progress;
private State state;
private Throwable errorCause;
private String submitter;
private Date startTime;
private Date endTime;
private ArrayList<JobS> jobs;
private ArrayList<TRId> collateralTRIds;
private String tabularResourceId;
public TaskS() {
@ -40,11 +41,12 @@ public class TaskS implements Serializable {
* @param endTime
* @param jobs
* @param collateralTRIds
* @param tabularResourceId TODO
*
*/
public TaskS(String id, float progress, State state, Throwable errorCause,
String submitter, Date startTime, Date endTime,
ArrayList<JobS> jobs, ArrayList<TRId> collateralTRIds) {
ArrayList<JobS> jobs, ArrayList<TRId> collateralTRIds, String tabularResourceId) {
this.id = id;
this.progress = progress;
this.state = state;
@ -54,6 +56,7 @@ public class TaskS implements Serializable {
this.endTime = endTime;
this.jobs = jobs;
this.collateralTRIds = collateralTRIds;
this.tabularResourceId=tabularResourceId;
}
public String getId() {
@ -128,13 +131,23 @@ public class TaskS implements Serializable {
this.collateralTRIds = collateralTRIds;
}
public String getTabularResourceId() {
return tabularResourceId;
}
public void setTabularResourceId(String tabularResourceId) {
this.tabularResourceId = tabularResourceId;
}
@Override
public String toString() {
return "TaskS [id=" + id + ", progress=" + progress + ", state="
+ state + ", errorCause=" + errorCause + ", submitter="
+ submitter + ", startTime=" + startTime + ", endTime="
+ endTime + ", jobs=" + jobs + ", collateralTRIds="
+ collateralTRIds + "]";
+ collateralTRIds + ", tabularResourceId=" + tabularResourceId
+ "]";
}
}