Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99169 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
add56134c8
commit
ddaf700787
|
@ -7587,18 +7587,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
OpExecutionDirector director = new OpExecutionDirector();
|
||||
director.setOperationExecutionBuilder(opEx);
|
||||
director.constructOperationExecution();
|
||||
OperationExecution invocation = director.getOperationExecution();
|
||||
ArrayList<OperationExecution> invocations = director
|
||||
.getListOperationExecution();
|
||||
|
||||
if (invocation == null) {
|
||||
if (invocations == null) {
|
||||
throw new TDGWTServiceException(
|
||||
"Error in invocation: Operation not supported");
|
||||
}
|
||||
Long id = Long.valueOf(mergeColumnSession.getColumnData().getTrId()
|
||||
|
||||
Long id = Long.valueOf(mergeColumnSession.getColumnDataSource1().getTrId()
|
||||
.getId());
|
||||
|
||||
TabularResourceId serviceTR = new TabularResourceId(id);
|
||||
logger.debug("OperationInvocation: \n" + invocation.toString());
|
||||
Task trTask = service.execute(invocation, serviceTR);
|
||||
logger.debug("OperationInvocation: \n" + invocations.toString());
|
||||
Task trTask = service.executeBatch(invocations, serviceTR);
|
||||
logger.debug("Merge Column on service: TaskId " + trTask.getId());
|
||||
SessionUtil.setMergeColumnTask(session, trTask);
|
||||
return;
|
||||
|
@ -7665,7 +7667,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.debug("Task Result:" + task.getResult());
|
||||
mergeColumnMonitor.setProgress(task.getProgress());
|
||||
trId = new TRId();
|
||||
trId.setId(mergeColumnSession.getColumnData().getTrId()
|
||||
trId.setId(mergeColumnSession.getColumnDataSource1().getTrId()
|
||||
.getId());
|
||||
trId = retrieveTabularResourceBasicData(trId);
|
||||
mergeColumnMonitor.setTrId(trId);
|
||||
|
@ -7688,7 +7690,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
logger.debug("Task Result:" + task.getResult());
|
||||
mergeColumnMonitor.setProgress(task.getProgress());
|
||||
trId = retrieveTabularResourceBasicData(mergeColumnSession
|
||||
.getColumnData().getTrId());
|
||||
.getColumnDataSource1().getTrId());
|
||||
|
||||
mergeColumnMonitor.setTrId(trId);
|
||||
tabResource = SessionUtil.getTabResource(session);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.server.opexecution;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -40,8 +41,7 @@ public class OpExecution4MergeColumn extends OpExecutionBuilder {
|
|||
|
||||
@Override
|
||||
public void buildOpEx() throws TDGWTServiceException {
|
||||
|
||||
OperationExecution invocation = null;
|
||||
ArrayList<OperationExecution> invocations = new ArrayList<OperationExecution>();
|
||||
|
||||
logger.debug(mergeColumnSession.toString());
|
||||
|
||||
|
@ -63,10 +63,27 @@ public class OpExecution4MergeColumn extends OpExecutionBuilder {
|
|||
map.put(Constants.PARAMETER_ADD_COLUMN_LABEL,
|
||||
new ImmutableLocalizedText(mergeColumnSession.getLabel()));
|
||||
map.put(Constants.PARAMETER_ADD_COLUMN_VALUE, expression);
|
||||
invocation = new OperationExecution(
|
||||
operationDefinition.getOperationId(), map);
|
||||
invocations.add(new OperationExecution(operationDefinition
|
||||
.getOperationId(), map));
|
||||
|
||||
if (mergeColumnSession.isDeleteColumn()) {
|
||||
OperationDefinition operationDefinitionRemoveColumn = OperationDefinitionMap
|
||||
.map(OperationsId.RemoveColumn.toString(), service);
|
||||
Map<String, Object> mapRemoveColumn = new HashMap<String, Object>();
|
||||
|
||||
operationExecutionSpec.setOp(invocation);
|
||||
invocations.add(new OperationExecution(mergeColumnSession
|
||||
.getColumnDataSource1().getColumnId(),
|
||||
operationDefinitionRemoveColumn.getOperationId(),
|
||||
mapRemoveColumn));
|
||||
|
||||
invocations.add(new OperationExecution(mergeColumnSession
|
||||
.getColumnDataSource2().getColumnId(),
|
||||
operationDefinitionRemoveColumn.getOperationId(),
|
||||
mapRemoveColumn));
|
||||
|
||||
}
|
||||
|
||||
operationExecutionSpec.setOps(invocations);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -78,7 +78,21 @@ public class OpExecution4SplitColumn extends OpExecutionBuilder {
|
|||
invocations.add(new OperationExecution(operationDefinition
|
||||
.getOperationId(), map2));
|
||||
|
||||
|
||||
if (splitColumnSession.isDeleteColumn()) {
|
||||
OperationDefinition operationDefinitionRemoveColumn = OperationDefinitionMap
|
||||
.map(OperationsId.RemoveColumn.toString(), service);
|
||||
Map<String, Object> mapRemoveColumn = new HashMap<String, Object>();
|
||||
|
||||
OperationExecution invocationRemoveColumn = null;
|
||||
|
||||
invocationRemoveColumn = new OperationExecution(splitColumnSession
|
||||
.getColumnData().getColumnId(),
|
||||
operationDefinitionRemoveColumn.getOperationId(),
|
||||
mapRemoveColumn);
|
||||
invocations.add(invocationRemoveColumn);
|
||||
|
||||
}
|
||||
|
||||
operationExecutionSpec.setOps(invocations);
|
||||
|
||||
}
|
||||
|
|
|
@ -17,11 +17,13 @@ public class MergeColumnSession implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = -1896235499708614266L;
|
||||
|
||||
protected ColumnData columnData;
|
||||
protected ColumnData columnDataSource1;
|
||||
protected ColumnData columnDataSource2;
|
||||
protected String label;
|
||||
protected Expression expression;
|
||||
protected ColumnTypeCode mergeColumnType;
|
||||
protected ColumnDataType mergeColumnDataType;
|
||||
protected boolean deleteColumn;
|
||||
|
||||
public MergeColumnSession() {
|
||||
|
||||
|
@ -35,25 +37,36 @@ public class MergeColumnSession implements Serializable {
|
|||
* @param mergeColumnDataType
|
||||
* @param expression
|
||||
*/
|
||||
public MergeColumnSession(ColumnData columnData,
|
||||
public MergeColumnSession(ColumnData columnDataSource1,
|
||||
ColumnData columnDataSource2,
|
||||
String label,
|
||||
ColumnTypeCode mergeColumnType,
|
||||
ColumnDataType mergeColumnDataType,
|
||||
Expression expression) {
|
||||
this.columnData = columnData;
|
||||
Expression expression, boolean deleteColumn) {
|
||||
this.columnDataSource1 = columnDataSource1;
|
||||
this.columnDataSource2 = columnDataSource2;
|
||||
this.label = label;
|
||||
this.expression = expression;
|
||||
this.mergeColumnType=mergeColumnType;
|
||||
this.mergeColumnDataType=mergeColumnDataType;
|
||||
|
||||
this.deleteColumn=deleteColumn;
|
||||
}
|
||||
|
||||
public ColumnData getColumnData() {
|
||||
return columnData;
|
||||
|
||||
public ColumnData getColumnDataSource1() {
|
||||
return columnDataSource1;
|
||||
}
|
||||
|
||||
public void setColumnData(ColumnData columnData) {
|
||||
this.columnData = columnData;
|
||||
public void setColumnDataSource1(ColumnData columnDataSource1) {
|
||||
this.columnDataSource1 = columnDataSource1;
|
||||
}
|
||||
|
||||
public ColumnData getColumnDataSource2() {
|
||||
return columnDataSource2;
|
||||
}
|
||||
|
||||
public void setColumnDataSource2(ColumnData columnDataSource2) {
|
||||
this.columnDataSource2 = columnDataSource2;
|
||||
}
|
||||
|
||||
public Expression getExpression() {
|
||||
|
@ -87,17 +100,23 @@ public class MergeColumnSession implements Serializable {
|
|||
public void setMergeColumnDataType(ColumnDataType mergeColumnDataType) {
|
||||
this.mergeColumnDataType = mergeColumnDataType;
|
||||
}
|
||||
|
||||
public boolean isDeleteColumn() {
|
||||
return deleteColumn;
|
||||
}
|
||||
|
||||
public void setDeleteColumn(boolean deleteColumn) {
|
||||
this.deleteColumn = deleteColumn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MergeColumnSession [columnData=" + columnData + ", label="
|
||||
return "MergeColumnSession [columnDataSource1=" + columnDataSource1
|
||||
+ ", columnDataSource2=" + columnDataSource2 + ", label="
|
||||
+ label + ", expression=" + expression + ", mergeColumnType="
|
||||
+ mergeColumnType + ", mergeColumnDataType="
|
||||
+ mergeColumnDataType + "]";
|
||||
+ mergeColumnDataType + ", deleteColumn=" + deleteColumn + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ public class SplitColumnSession implements Serializable {
|
|||
protected String label2;
|
||||
protected ColumnTypeCode secondSplitColumnType;
|
||||
protected ColumnDataType secondSplitColumnDataType;
|
||||
protected boolean deleteColumn;
|
||||
|
||||
public SplitColumnSession() {
|
||||
|
||||
|
@ -42,14 +43,12 @@ public class SplitColumnSession implements Serializable {
|
|||
* @param secondSplitColumnType
|
||||
* @param secondSplitColumnDataType
|
||||
*/
|
||||
public SplitColumnSession(ColumnData columnData,
|
||||
ArrayList<Expression> expressions,
|
||||
String label1,
|
||||
public SplitColumnSession(ColumnData columnData,
|
||||
ArrayList<Expression> expressions, String label1,
|
||||
ColumnTypeCode firstSplitColumnType,
|
||||
ColumnDataType firstSplitColumnDataType,
|
||||
String label2,
|
||||
ColumnDataType firstSplitColumnDataType, String label2,
|
||||
ColumnTypeCode secondSplitColumnType,
|
||||
ColumnDataType secondSplitColumnDataType) {
|
||||
ColumnDataType secondSplitColumnDataType, boolean deleteColumn) {
|
||||
this.columnData = columnData;
|
||||
this.expressions = expressions;
|
||||
this.label1 = label1;
|
||||
|
@ -58,6 +57,7 @@ public class SplitColumnSession implements Serializable {
|
|||
this.label2 = label2;
|
||||
this.secondSplitColumnType = secondSplitColumnType;
|
||||
this.secondSplitColumnDataType = secondSplitColumnDataType;
|
||||
this.deleteColumn = deleteColumn;
|
||||
|
||||
}
|
||||
|
||||
|
@ -113,7 +113,8 @@ public class SplitColumnSession implements Serializable {
|
|||
return firstSplitColumnDataType;
|
||||
}
|
||||
|
||||
public void setFirstSplitColumnDataType(ColumnDataType firstSplitColumnDataType) {
|
||||
public void setFirstSplitColumnDataType(
|
||||
ColumnDataType firstSplitColumnDataType) {
|
||||
this.firstSplitColumnDataType = firstSplitColumnDataType;
|
||||
}
|
||||
|
||||
|
@ -126,17 +127,24 @@ public class SplitColumnSession implements Serializable {
|
|||
this.secondSplitColumnDataType = secondSplitColumnDataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SplitColumnSession [columnData=" + columnData + ", label1="
|
||||
+ label1 + ", label2=" + label2 + ", expressions="
|
||||
+ expressions + ", firstSplitColumnType="
|
||||
+ firstSplitColumnType + ", firstSplitColumnDataType="
|
||||
+ firstSplitColumnDataType + ", secondSplitColumnType="
|
||||
+ secondSplitColumnType + ", secondSplitColumnDataType="
|
||||
+ secondSplitColumnDataType + "]";
|
||||
public boolean isDeleteColumn() {
|
||||
return deleteColumn;
|
||||
}
|
||||
|
||||
|
||||
public void setDeleteColumn(boolean deleteColumn) {
|
||||
this.deleteColumn = deleteColumn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SplitColumnSession [columnData=" + columnData
|
||||
+ ", expressions=" + expressions + ", label1=" + label1
|
||||
+ ", firstSplitColumnType=" + firstSplitColumnType
|
||||
+ ", firstSplitColumnDataType=" + firstSplitColumnDataType
|
||||
+ ", label2=" + label2 + ", secondSplitColumnType="
|
||||
+ secondSplitColumnType + ", secondSplitColumnDataType="
|
||||
+ secondSplitColumnDataType + ", deleteColumn=" + deleteColumn
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue