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,7 +5764,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getTabularResource(tabularResourceId); .getTabularResource(tabularResourceId);
List<HistoryStep> history = tabularResource.getHistory(); List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0; long historyId = 0;
String opDesc=null, opName=null; String opDesc = null, opName = null;
HistoryStep lastStep = null; HistoryStep lastStep = null;
OpHistory op = null; OpHistory op = null;
@ -5774,9 +5774,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
opDesc = lastStep.getOperationDescription(); opDesc = lastStep.getOperationDescription();
opName = opDesc; opName = opDesc;
historyId = lastStep.getId().getValue(); historyId = lastStep.getId().getValue();
op = new OpHistory(historyId, opName, op = new OpHistory(historyId, opName, opDesc,
opDesc, sdf.format(lastStep sdf.format(lastStep.getExecutionDate().getTime()));
.getExecutionDate().getTime()));
} }
} }
@ -5818,7 +5817,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<HistoryStep> history = tabularResource.getHistory(); List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0; long historyId = 0;
String opDesc=null, opName=null; String opDesc = null, opName = null;
HistoryStep lastStep = null; HistoryStep lastStep = null;
OpHistory op = null; OpHistory op = null;
@ -5828,9 +5827,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
opDesc = lastStep.getOperationDescription(); opDesc = lastStep.getOperationDescription();
opName = opDesc; opName = opDesc;
historyId = lastStep.getId().getValue(); historyId = lastStep.getId().getValue();
op = new OpHistory(historyId, opName, op = new OpHistory(historyId, opName, opDesc,
opDesc, sdf.format(lastStep sdf.format(lastStep.getExecutionDate().getTime()));
.getExecutionDate().getTime()));
} }
} }
@ -5878,7 +5876,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>(); ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>();
long historyId = 0; long historyId = 0;
String opDesc=null, opName=null; String opDesc = null, opName = null;
OpHistory op = null; OpHistory op = null;
for (HistoryStep step : history) { for (HistoryStep step : history) {
@ -5886,9 +5884,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
historyId = step.getId().getValue(); historyId = step.getId().getValue();
opDesc = step.getOperationDescription(); opDesc = step.getOperationDescription();
opName = step.getOperationDescription(); opName = step.getOperationDescription();
op = new OpHistory(historyId, opName, op = new OpHistory(historyId, opName, opDesc,
opDesc, sdf.format(step sdf.format(step.getExecutionDate().getTime()));
.getExecutionDate().getTime()));
opHistoryList.add(op); opHistoryList.add(op);
} }
} }
@ -5931,7 +5928,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>(); ArrayList<OpHistory> opHistoryList = new ArrayList<OpHistory>();
long historyId = 0; long historyId = 0;
String opDesc=null, opName=null; String opDesc = null, opName = null;
OpHistory op = null; OpHistory op = null;
for (HistoryStep step : history) { for (HistoryStep step : history) {
@ -5939,9 +5936,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
historyId = step.getId().getValue(); historyId = step.getId().getValue();
opDesc = step.getOperationDescription(); opDesc = step.getOperationDescription();
opName = step.getOperationDescription(); opName = step.getOperationDescription();
op = new OpHistory(historyId, opName, op = new OpHistory(historyId, opName, opDesc,
opDesc, sdf.format(step sdf.format(step.getExecutionDate().getTime()));
.getExecutionDate().getTime()));
opHistoryList.add(op); opHistoryList.add(op);
} }
} }
@ -5980,22 +5976,25 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<HistoryStep> history = tabularResource.getHistory(); List<HistoryStep> history = tabularResource.getHistory();
long historyId = 0; long historyId = 0;
String opDesc=null, opName=null; String opDesc = null, opName = null;
OpHistory op = null; OpHistory op = null;
RollBackSession rollBackSession=null; RollBackSession rollBackSession = null;
if (history != null) { if (history != null) {
HistoryStep step = history.get(1); if (history.size() > 1) {
HistoryStep step = history.get(history.size() - 2);
if (step != null) { if (step != null) {
historyId = step.getId().getValue(); historyId = step.getId().getValue();
opDesc= step.getOperationDescription(); opDesc = step.getOperationDescription();
opName= opDesc; opName = opDesc;
op = new OpHistory(historyId, opName, op = new OpHistory(historyId, opName, opDesc,
opDesc, sdf.format(step sdf.format(step.getExecutionDate().getTime()));
.getExecutionDate().getTime())); logger.debug("Discard :" + op);
logger.debug("Discard :"+op); rollBackSession = new RollBackSession(trId, historyId);
rollBackSession=new RollBackSession(trId,historyId);
rollBack(rollBackSession); rollBack(rollBackSession);
} else {
logger.debug("Discard : step null");
}
} else { } else {
logger.debug("Discard : no previous step exist"); logger.debug("Discard : no previous step exist");
} }