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.TimeDimensionColumnType;
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.metadata.column.ViewColumnMetadata;
import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata;
@ -2999,9 +3000,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
OperationDefinition operationDefinition;
Map<String, Object> map = new HashMap<String, Object>();
if(replaceColumnSession.getColumnData().isViewColumn()){
logger.debug("Is a View Column, not supported for now");
if(replaceColumnSession.isReplaceDimension()){
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 {
logger.debug("Is a Replace of basic column");
operationDefinition = OperationDefinitionMap.map(
OperationsId.ReplaceById.toString(),
capabilities);

View File

@ -20,20 +20,32 @@ public class ReplaceColumnSession implements Serializable {
protected TRId trId;
protected ColumnData columnData;
protected String rowId;
public ReplaceColumnSession(){
protected boolean replaceDimension;
public ReplaceColumnSession() {
}
public ReplaceColumnSession(String value,String replaceValue, TRId trId, ColumnData columnData, String rowId){
this.value=value;
this.replaceValue=replaceValue;
this.trId=trId;
this.columnData=columnData;
this.rowId=rowId;
public ReplaceColumnSession(String value, String replaceValue, TRId trId,
ColumnData columnData, String rowId) {
this.value = value;
this.replaceValue = replaceValue;
this.trId = trId;
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() {
return value;
}
@ -74,13 +86,20 @@ public class ReplaceColumnSession implements Serializable {
this.rowId = rowId;
}
public boolean isReplaceDimension() {
return replaceDimension;
}
public void setReplaceDimension(boolean replaceDimension) {
this.replaceDimension = replaceDimension;
}
@Override
public String toString() {
return "ReplaceColumnSession [value=" + value + ", replaceValue="
+ replaceValue + ", trId=" + trId + ", columnData="
+ columnData + ", rowId=" + rowId + "]";
+ columnData + ", rowId=" + rowId + ", replaceDimension="
+ replaceDimension + "]";
}
}