Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@94288 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b0cbe6e72b
commit
a99fc93d5d
|
@ -3358,9 +3358,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
capabilities);
|
capabilities);
|
||||||
|
|
||||||
Expression condition = ExpressionGenerator
|
Expression condition = ExpressionGenerator
|
||||||
.genReplaceValueParameterCondition(replaceBatchColumnSession,re);
|
.genReplaceValueParameterCondition(
|
||||||
|
replaceBatchColumnSession, re);
|
||||||
Expression value = ExpressionGenerator
|
Expression value = ExpressionGenerator
|
||||||
.genReplaceBatchValueParameterValue(replaceBatchColumnSession,re);
|
.genReplaceBatchValueParameterValue(
|
||||||
|
replaceBatchColumnSession, re);
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_REPLACE_BY_EXPRESSION_COLUMN_CONDITION,
|
map.put(Constants.PARAMETER_REPLACE_BY_EXPRESSION_COLUMN_CONDITION,
|
||||||
condition);
|
condition);
|
||||||
|
@ -3380,9 +3382,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
capabilities);
|
capabilities);
|
||||||
|
|
||||||
Expression condition = ExpressionGenerator
|
Expression condition = ExpressionGenerator
|
||||||
.genReplaceValueParameterCondition(replaceBatchColumnSession,re);
|
.genReplaceValueParameterCondition(
|
||||||
|
replaceBatchColumnSession, re);
|
||||||
Expression value = ExpressionGenerator
|
Expression value = ExpressionGenerator
|
||||||
.genReplaceBatchValueParameterValue(replaceBatchColumnSession,re);
|
.genReplaceBatchValueParameterValue(
|
||||||
|
replaceBatchColumnSession, re);
|
||||||
|
|
||||||
map.put(Constants.PARAMETER_REPLACE_BY_EXPRESSION_COLUMN_CONDITION,
|
map.put(Constants.PARAMETER_REPLACE_BY_EXPRESSION_COLUMN_CONDITION,
|
||||||
condition);
|
condition);
|
||||||
|
@ -5169,8 +5173,104 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
@Override
|
@Override
|
||||||
public ReplaceBatchColumnMonitor getReplaceBatchColumnMonitor()
|
public ReplaceBatchColumnMonitor getReplaceBatchColumnMonitor()
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
// TODO Auto-generated method stub
|
try {
|
||||||
return null;
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
ReplaceBatchColumnSession replaceBatchColumnSession = SessionUtil
|
||||||
|
.getReplaceBatchColumnSession(session);
|
||||||
|
|
||||||
|
Task task = SessionUtil.getReplaceBatchColumnTask(session);
|
||||||
|
ReplaceBatchColumnMonitor replaceBatchColumnMonitor = new ReplaceBatchColumnMonitor();
|
||||||
|
|
||||||
|
if (task == null) {
|
||||||
|
logger.debug("Task null");
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error in ReplaceBatchColumnMonitor task null");
|
||||||
|
} else {
|
||||||
|
TaskStatus status = task.getStatus();
|
||||||
|
if (status == null) {
|
||||||
|
logger.debug("Services TaskStatus : null");
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error in ReplaceBatchColumnMonitor Status null");
|
||||||
|
} else {
|
||||||
|
logger.debug("Services TaskStatus: " + task.getStatus());
|
||||||
|
|
||||||
|
replaceBatchColumnMonitor.setStatus(TaskStateMap.map(task
|
||||||
|
.getStatus()));
|
||||||
|
|
||||||
|
TRId trId;
|
||||||
|
TabResource tabResource;
|
||||||
|
switch (replaceBatchColumnMonitor.getStatus()) {
|
||||||
|
case FAILED:
|
||||||
|
if (task.getResult() != null) {
|
||||||
|
logger.debug("Task exception:"
|
||||||
|
+ task.getErrorCause());
|
||||||
|
replaceBatchColumnMonitor.setError(new Throwable(task
|
||||||
|
.getErrorCause()));
|
||||||
|
} else {
|
||||||
|
logger.debug("Task exception: Error In ReplaceBatchColumnMonitor");
|
||||||
|
replaceBatchColumnMonitor.setError(new Throwable(
|
||||||
|
"Error replacing the Column value"));
|
||||||
|
}
|
||||||
|
replaceBatchColumnMonitor.setProgress(task.getProgress());
|
||||||
|
break;
|
||||||
|
case SUCCEDED:
|
||||||
|
logger.debug("Task Result:" + task.getResult());
|
||||||
|
replaceBatchColumnMonitor.setProgress(task.getProgress());
|
||||||
|
trId = new TRId();
|
||||||
|
trId.setId(replaceBatchColumnSession.getTrId().getId());
|
||||||
|
|
||||||
|
trId = retrieveTabularResourceBasicData(trId);
|
||||||
|
|
||||||
|
replaceBatchColumnMonitor.setTrId(trId);
|
||||||
|
tabResource = SessionUtil.getTabResource(session);
|
||||||
|
tabResource.setTrId(trId);
|
||||||
|
SessionUtil.setTabResource(session, tabResource);
|
||||||
|
SessionUtil.setTRId(session, trId);
|
||||||
|
break;
|
||||||
|
case IN_PROGRESS:
|
||||||
|
replaceBatchColumnMonitor.setProgress(task.getProgress());
|
||||||
|
break;
|
||||||
|
case VALIDATING_RULES:
|
||||||
|
replaceBatchColumnMonitor.setProgress(task.getProgress());
|
||||||
|
break;
|
||||||
|
case ABORTED:
|
||||||
|
break;
|
||||||
|
case STOPPED:
|
||||||
|
logger.debug("Task Result:" + task.getResult());
|
||||||
|
replaceBatchColumnMonitor.setProgress(task.getProgress());
|
||||||
|
trId = new TRId();
|
||||||
|
trId.setId(replaceBatchColumnSession.getColumnData()
|
||||||
|
.getTrId().getId());
|
||||||
|
|
||||||
|
trId = retrieveTabularResourceBasicData(trId);
|
||||||
|
|
||||||
|
replaceBatchColumnMonitor.setTrId(trId);
|
||||||
|
tabResource = SessionUtil.getTabResource(session);
|
||||||
|
tabResource.setTrId(trId);
|
||||||
|
SessionUtil.setTabResource(session, tabResource);
|
||||||
|
SessionUtil.setTRId(session, trId);
|
||||||
|
break;
|
||||||
|
case INITIALIZING:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SessionUtil.setReplaceBatchColumnTask(session, task);
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.info("ReplaceBatchColumnMonitor(): " + replaceBatchColumnMonitor);
|
||||||
|
return replaceBatchColumnMonitor;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.debug("Error in ReplaceBatchColumnMonitor: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error in replace batch: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,17 @@ public class ReplaceBatchColumnSession implements Serializable {
|
||||||
protected ArrayList<ReplaceEntry> replaceEntryList;
|
protected ArrayList<ReplaceEntry> replaceEntryList;
|
||||||
protected boolean replaceDimension;
|
protected boolean replaceDimension;
|
||||||
|
|
||||||
|
public ReplaceBatchColumnSession() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReplaceBatchColumnSession(TRId trId, ColumnData columnData,
|
||||||
|
ArrayList<ReplaceEntry> replaceEntryList, boolean replaceDimension) {
|
||||||
|
this.trId = trId;
|
||||||
|
this.columnData = columnData;
|
||||||
|
this.replaceEntryList = replaceEntryList;
|
||||||
|
this.replaceDimension = replaceDimension;
|
||||||
|
}
|
||||||
|
|
||||||
public TRId getTrId() {
|
public TRId getTrId() {
|
||||||
return trId;
|
return trId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue