Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93517 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c104db3f1e
commit
89a1553c35
|
@ -209,8 +209,8 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
/*public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
||||||
throws TDGWTServiceException;*/
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
//Clone
|
//Clone
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -81,7 +81,7 @@ public interface TDGWTServiceAsync {
|
||||||
|
|
||||||
void getTabularResources(AsyncCallback<ArrayList<TabResource>> callback);
|
void getTabularResources(AsyncCallback<ArrayList<TabResource>> callback);
|
||||||
|
|
||||||
//void getTabularResourcesAndLastTables(AsyncCallback<ArrayList<TabResource>> callback);
|
void getTabularResourcesAndLastTables(AsyncCallback<ArrayList<TabResource>> callback);
|
||||||
|
|
||||||
void getLastTable(TRId trId, AsyncCallback<TableData> callback);
|
void getLastTable(TRId trId, AsyncCallback<TableData> callback);
|
||||||
|
|
||||||
|
|
|
@ -604,7 +604,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
logger.debug("getLastTable: "+trId);
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername()));
|
aslSession.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
@ -613,11 +613,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.valueOf(trId.getId())));
|
.valueOf(trId.getId())));
|
||||||
|
|
||||||
TableData tData = new TableData();
|
TableData tData = new TableData();
|
||||||
trId.setTableId(String.valueOf(table.getId().getValue()));
|
|
||||||
tData.setTrId(trId);
|
|
||||||
tData.setName(table.getName());
|
tData.setName(table.getName());
|
||||||
tData.setTypeName(table.getTableType().getName());
|
tData.setTypeName(table.getTableType().getName());
|
||||||
tData.setTypeCode(table.getTableType().getCode());
|
tData.setTypeCode(table.getTableType().getCode());
|
||||||
|
trId.setTableId(String.valueOf(table.getId().getValue()));
|
||||||
|
trId.setTableType(table.getTableType().getName());
|
||||||
|
tData.setTrId(trId);
|
||||||
Collection<TableMetadata> cMeta = table.getAllMetadata();
|
Collection<TableMetadata> cMeta = table.getAllMetadata();
|
||||||
|
|
||||||
tData.setMetaData(cMeta.toString());
|
tData.setMetaData(cMeta.toString());
|
||||||
|
@ -630,11 +632,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
colData.setTypeName(column.getColumnType().getName());
|
colData.setTypeName(column.getColumnType().getName());
|
||||||
colData.setTypeCode(column.getColumnType().getCode());
|
colData.setTypeCode(column.getColumnType().getCode());
|
||||||
colData.setDataTypeName(column.getDataType().getName());
|
colData.setDataTypeName(column.getDataType().getName());
|
||||||
|
colData.setTrId(trId);
|
||||||
lColumnData.add(colData);
|
lColumnData.add(colData);
|
||||||
}
|
}
|
||||||
|
|
||||||
tData.setListColumnData(lColumnData);
|
tData.setListColumnData(lColumnData);
|
||||||
|
logger.debug("getLastTable: "+tData);
|
||||||
return tData;
|
return tData;
|
||||||
|
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
@ -763,6 +766,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
protected TabResource retrieveTRMetadataFromService(
|
protected TabResource retrieveTRMetadataFromService(
|
||||||
TabularDataService service, TabularResource tr, int i)
|
TabularDataService service, TabularResource tr, int i)
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
|
TRId trId;
|
||||||
|
TabResource t;
|
||||||
|
trId = new TRId(String.valueOf(tr.getId().getValue()));
|
||||||
|
trId.setTabularResourceType(tr.getTableType());
|
||||||
|
t = getTabResourceInformation(trId);
|
||||||
|
t.setId(String.valueOf(i));
|
||||||
|
|
||||||
|
return t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the informations for a specific Tabular Resource and the Last Table from service
|
||||||
|
*
|
||||||
|
* @param tr
|
||||||
|
* TabularResource on service
|
||||||
|
* @param i
|
||||||
|
* Index on Grid
|
||||||
|
* @return TabResource for Grid
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
protected TabResource retrieveTRMetadataFromServiceAndLastTable(
|
||||||
|
TabularDataService service, TabularResource tr, int i)
|
||||||
|
throws TDGWTServiceException {
|
||||||
|
|
||||||
Table table = null;
|
Table table = null;
|
||||||
try {
|
try {
|
||||||
|
@ -800,6 +826,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -1165,7 +1192,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
|
@ -1187,7 +1214,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
TabularResource tr = trs.get(i);
|
TabularResource tr = trs.get(i);
|
||||||
logger.debug("GetTabularResources RetrieveMetadata");
|
logger.debug("GetTabularResources RetrieveMetadata");
|
||||||
try {
|
try {
|
||||||
TabResource t = retrieveTRMetadataFromService(service, tr,
|
TabResource t = retrieveTRMetadataFromServiceAndLastTable(service, tr,
|
||||||
i);
|
i);
|
||||||
|
|
||||||
if (t.getTrId() != null) {
|
if (t.getTrId() != null) {
|
||||||
|
@ -1211,7 +1238,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue