From 22872c5ba5c0fa8f65394684c8bd64048c3d8ba6 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 6 Mar 2014 16:00:11 +0000 Subject: [PATCH] Minor Updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@92764 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/server/TDGWTServiceImpl.java | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) 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 253d04c..df37767 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 @@ -3483,6 +3483,42 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } } + + + @Override + public void startDeleteRows(DeleteRowsSession deleteRowsSession) + throws TDGWTServiceException { + try { + HttpSession session = this.getThreadLocalRequest().getSession(); + SessionUtil.setDeleteRowsSession(session, deleteRowsSession); + ASLSession aslSession = SessionUtil.getAslSession(session); + + AuthorizationProvider.instance.set(new AuthorizationToken( + aslSession.getUsername())); + TabularDataService service = TabularDataServiceFactory.getService(); + + OperationExecution invocation = retrieveOperationExecution(service, + deleteRowsSession); + if (invocation == null) { + throw new TDGWTServiceException( + "Error Delete Rows invocation: Operation not supported"); + } + + TabularResourceId serviceTR = new TabularResourceId( + Long.valueOf(deleteRowsSession.getTrId().getId())); + logger.debug("OperationInvocation: \n" + invocation.toString()); + Task trTask = service.execute(invocation, serviceTR); + logger.debug("Start Task on service: TaskId " + trTask.getId()); + SessionUtil.setDeleteRowsTask(session, trTask); + return; + } catch (Exception e) { + e.printStackTrace(); + throw new TDGWTServiceException("Error Deleting Rows: " + + e.getLocalizedMessage()); + } + + } + @Override public DeleteRowsMonitor getDeleteRowsMonitor() throws TDGWTServiceException { @@ -3585,39 +3621,5 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } } - - @Override - public void startDeleteRows(DeleteRowsSession deleteRowsSession) - throws TDGWTServiceException { - try { - HttpSession session = this.getThreadLocalRequest().getSession(); - SessionUtil.setDeleteRowsSession(session, deleteRowsSession); - ASLSession aslSession = SessionUtil.getAslSession(session); - - AuthorizationProvider.instance.set(new AuthorizationToken( - aslSession.getUsername())); - TabularDataService service = TabularDataServiceFactory.getService(); - - OperationExecution invocation = retrieveOperationExecution(service, - deleteRowsSession); - if (invocation == null) { - throw new TDGWTServiceException( - "Error Delete Rows invocation: Operation not supported"); - } - - TabularResourceId serviceTR = new TabularResourceId( - Long.valueOf(deleteRowsSession.getTrId().getId())); - logger.debug("OperationInvocation: \n" + invocation.toString()); - Task trTask = service.execute(invocation, serviceTR); - logger.debug("Start Task on service: TaskId " + trTask.getId()); - SessionUtil.setDeleteRowsTask(session, trTask); - return; - } catch (Exception e) { - e.printStackTrace(); - throw new TDGWTServiceException("Error Deleting Rows: " - + e.getLocalizedMessage()); - } - - } - + }