From c3bd0793a141a43769b507fb66d423db684f200a Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 2 Dec 2013 17:46:33 +0000 Subject: [PATCH] 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 --- .../user/td/gwtservice/client/rpc/TDGWTService.java | 8 ++++++++ .../td/gwtservice/client/rpc/TDGWTServiceAsync.java | 2 ++ .../user/td/gwtservice/server/TDGWTServiceImpl.java | 10 ++++++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java index ab0379c..112fd03 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java @@ -134,6 +134,14 @@ public interface TDGWTService extends RemoteService { */ public ArrayList getColumns() throws TDGWTServiceException; + /** + * Remove Tabular Resource From Service + * + * @param trId + * @throws TDGWTServiceException + */ + public void removeTabularResource(TRId trId) throws TDGWTServiceException; + // Import SDMX /** diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java index a2f7bd5..bc56095 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java @@ -57,6 +57,8 @@ public interface TDGWTServiceAsync { void getColumns(AsyncCallback> callback); + void removeTabularResource(TRId trId, AsyncCallback callback); + //Open void startTDOpen(TDOpenSession tdOpenSession, AsyncCallback callback); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index 328ec79..3df0823 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -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) {