Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@94978 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-04-17 14:35:41 +00:00
parent 8346c76f88
commit 4ad7b3e5fd
1 changed files with 35 additions and 36 deletions

View File

@ -5764,23 +5764,22 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getTabularResource(tabularResourceId);
List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0;
String opDesc=null, opName=null;
String opDesc = null, opName = null;
HistoryStep lastStep = null;
OpHistory op = null;
if (history != null && history.size() > 0) {
lastStep = history.get(0);
if (lastStep != null) {
opDesc = lastStep.getOperationDescription();
opName = opDesc;
historyId = lastStep.getId().getValue();
op = new OpHistory(historyId, opName,
opDesc, sdf.format(lastStep
.getExecutionDate().getTime()));
op = new OpHistory(historyId, opName, opDesc,
sdf.format(lastStep.getExecutionDate().getTime()));
}
}
logger.debug("Last Operation Info :" + op);
return op;
@ -5815,22 +5814,21 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0;
String opDesc=null, opName=null;
String opDesc = null, opName = null;
HistoryStep lastStep = null;
OpHistory op = null;
if (history != null && history.size() > 0) {
lastStep = history.get(0);
if (lastStep != null) {
opDesc = lastStep.getOperationDescription();
opName = opDesc;
historyId = lastStep.getId().getValue();
op = new OpHistory(historyId, opName,
opDesc, sdf.format(lastStep
.getExecutionDate().getTime()));
op = new OpHistory(historyId, opName, opDesc,
sdf.format(lastStep.getExecutionDate().getTime()));
}
}
@ -5876,9 +5874,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<HistoryStep> history = tabularResource.getHistory();
ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>();
long historyId = 0;
String opDesc=null, opName=null;
String opDesc = null, opName = null;
OpHistory op = null;
for (HistoryStep step : history) {
@ -5886,9 +5884,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
historyId = step.getId().getValue();
opDesc = step.getOperationDescription();
opName = step.getOperationDescription();
op = new OpHistory(historyId, opName,
opDesc, sdf.format(step
.getExecutionDate().getTime()));
op = new OpHistory(historyId, opName, opDesc,
sdf.format(step.getExecutionDate().getTime()));
opHistoryList.add(op);
}
}
@ -5931,7 +5928,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>();
long historyId = 0;
String opDesc=null, opName=null;
String opDesc = null, opName = null;
OpHistory op = null;
for (HistoryStep step : history) {
@ -5939,13 +5936,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
historyId = step.getId().getValue();
opDesc = step.getOperationDescription();
opName = step.getOperationDescription();
op = new OpHistory(historyId, opName,
opDesc, sdf.format(step
.getExecutionDate().getTime()));
op = new OpHistory(historyId, opName, opDesc,
sdf.format(step.getExecutionDate().getTime()));
opHistoryList.add(op);
}
}
logger.debug("History :" + opHistoryList);
return opHistoryList;
@ -5980,22 +5976,25 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0;
String opDesc=null, opName=null;
String opDesc = null, opName = null;
OpHistory op = null;
RollBackSession rollBackSession=null;
RollBackSession rollBackSession = null;
if (history != null) {
HistoryStep step = history.get(1);
if (step != null) {
historyId = step.getId().getValue();
opDesc= step.getOperationDescription();
opName= opDesc;
op = new OpHistory(historyId, opName,
opDesc, sdf.format(step
.getExecutionDate().getTime()));
logger.debug("Discard :"+op);
rollBackSession=new RollBackSession(trId,historyId);
rollBack(rollBackSession);
if (history.size() > 1) {
HistoryStep step = history.get(history.size() - 2);
if (step != null) {
historyId = step.getId().getValue();
opDesc = step.getOperationDescription();
opName = opDesc;
op = new OpHistory(historyId, opName, opDesc,
sdf.format(step.getExecutionDate().getTime()));
logger.debug("Discard :" + op);
rollBackSession = new RollBackSession(trId, historyId);
rollBack(rollBackSession);
} else {
logger.debug("Discard : step null");
}
} else {
logger.debug("Discard : no previous step exist");
}