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
This commit is contained in:
Giancarlo Panichi 2014-03-06 16:00:11 +00:00
parent b86924dc6a
commit 22872c5ba5
1 changed files with 37 additions and 35 deletions

View File

@ -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 @Override
public DeleteRowsMonitor getDeleteRowsMonitor() public DeleteRowsMonitor getDeleteRowsMonitor()
throws TDGWTServiceException { throws TDGWTServiceException {
@ -3586,38 +3622,4 @@ 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());
}
}
} }