Added check on tabular resource of type flow

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@100985 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-10-24 16:18:50 +00:00
parent ea14059285
commit 64bd8edf11
1 changed files with 64 additions and 29 deletions

View File

@ -3901,6 +3901,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
return parameterInstances;
}
/**
*
* @param trId
* @throws TDGWTServiceException
*/
protected void checkTRId(TRId trId) throws TDGWTServiceException {
if (trId == null) {
logger.error("TRId is null");
@ -4037,9 +4043,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
// Export SDMX Codelist
OperationDefinition exportSDMXOperation = OperationDefinitionMap
.map(OperationsId.SDMXCodelistExport.toString(), service);
@ -4109,7 +4116,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
OpExecution4CSVExport opEx = new OpExecution4CSVExport(session,
@ -4182,7 +4190,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
OpExecution4JSONExport opEx = new OpExecution4JSONExport(session,
@ -4248,7 +4257,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4309,6 +4319,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4369,7 +4380,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(deleteColumnSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4445,7 +4457,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4522,7 +4535,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4593,7 +4607,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(labelColumnSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4656,7 +4671,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(changeTableTypeSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4835,7 +4851,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(deleteRowsSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -4985,7 +5002,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(duplicatesSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -5245,7 +5263,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TabularResourceId tabularResourceId = new TabularResourceId(
Long.valueOf(tabResource.getTrId().getId()));
TabularResource tr = service.getTabularResource(tabularResourceId);
checkTabularResourceLocked(tr);
checkTabularResourceIsFinal(tr);
@ -5608,7 +5627,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(replaceColumnSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -5674,7 +5694,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(replaceBatchColumnSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6015,7 +6036,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(trId.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6122,7 +6144,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(rollBackSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6273,7 +6296,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(editRowSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6386,7 +6410,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(taskResubmitSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6445,7 +6470,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(taskResumeSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6594,7 +6620,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(extractCodelistSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
OpExecution4ExtractCodelist opEx = new OpExecution4ExtractCodelist(
@ -6658,7 +6685,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6724,7 +6752,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -6970,7 +6999,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(codelistMappingSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -7017,7 +7047,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(groupBySession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -7078,7 +7109,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(normalizationSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -7144,7 +7176,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(denormalizationSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -7206,7 +7239,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(unionSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
checkTabularResourceIsFinal(tabularResource);
@ -7267,7 +7301,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Long.valueOf(statisticalOperationSession.getTrId().getId()));
TabularResource tabularResource = service
.getTabularResource(tabularResourceId);
checkTabularResourceIsFlow(tabularResource);
checkTabularResourceLocked(tabularResource);
OpExecution4StatisticalOperation opEx = new OpExecution4StatisticalOperation(service, aslSession,