Added replace all value on view column

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93654 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-27 16:56:02 +00:00
parent 3563d75eb7
commit c4284e6506
2 changed files with 57 additions and 17 deletions

View File

@ -53,6 +53,7 @@ import org.gcube.data.analysis.tabulardata.model.column.type.DimensionColumnType
import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType; import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType;
import org.gcube.data.analysis.tabulardata.model.column.type.TimeDimensionColumnType; import org.gcube.data.analysis.tabulardata.model.column.type.TimeDimensionColumnType;
import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType; import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType;
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDInteger;
import org.gcube.data.analysis.tabulardata.model.datatype.value.TDTypeValue; import org.gcube.data.analysis.tabulardata.model.datatype.value.TDTypeValue;
import org.gcube.data.analysis.tabulardata.model.metadata.column.ViewColumnMetadata; import org.gcube.data.analysis.tabulardata.model.metadata.column.ViewColumnMetadata;
import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata; import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata;
@ -2999,9 +3000,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
OperationDefinition operationDefinition; OperationDefinition operationDefinition;
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
if(replaceColumnSession.getColumnData().isViewColumn()){ if(replaceColumnSession.isReplaceDimension()){
logger.debug("Is a View Column, not supported for now"); logger.debug("Is a Replace of view column");
operationDefinition = OperationDefinitionMap.map(
OperationsId.ReplaceById.toString(),
capabilities);
Integer rowId=new Integer(replaceColumnSession.getRowId());
String replaceValue=replaceColumnSession.getReplaceValue();
Integer in = new Integer(replaceValue);
TDTypeValue tdValue = new TDInteger(in);
map.put(Constants.PARAMETER_REPLACE_COLUMN_VALUE, tdValue);
map.put(Constants.PARAMETER_REPLACE_COLUMN_ID, rowId);
invocation = new OperationExecution(replaceColumnSession
.getColumnData().getColumnViewData().getSourceTableDimensionColumnId(),
operationDefinition.getOperationId(), map);
} else { } else {
logger.debug("Is a Replace of basic column");
operationDefinition = OperationDefinitionMap.map( operationDefinition = OperationDefinitionMap.map(
OperationsId.ReplaceById.toString(), OperationsId.ReplaceById.toString(),
capabilities); capabilities);

View File

@ -20,19 +20,31 @@ public class ReplaceColumnSession implements Serializable {
protected TRId trId; protected TRId trId;
protected ColumnData columnData; protected ColumnData columnData;
protected String rowId; protected String rowId;
protected boolean replaceDimension;
public ReplaceColumnSession(){ public ReplaceColumnSession() {
} }
public ReplaceColumnSession(String value,String replaceValue, TRId trId, ColumnData columnData, String rowId){ public ReplaceColumnSession(String value, String replaceValue, TRId trId,
this.value=value; ColumnData columnData, String rowId) {
this.replaceValue=replaceValue; this.value = value;
this.trId=trId; this.replaceValue = replaceValue;
this.columnData=columnData; this.trId = trId;
this.rowId=rowId; this.columnData = columnData;
this.rowId = rowId;
this.replaceDimension = false;
} }
public ReplaceColumnSession(String value, String replaceValue, TRId trId,
ColumnData columnData, String rowId, boolean replaceDimension) {
this.value = value;
this.replaceValue = replaceValue;
this.trId = trId;
this.columnData = columnData;
this.rowId = rowId;
this.replaceDimension = replaceDimension;
}
public String getValue() { public String getValue() {
return value; return value;
@ -74,13 +86,20 @@ public class ReplaceColumnSession implements Serializable {
this.rowId = rowId; this.rowId = rowId;
} }
public boolean isReplaceDimension() {
return replaceDimension;
}
public void setReplaceDimension(boolean replaceDimension) {
this.replaceDimension = replaceDimension;
}
@Override @Override
public String toString() { public String toString() {
return "ReplaceColumnSession [value=" + value + ", replaceValue=" return "ReplaceColumnSession [value=" + value + ", replaceValue="
+ replaceValue + ", trId=" + trId + ", columnData=" + replaceValue + ", trId=" + trId + ", columnData="
+ columnData + ", rowId=" + rowId + "]"; + columnData + ", rowId=" + rowId + ", replaceDimension="
+ replaceDimension + "]";
} }
} }