From cb904672af3907137bc790a10fe0b624e39be323 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Wed, 27 May 2015 09:07:45 +0000 Subject: [PATCH] 81: Allow the creation and use of expressions on multi column in TDM portlet Task-Url: https://support.d4science.org/issues/81 Fixed on ColumnReference the readable expression git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@115018 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/C_ExpressionParser.java | 21 +++-- .../ConditionOnMultiColumnTypeMap.java | 73 ++++------------ .../shared/condition/ConditionTypeMap.java | 2 +- .../shared/model/leaf/C_ColumnReference.java | 61 ++++--------- .../leaf/C_ColumnReferencePlaceholder.java | 6 ++ .../shared/model/leaf/C_ConstantList.java | 6 ++ .../shared/model/leaf/C_Leaf.java | 6 ++ .../shared/model/leaf/TD_Value.java | 6 ++ .../shared/replace/ReplaceTypeMap.java | 85 ++++++++----------- .../rule/RuleDescriptionDataProperties.java | 33 ++++--- .../RuleDescriptionDataPropertiesCombo.java | 14 +-- 11 files changed, 130 insertions(+), 183 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java index fd42c60..c571e9d 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/server/C_ExpressionParser.java @@ -127,10 +127,12 @@ import org.gcube.portlets.user.td.expressionwidget.shared.model.logical.C_Or; import org.gcube.portlets.user.td.expressionwidget.shared.model.logical.C_ValueIsIn; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + public class C_ExpressionParser { private static Logger logger = LoggerFactory .getLogger(C_ExpressionParser.class); @@ -696,8 +698,13 @@ public class C_ExpressionParser { TRId trId = new TRId(); trId.setTableId(tableId); trId.setViewTable(false); - C_ColumnReference ref = new C_ColumnReference(trId, columnDataType, - columnId); + ColumnData column=new ColumnData(); + column.setId(columnId); + column.setColumnId(columnId); + column.setTrId(trId); + column.setDataTypeName(columnDataType.toString()); + column.setLabel("Unknow"); + C_ColumnReference ref = new C_ColumnReference(column); return ref; } @@ -1383,16 +1390,16 @@ public class C_ExpressionParser { private Expression getColumnReference(C_Expression exp) { C_ColumnReference c = (C_ColumnReference) exp; String tableIdS = null; - if (c.getTrId().isViewTable()) { - tableIdS = c.getTrId().getReferenceTargetTableId(); + if (c.getColumn().getTrId().isViewTable()) { + tableIdS = c.getColumn().getTrId().getReferenceTargetTableId(); } else { - tableIdS = c.getTrId().getTableId(); + tableIdS = c.getColumn().getTrId().getTableId(); } TableId tableId = new TableId(Long.valueOf(tableIdS)); - ColumnLocalId columnId = new ColumnLocalId(c.getColumnId()); + ColumnLocalId columnId = new ColumnLocalId(c.getColumn().getColumnId()); ColumnReference ref = new ColumnReference(tableId, columnId, - mapColumnDataType(c.getDataType())); + mapColumnDataType(ColumnDataType.getColumnDataTypeFromId(c.getColumn().getDataTypeName()))); return ref; } diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionOnMultiColumnTypeMap.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionOnMultiColumnTypeMap.java index 1334de4..41542a2 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionOnMultiColumnTypeMap.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionOnMultiColumnTypeMap.java @@ -754,7 +754,7 @@ public class ConditionOnMultiColumnTypeMap { .getDataTypeName()); Log.debug("Data Type:" + dataType); C_ColumnReference columnReference = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); + column); Log.debug("Typed Column Reference:" + columnReference); switch (operatorType) { @@ -962,11 +962,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_NotLess(columnReference, firstArgColumnReference); break; case VALUE: @@ -991,11 +988,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_NotGreater(columnReference, firstArgColumnReference); break; case VALUE: @@ -1020,11 +1014,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_NotEquals(columnReference, firstArgColumnReference); break; case VALUE: @@ -1049,11 +1040,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_TextMatchSQLRegexp(columnReference, firstArgColumnReference); break; @@ -1079,11 +1067,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_LessOrEquals(columnReference, firstArgColumnReference); break; case VALUE: @@ -1108,11 +1093,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_LessThan(columnReference, firstArgColumnReference); break; case VALUE: @@ -1197,11 +1179,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_GreaterOrEquals(columnReference, firstArgColumnReference); break; @@ -1227,11 +1206,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_GreaterThan(columnReference, firstArgColumnReference); break; case VALUE: @@ -1256,11 +1232,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_Equals(columnReference, firstArgColumnReference); break; case VALUE: @@ -1285,11 +1258,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_TextEndsWith(columnReference, firstArgColumnReference); break; case VALUE: @@ -1314,11 +1284,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_TextContains(columnReference, firstArgColumnReference); break; case VALUE: @@ -1346,11 +1313,7 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); - fArg = new C_ColumnReference(firstArgColumn.getTrId(), - firstArgDataType, firstArgColumn.getColumnId()); - + fArg = new C_ColumnReference(firstArgColumn); break; case VALUE: if(firstArg==null|| firstArg.isEmpty()){ @@ -1367,10 +1330,7 @@ public class ConditionOnMultiColumnTypeMap { switch (secondArgType) { case COLUMN: - ColumnDataType secondArgDataType = ColumnDataType - .getColumnDataTypeFromId(secondArgColumn.getDataTypeName()); - sArg = new C_ColumnReference(secondArgColumn.getTrId(), - secondArgDataType, secondArgColumn.getColumnId()); + sArg = new C_ColumnReference(secondArgColumn); break; case VALUE: if(secondArg==null|| secondArg.isEmpty()){ @@ -1397,11 +1357,8 @@ public class ConditionOnMultiColumnTypeMap { switch (firstArgType) { case COLUMN: - ColumnDataType firstArgDataType = ColumnDataType - .getColumnDataTypeFromId(firstArgColumn.getDataTypeName()); C_ColumnReference firstArgColumnReference = new C_ColumnReference( - firstArgColumn.getTrId(), firstArgDataType, - firstArgColumn.getColumnId()); + firstArgColumn); exp = new C_TextBeginsWith(columnReference, firstArgColumnReference); break; case VALUE: diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionTypeMap.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionTypeMap.java index 08f86e2..650240f 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionTypeMap.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/condition/ConditionTypeMap.java @@ -330,7 +330,7 @@ public class ConditionTypeMap { .getDataTypeName()); Log.debug("Data Type:" + dataType); C_ColumnReference columnReference = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); + column); Log.debug("Typed Column Reference:" + columnReference); TD_Value fArg; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReference.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReference.java index 32862ef..aea81c6 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReference.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReference.java @@ -1,37 +1,29 @@ package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf; -import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; -import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; +import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class C_ColumnReference extends C_Leaf { private static final long serialVersionUID = 1007646449141930835L; protected String id = "ColumnReference"; - protected TRId trId; - protected String columnId; - protected ColumnDataType dataType; + protected ColumnData column; public C_ColumnReference() { } - public C_ColumnReference(TRId trId, ColumnDataType dataType, String columnId) { - this.trId = trId; - this.dataType = dataType; - this.columnId = columnId; - - String tableId = ""; - if (trId != null) { - if (trId.isViewTable()) { - tableId = trId.getReferenceTargetTableId(); - } else { - tableId = trId.getTableId(); - } - } - if (tableId != null && columnId != null && dataType != null) { - this.readableExpression = "ColumnReference(" + tableId + "," - + dataType.getLabel() + "," + columnId + ")"; + public C_ColumnReference(ColumnData column) { + this.column = column; + if (column != null) { + this.readableExpression = "ColumnReference(" + column.getLabel() + + ")"; } } @@ -41,34 +33,17 @@ public class C_ColumnReference extends C_Leaf { return id; } - public TRId getTrId() { - return trId; + public ColumnData getColumn() { + return column; } - public void setTrId(TRId trId) { - this.trId = trId; - } - - public String getColumnId() { - return columnId; - } - - public void setColumnId(String columnId) { - this.columnId = columnId; - } - - public ColumnDataType getDataType() { - return dataType; - } - - public void setDataType(ColumnDataType dataType) { - this.dataType = dataType; + public void setColumn(ColumnData column) { + this.column = column; } @Override public String toString() { - return "TypedColumnReference [id=" + id + ", trId=" + trId - + ", columnId=" + columnId + ", dataType=" + dataType + "]"; + return "C_ColumnReference [id=" + id + ", column=" + column + "]"; } } diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReferencePlaceholder.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReferencePlaceholder.java index 8d54b4f..9ad3d9d 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReferencePlaceholder.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ColumnReferencePlaceholder.java @@ -2,6 +2,12 @@ package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class C_ColumnReferencePlaceholder extends C_Leaf { private static final long serialVersionUID = 275747262118236529L; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ConstantList.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ConstantList.java index da8b20b..8264bf9 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ConstantList.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_ConstantList.java @@ -4,6 +4,12 @@ import java.util.List; import org.gcube.portlets.user.td.expressionwidget.shared.expression.C_MultivaluedExpression; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression { private static final long serialVersionUID = 222662008523199480L; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_Leaf.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_Leaf.java index c416b6a..c90be12 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_Leaf.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/C_Leaf.java @@ -2,6 +2,12 @@ package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf; import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class C_Leaf extends C_Expression { diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java index 20ccce1..af1c806 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/model/leaf/TD_Value.java @@ -2,6 +2,12 @@ package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf; import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType; +/** + * + * @author giancarlo + * email: g.panichi@isti.cnr.it + * + */ public class TD_Value extends C_Leaf { private static final long serialVersionUID = 2802022467528178596L; diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceTypeMap.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceTypeMap.java index 9b8bf0f..3e5362f 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceTypeMap.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/replace/ReplaceTypeMap.java @@ -536,14 +536,12 @@ public class ReplaceTypeMap { C_Expression exp; TD_Value fArg; TD_Value sArg; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); C_Expression columnReference; if(dataType!=ColumnDataType.Text){ @@ -569,16 +567,13 @@ public class ReplaceTypeMap { C_Expression exp; TD_Value fArg; C_Expression posFrom; - C_Expression posTo; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + C_Expression posTo; + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); - C_Expression columnReference; if(dataType!=ColumnDataType.Text){ columnReference=new C_Cast(columnRef,ColumnDataType.Text); @@ -605,16 +600,15 @@ public class ReplaceTypeMap { C_Expression exp; TD_Value fArg; TD_Value sArg; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + + C_Expression columnReference; ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); - - C_Expression columnReference; if(dataType!=ColumnDataType.Text){ columnReference=new C_Cast(columnRef,ColumnDataType.Text); } else { @@ -637,15 +631,12 @@ public class ReplaceTypeMap { throws ReplaceTypeMapException { C_Expression exp; TD_Value fArg; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); - C_Expression columnReference; if(dataType!=ColumnDataType.Text){ columnReference=new C_Cast(columnRef,ColumnDataType.Text); @@ -666,15 +657,13 @@ public class ReplaceTypeMap { private C_Expression columnValueReference(ColumnData column, ColumnDataType targetType) { C_Expression exp; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); - C_Expression columnReference; if(dataType!=targetType){ columnReference=new C_Cast(columnRef,targetType); @@ -691,14 +680,13 @@ public class ReplaceTypeMap { private C_Expression upperReference(ColumnData column, ColumnDataType targetType) { C_Expression exp; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); C_Expression columnReference; if(dataType!=ColumnDataType.Text){ @@ -718,14 +706,13 @@ public class ReplaceTypeMap { private C_Expression lowerReference(ColumnData column, ColumnDataType targetType) { C_Expression exp; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); C_Expression columnReference; if(dataType!=ColumnDataType.Text){ @@ -746,14 +733,13 @@ public class ReplaceTypeMap { private C_Expression trimReference(ColumnData column, ColumnDataType targetType) { C_Expression exp; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); C_Expression columnReference; if(dataType!=ColumnDataType.Text){ @@ -773,14 +759,13 @@ public class ReplaceTypeMap { private C_Expression md5Reference(ColumnData column, ColumnDataType targetType) { C_Expression exp; - Log.debug("Column Data Type Name:" + column.getDataTypeName()); + + C_ColumnReference columnRef = new C_ColumnReference( + column); + ColumnDataType dataType = ColumnDataType .getColumnDataTypeFromId(column .getDataTypeName()); - Log.debug("Data Type:" + dataType); - - C_ColumnReference columnRef = new C_ColumnReference( - column.getTrId(), dataType, column.getColumnId()); C_Expression columnReference; if(dataType!=ColumnDataType.Text){ diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java index 5849c97..c4bed34 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataProperties.java @@ -1,9 +1,5 @@ package org.gcube.portlets.user.td.expressionwidget.shared.rule; - - - - import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData; import com.google.gwt.editor.client.Editor.Path; @@ -13,21 +9,24 @@ import com.sencha.gxt.data.shared.PropertyAccess; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ -public interface RuleDescriptionDataProperties extends PropertyAccess { - +public interface RuleDescriptionDataProperties extends + PropertyAccess { + @Path("id") ModelKeyProvider id(); - - ValueProvider name(); - ValueProvider scopeLabel(); - ValueProvider description(); - ValueProvider ownerLogin(); - ValueProvider readableExpression(); - - -} + ValueProvider name(); + + ValueProvider scopeLabel(); + + ValueProvider description(); + + ValueProvider ownerLogin(); + + ValueProvider readableExpression(); + +} diff --git a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataPropertiesCombo.java b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataPropertiesCombo.java index e00167a..6e19636 100644 --- a/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataPropertiesCombo.java +++ b/src/main/java/org/gcube/portlets/user/td/expressionwidget/shared/rule/RuleDescriptionDataPropertiesCombo.java @@ -10,18 +10,18 @@ import com.sencha.gxt.data.shared.PropertyAccess; /** * - * @author giancarlo - * email: g.panichi@isti.cnr.it + * @author giancarlo email: g.panichi@isti.cnr.it * */ -public interface RuleDescriptionDataPropertiesCombo extends PropertyAccess { - +public interface RuleDescriptionDataPropertiesCombo extends + PropertyAccess { + @Path("id") ModelKeyProvider id(); - + LabelProvider name(); - + @Path("name") ValueProvider nameProv(); } -