Minor Updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@92350 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-26 17:11:48 +00:00
parent 245e979ec1
commit cac1c139ff
1 changed files with 84 additions and 97 deletions

View File

@ -546,7 +546,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
/**
*
* {@inheritDoc}
@ -560,8 +559,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
aslSession.getUsername()));
TabularDataService service = TabularDataServiceFactory.getService();
Table table = service.getTable(new TableId(Long
.valueOf(trId.getTableId())));
Table table = service.getTable(new TableId(Long.valueOf(trId
.getTableId())));
TableData tData = new TableData();
trId.setTableId(String.valueOf(table.getId().getValue()));
@ -589,14 +588,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
return tData;
} catch (Exception e) {
logger.error("Error in getTable(): " + e.getLocalizedMessage(),
e);
logger.error("Error in getTable(): " + e.getLocalizedMessage(), e);
throw new TDGWTServiceException("Error in getTable(): "
+ e.getLocalizedMessage());
}
}
/**
* Not used now, but it will be necessary in the future to retrieve task
* pending
@ -755,6 +752,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
try {
HttpSession session = this.getThreadLocalRequest().getSession();
logger.debug(plc.toString());
ArrayList<TabResource> ltr = SessionUtil
.getCodelistsPagingLoaded(session);
ArrayList<OrderInfo> listOrderInfo = SessionUtil
@ -767,16 +766,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
"Error no codelist present in session");
}
ArrayList<TabResource> ltrTemp = new ArrayList<TabResource>();
if (ltr.size() != 0) {
if (listOrderInfo == null) {
logger.info("No listOrderInfo present in session");
}
if (filter == null) {
logger.error("No filter filter present in session");
logger.info("No filter filter present in session");
}
if (plc.getOffset() < 0 || plc.getOffset() >= ltr.size()) {
logger.error("Error CodelistPagingLoadConfig no valid range request");
logger.error("Error CodelistPagingLoadConfig no valid range request, listsize: "
+ ltr.size());
throw new TDGWTServiceException(
"Error CodelistPagingLoadConfig no valid range request");
}
@ -786,13 +789,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
request_end = ltr.size();
}
ArrayList<TabResource> ltrTemp = new ArrayList<TabResource>();
if (filter.compareTo(plc.getFilter()) != 0) {
}
//ordering
// ordering
for (int i = plc.getOffset(); i < request_end; i++) {
try {
@ -809,6 +811,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
}
CodelistPagingLoadResult codelistPagingLoadResult = new CodelistPagingLoadResult();
codelistPagingLoadResult.setFilter(plc.getFilter());
codelistPagingLoadResult.setListOrderInfo(plc.getListOrderInfo());
@ -1030,8 +1034,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<OperationDefinition> capabilities = service.getCapabilities();
// Import SDMX Codelist takes id 200
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap.map(
OperationsId.SDMXCodelistImport.toString(), capabilities);
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap
.map(OperationsId.SDMXCodelistImport.toString(),
capabilities);
TabResource sdmxImportTabResource = sdmxImportSession
.getTabResource();
@ -1065,10 +1070,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
/**
* {@inheritDoc}
*/
@ -1100,8 +1101,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Service Task.getStatus(): "
+ task.getStatus());
importMonitor
.setStatus(TaskStateMap.map(task.getStatus()));
importMonitor.setStatus(TaskStateMap.map(task
.getStatus()));
switch (importMonitor.getStatus()) {
case SUCCEDED:
@ -1429,8 +1430,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
// Import CSV file
OperationDefinition importCSVFileOperation = OperationDefinitionMap.map(
OperationsId.CSVImport.toString(), capabilities);
OperationDefinition importCSVFileOperation = OperationDefinitionMap
.map(OperationsId.CSVImport.toString(), capabilities);
OperationExecution invocation = new OperationExecution(
importCSVFileOperation.getOperationId(), parameterInstance);
@ -1487,8 +1488,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} else {
logger.debug("Status: " + task.getStatus());
importMonitor
.setStatus(TaskStateMap.map(task.getStatus()));
importMonitor.setStatus(TaskStateMap.map(task
.getStatus()));
switch (importMonitor.getStatus()) {
case FAILED:
if (task.getResult() != null) {
@ -2147,8 +2148,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<OperationDefinition> capabilities = service.getCapabilities();
// Export CSV file
OperationDefinition exportCSVFileOperation = OperationDefinitionMap.map(
OperationsId.CSVExport.toString(), capabilities);
OperationDefinition exportCSVFileOperation = OperationDefinitionMap
.map(OperationsId.CSVExport.toString(), capabilities);
OperationExecution invocation = new OperationExecution(
exportCSVFileOperation.getOperationId(), parameterInstance);
@ -2318,8 +2319,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
if (changeColumnTypeSession.getColumnTypeCodeTarget().compareTo(
ColumnTypeCode.MEASURE) == 0) {
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeToMeasureColumn.toString(), capabilities);
operationDefinition = OperationDefinitionMap
.map(OperationsId.ChangeToMeasureColumn.toString(),
capabilities);
map.put(Constants.PARAMETER_TARGET_DATA_TYPE, ColumnDataTypeMap
.map(changeColumnTypeSession.getColumnDataTypeTarget()));
@ -2362,8 +2364,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
.compareTo(ColumnTypeCode.CODEDESCRIPTION) == 0) {
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeToCodeDescription
.toString(),
capabilities);
.toString(), capabilities);
invocation = new OperationExecution(
changeColumnTypeSession.getColumnData()
.getColumnId(),
@ -2372,10 +2373,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
if (changeColumnTypeSession
.getColumnTypeCodeTarget().compareTo(
ColumnTypeCode.ANNOTATION) == 0) {
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeToAnnotationColumn
.toString(),
capabilities);
operationDefinition = OperationDefinitionMap
.map(OperationsId.ChangeToAnnotationColumn
.toString(), capabilities);
invocation = new OperationExecution(
changeColumnTypeSession.getColumnData()
.getColumnId(),
@ -2405,7 +2405,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
return invocation;
}
protected OperationExecution retriveOperationExecution(
TabularDataService service, DeleteColumnSession deleteColumnSession)
throws TDGWTServiceException {
@ -2420,14 +2419,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
operationDefinition = OperationDefinitionMap.map(
OperationsId.RemoveColumn.toString(), capabilities);
invocation = new OperationExecution(deleteColumnSession
.getColumnData().getColumnId(),
operationDefinition.getOperationId(), map);
invocation = new OperationExecution(deleteColumnSession.getColumnData()
.getColumnId(), operationDefinition.getOperationId(), map);
return invocation;
}
protected OperationExecution retriveOperationExecution(
TabularDataService service, LabelColumnSession labelColumnSession)
throws TDGWTServiceException {
@ -2442,16 +2439,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeLabel.toString(), capabilities);
invocation = new OperationExecution(labelColumnSession
.getColumnData().getColumnId(),
operationDefinition.getOperationId(), map);
invocation = new OperationExecution(labelColumnSession.getColumnData()
.getColumnId(), operationDefinition.getOperationId(), map);
return invocation;
}
protected OperationExecution retriveOperationExecution(
TabularDataService service, ChangeTableTypeSession changeTableTypeSession)
TabularDataService service,
ChangeTableTypeSession changeTableTypeSession)
throws TDGWTServiceException {
OperationExecution invocation = null;
@ -2463,7 +2459,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeTableType.toString(), capabilities);
map.put(Constants.PARAMETER_TABLE_TYPE, changeTableTypeSession.getTableType().toString());
map.put(Constants.PARAMETER_TABLE_TYPE, changeTableTypeSession
.getTableType().toString());
invocation = new OperationExecution(
operationDefinition.getOperationId(), map);
@ -2471,8 +2468,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
return invocation;
}
/**
*
* {@inheritDoc}
@ -2737,7 +2732,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
/**
*
* {@inheritDoc}
@ -2824,8 +2818,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
Table table = task.getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString());
TRId trId = new TRId();
trId.setId(labelColumnSession.getColumnData()
.getTrId().getId());
trId.setId(labelColumnSession.getColumnData().getTrId()
.getId());
trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
@ -2869,7 +2863,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
/**
*
* {@inheritDoc}
@ -2880,7 +2873,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
throws TDGWTServiceException {
try {
HttpSession session = this.getThreadLocalRequest().getSession();
SessionUtil.setChangeTableTypeSession(session, changeTableTypeSession);
SessionUtil.setChangeTableTypeSession(session,
changeTableTypeSession);
ASLSession aslSession = SessionUtil.getAslSession(session);
AuthorizationProvider.instance.set(new AuthorizationToken(
@ -2908,7 +2902,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}
/**
*
* {@inheritDoc}
@ -3003,10 +2996,4 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
}