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); .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;
if (history != null && history.size() > 0) { if (history != null && history.size() > 0) {
lastStep = history.get(0); lastStep = history.get(0);
if (lastStep != null) { if (lastStep != null) {
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()));
} }
} }
logger.debug("Last Operation Info :" + op); logger.debug("Last Operation Info :" + op);
return op; return op;
@ -5815,22 +5814,21 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId())); Long.valueOf(trId.getId()));
TabularResource tabularResource = service TabularResource tabularResource = service
.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;
if (history != null && history.size() > 0) { if (history != null && history.size() > 0) {
lastStep = history.get(0); lastStep = history.get(0);
if (lastStep != null) { if (lastStep != null) {
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()));
} }
} }
@ -5876,9 +5874,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<HistoryStep> history = tabularResource.getHistory(); List<HistoryStep> history = tabularResource.getHistory();
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,13 +5936,12 @@ 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);
} }
} }
logger.debug("History :" + opHistoryList); logger.debug("History :" + opHistoryList);
return opHistoryList; return opHistoryList;
@ -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) {
if (step != null) { HistoryStep step = history.get(history.size() - 2);
historyId = step.getId().getValue(); if (step != null) {
opDesc= step.getOperationDescription(); historyId = step.getId().getValue();
opName= opDesc; opDesc = step.getOperationDescription();
op = new OpHistory(historyId, opName, opName = opDesc;
opDesc, sdf.format(step op = new OpHistory(historyId, opName, opDesc,
.getExecutionDate().getTime())); sdf.format(step.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");
} }