Updated Remove Tabular Resource method
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@86455 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
829a9c2727
commit
c3bd0793a1
|
@ -134,6 +134,14 @@ public interface TDGWTService extends RemoteService {
|
|||
*/
|
||||
public ArrayList<ColumnData> getColumns() throws TDGWTServiceException;
|
||||
|
||||
/**
|
||||
* Remove Tabular Resource From Service
|
||||
*
|
||||
* @param trId
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
public void removeTabularResource(TRId trId) throws TDGWTServiceException;
|
||||
|
||||
// Import SDMX
|
||||
|
||||
/**
|
||||
|
|
|
@ -57,6 +57,8 @@ public interface TDGWTServiceAsync {
|
|||
|
||||
void getColumns(AsyncCallback<ArrayList<ColumnData>> callback);
|
||||
|
||||
void removeTabularResource(TRId trId, AsyncCallback<Void> callback);
|
||||
|
||||
//Open
|
||||
void startTDOpen(TDOpenSession tdOpenSession, AsyncCallback<Void> callback);
|
||||
|
||||
|
|
|
@ -488,21 +488,23 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
* @param tabResource
|
||||
* @throws TDGWTServiceException
|
||||
*/
|
||||
public void removeTabularResource(TabResource tabResource)
|
||||
|
||||
@Override
|
||||
public void removeTabularResource(TRId trId)
|
||||
throws TDGWTServiceException {
|
||||
try {
|
||||
session = this.getThreadLocalRequest().getSession();
|
||||
aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
if (tabResource == null) {
|
||||
logger.error("Error removing TabularResource: tabResource is null");
|
||||
if (trId == null) {
|
||||
logger.error("Error removing TabularResource: trId is null");
|
||||
throw new TDGWTServiceException(
|
||||
"Error removing TabularResource no parameters set");
|
||||
}
|
||||
service = TabularDataServiceFactory.getService(aslSession
|
||||
.getUsername());
|
||||
TabularResourceId id = new TabularResourceId(
|
||||
Long.valueOf(tabResource.getTrId().getId()));
|
||||
Long.valueOf(trId.getId()));
|
||||
service.removeTabularResource(id);
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
|
|
Loading…
Reference in New Issue