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
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
/*public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
||||
throws TDGWTServiceException;*/
|
||||
public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
||||
throws TDGWTServiceException;
|
||||
|
||||
//Clone
|
||||
/**
|
||||
|
|
|
@ -81,7 +81,7 @@ public interface TDGWTServiceAsync {
|
|||
|
||||
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);
|
||||
|
||||
|
|
|
@ -604,7 +604,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
logger.debug("getLastTable: "+trId);
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
@ -613,11 +613,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
.valueOf(trId.getId())));
|
||||
|
||||
TableData tData = new TableData();
|
||||
trId.setTableId(String.valueOf(table.getId().getValue()));
|
||||
tData.setTrId(trId);
|
||||
|
||||
tData.setName(table.getName());
|
||||
tData.setTypeName(table.getTableType().getName());
|
||||
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();
|
||||
|
||||
tData.setMetaData(cMeta.toString());
|
||||
|
@ -630,11 +632,12 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
colData.setTypeName(column.getColumnType().getName());
|
||||
colData.setTypeCode(column.getColumnType().getCode());
|
||||
colData.setDataTypeName(column.getDataType().getName());
|
||||
colData.setTrId(trId);
|
||||
lColumnData.add(colData);
|
||||
}
|
||||
|
||||
tData.setListColumnData(lColumnData);
|
||||
|
||||
logger.debug("getLastTable: "+tData);
|
||||
return tData;
|
||||
|
||||
} catch (Throwable e) {
|
||||
|
@ -763,6 +766,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
protected TabResource retrieveTRMetadataFromService(
|
||||
TabularDataService service, TabularResource tr, int i)
|
||||
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;
|
||||
try {
|
||||
|
@ -801,6 +827,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
return t;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
@ -1165,7 +1192,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
/**
|
||||
*
|
||||
* {@inheritDoc}
|
||||
|
||||
*/
|
||||
@Override
|
||||
public ArrayList<TabResource> getTabularResourcesAndLastTables()
|
||||
throws TDGWTServiceException {
|
||||
|
@ -1187,7 +1214,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
TabularResource tr = trs.get(i);
|
||||
logger.debug("GetTabularResources RetrieveMetadata");
|
||||
try {
|
||||
TabResource t = retrieveTRMetadataFromService(service, tr,
|
||||
TabResource t = retrieveTRMetadataFromServiceAndLastTable(service, tr,
|
||||
i);
|
||||
|
||||
if (t.getTrId() != null) {
|
||||
|
@ -1211,7 +1238,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue