Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@95424 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-07 15:56:27 +00:00
parent a1db75ab64
commit f558e79fe3
3 changed files with 63 additions and 38 deletions

View File

@ -149,7 +149,7 @@
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>csv4j</artifactId> <artifactId>csv4j</artifactId>
<version>[1.2.0-SNAPSHOT, 2.0.0-common)</version> <version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- Service Client --> <!-- Service Client -->

View File

@ -3801,24 +3801,28 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
* @return * @return
* @throws TDGWTServiceException * @throws TDGWTServiceException
*/ */
protected OperationExecution retrieveOperationExecution( protected ArrayList<OperationExecution> retrieveOperationExecution(
TabularDataService service, DeleteColumnSession deleteColumnSession) TabularDataService service, DeleteColumnSession deleteColumnSession)
throws TDGWTServiceException { throws TDGWTServiceException {
OperationExecution invocation = null;
List<OperationDefinition> capabilities = service.getCapabilities();
logger.debug(deleteColumnSession.toString()); logger.debug(deleteColumnSession.toString());
List<OperationDefinition> capabilities = service.getCapabilities();
OperationDefinition operationDefinition; OperationDefinition operationDefinition;
Map<String, Object> map = new HashMap<String, Object>();
operationDefinition = OperationDefinitionMap.map( operationDefinition = OperationDefinitionMap.map(
OperationsId.RemoveColumn.toString(), capabilities); OperationsId.RemoveColumn.toString(), capabilities);
Map<String, Object> map = new HashMap<String, Object>();
invocation = new OperationExecution(deleteColumnSession.getColumnData() ArrayList<OperationExecution> invocations = new ArrayList<OperationExecution>();
.getColumnId(), operationDefinition.getOperationId(), map); for (ColumnData col : deleteColumnSession.getColumns()) {
return invocation; OperationExecution invocation = null;
invocation = new OperationExecution(col.getColumnId(),
operationDefinition.getOperationId(), map);
invocations.add(invocation);
}
return invocations;
} }
/** /**
@ -4146,7 +4150,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
aslSession.getUsername())); aslSession.getUsername()));
TabularDataService service = TabularDataServiceFactory.getService(); TabularDataService service = TabularDataServiceFactory.getService();
OperationExecution invocation = retrieveOperationExecution(service, ArrayList<OperationExecution> invocation = retrieveOperationExecution(service,
deleteColumnSession); deleteColumnSession);
if (invocation == null) { if (invocation == null) {
throw new TDGWTServiceException( throw new TDGWTServiceException(
@ -4154,10 +4158,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
} }
TabularResourceId serviceTR = new TabularResourceId( TabularResourceId serviceTR = new TabularResourceId(
Long.valueOf(deleteColumnSession.getColumnData().getTrId() Long.valueOf(deleteColumnSession.getTrId().getId()));
.getId()));
logger.debug("OperationInvocation: \n" + invocation.toString()); logger.debug("OperationInvocation: \n" + invocation.toString());
Task trTask = service.execute(invocation, serviceTR); Task trTask = service.executeBatch(invocation, serviceTR);
logger.debug("Start Task on service: TaskId " + trTask.getId()); logger.debug("Start Task on service: TaskId " + trTask.getId());
SessionUtil.setDeleteColumnTask(session, trTask); SessionUtil.setDeleteColumnTask(session, trTask);
return; return;
@ -4220,8 +4223,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
table = task.getResult().getPrimaryTable(); table = task.getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString()); logger.debug("Table retrived: " + table.toString());
trId = new TRId(); trId = new TRId();
trId.setId(deleteColumnSession.getColumnData() trId.setId(deleteColumnSession.getTrId().getId());
.getTrId().getId());
trId = retrieveTabularResourceBasicData(trId); trId = retrieveTabularResourceBasicData(trId);
deleteColumnMonitor.setTrId(trId); deleteColumnMonitor.setTrId(trId);
@ -4246,8 +4248,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
table = task.getResult().getPrimaryTable(); table = task.getResult().getPrimaryTable();
logger.debug("Table retrived: " + table.toString()); logger.debug("Table retrived: " + table.toString());
trId = new TRId(); trId = new TRId();
trId.setId(deleteColumnSession.getColumnData() trId.setId(deleteColumnSession.getTrId().getId());
.getTrId().getId());
trId = retrieveTabularResourceBasicData(trId); trId = retrieveTabularResourceBasicData(trId);
deleteColumnMonitor.setTrId(trId); deleteColumnMonitor.setTrId(trId);

View File

@ -1,8 +1,10 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.column; package org.gcube.portlets.user.td.gwtservice.shared.tr.column;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
/** /**
* *
@ -14,21 +16,43 @@ public class DeleteColumnSession implements Serializable {
private static final long serialVersionUID = -1896235499708614266L; private static final long serialVersionUID = -1896235499708614266L;
protected ColumnData columnData; protected TRId trId;
protected ArrayList<ColumnData> columns;
public ColumnData getColumnData() { public DeleteColumnSession(){
return columnData;
} }
public void setColumnData(ColumnData columnData) {
this.columnData = columnData; public DeleteColumnSession(TRId trId,ArrayList<ColumnData> columns){
this.trId=trId;
this.columns=columns;
} }
public TRId getTrId() {
return trId;
}
public void setTrId(TRId trId) {
this.trId = trId;
}
public ArrayList<ColumnData> getColumns() {
return columns;
}
public void setColumns(ArrayList<ColumnData> columns) {
this.columns = columns;
}
@Override @Override
public String toString() { public String toString() {
return "DeleteColumnSession [columnData=" + columnData + "]"; return "DeleteColumnSession [trId=" + trId + ", columns=" + columns
+ "]";
} }
} }