Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93399 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-20 17:29:22 +00:00
parent 656b8122a2
commit 2ae6d737fc
1 changed files with 52 additions and 53 deletions

View File

@ -230,9 +230,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
}
logger.debug("GetTabResourceInformation():" + currentTR.toString());
TRId trId = retrieveTabularResourceType(currentTR.getTrId());
currentTR.setTrId(trId);
ArrayList<TRMetadata> trMetadatas = getTRMetadata(currentTR
.getTrId());
updateTabResourceInformation(currentTR, trMetadatas);
@ -265,8 +262,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
// ASLSession aslSession = SessionUtil.getAslSession(session);
logger.debug("GetTabResourceInformation(TRId):" + trId.toString());
TabResource currentTR = new TabResource();
trId = retrieveTabularResourceType(trId);
currentTR.setTrId(trId);
ArrayList<TRMetadata> trMetadatas = getTRMetadata(currentTR
.getTrId());
updateTabResourceInformation(currentTR, trMetadatas);
@ -1397,7 +1393,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
* @return
* @throws TDGWTServiceException
*/
protected TRId retrieveTabularResourceType(TRId trId)
protected TRId retrieveTabularResourceBasicData(TRId trId)
throws TDGWTServiceException {
try {
HttpSession session = this.getThreadLocalRequest().getSession();
@ -1409,7 +1405,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
TabularResourceId tabularResourceId = new TabularResourceId(
new Long(trId.getId()));
TabularResource tr = service.getTabularResource(tabularResourceId);
trId.setTableType(tr.getTableType());
Table table=service.getLastTable(tabularResourceId);
trId.setTabularResourceType(tr.getTableType());
trId.setTableId(String.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
logger.debug("Retrieved TRId type:" + trId.toString());
return trId;
@ -1458,11 +1459,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
case SUCCEDED:
importMonitor.setProgress(task.getProgress());
logger.debug("Task Result: " + task.getResult());
table = task.getResult().getPrimaryTable();
/*table = task.getResult().getPrimaryTable();
trId.setTableId(String.valueOf(table.getId()
.getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
sdmxImportTabResource.setTrId(trId);
SessionUtil.setSDMXImportTabResource(session,
@ -1487,11 +1488,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
case STOPPED:
importMonitor.setProgress(task.getProgress());
logger.debug("Task Result: " + task.getResult());
table = task.getResult().getPrimaryTable();
/*table = task.getResult().getPrimaryTable();
trId.setTableId(String.valueOf(table.getId()
.getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
sdmxImportTabResource.setTrId(trId);
SessionUtil.setSDMXImportTabResource(session,
@ -1874,12 +1875,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
case SUCCEDED:
logger.debug("Task Result: " + task.getResult());
importMonitor.setProgress(task.getProgress());
table = task.getResult().getPrimaryTable();
/*table = task.getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString());
trId.setTableId(String.valueOf(table.getId()
.getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
csvImportTabResource.setTrId(trId);
SessionUtil.setCSVImportTabResource(session,
@ -3123,10 +3124,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(changeColumnTypeSession.getColumnData()
.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
changeColumnTypeMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3148,10 +3149,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(changeColumnTypeSession.getColumnData()
.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
changeColumnTypeMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3271,10 +3272,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(deleteColumnSession.getColumnData()
.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
deleteColumnMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3298,10 +3299,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(deleteColumnSession.getColumnData()
.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
deleteColumnMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3422,10 +3423,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(labelColumnSession.getColumnData().getTrId()
.getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
labelColumnMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3449,10 +3450,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
trId = new TRId();
trId.setId(labelColumnSession.getColumnData().getTrId()
.getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
labelColumnMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3574,10 +3575,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(changeTableTypeSession.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
changeTableTypeMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3600,10 +3601,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(changeTableTypeSession.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
changeTableTypeMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3899,10 +3900,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(deleteRowsSession.getTrId().getId());
trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
retrieveTabularResourceBasicData(trId);
deleteRowsMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -3925,10 +3924,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(deleteRowsSession.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
deleteRowsMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -4092,10 +4091,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(duplicatesSession.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
duplicatesMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);
@ -4118,10 +4117,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
logger.debug("Table retrived: " + table.toString());
trId = new TRId();
trId.setId(duplicatesSession.getTrId().getId());
trId.setTableId(String
/*trId.setTableId(String
.valueOf(table.getId().getValue()));
trId.setTableType(table.getTableType().getName());
retrieveTabularResourceType(trId);
trId.setTableType(table.getTableType().getName());*/
retrieveTabularResourceBasicData(trId);
duplicatesMonitor.setTrId(trId);
tabResource = SessionUtil.getTabResource(session);