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
This commit is contained in:
parent
dd77534fca
commit
cb904672af
|
@ -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.expressionwidget.shared.model.logical.C_ValueIsIn;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
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.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.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
|
||||||
public class C_ExpressionParser {
|
public class C_ExpressionParser {
|
||||||
private static Logger logger = LoggerFactory
|
private static Logger logger = LoggerFactory
|
||||||
.getLogger(C_ExpressionParser.class);
|
.getLogger(C_ExpressionParser.class);
|
||||||
|
@ -696,8 +698,13 @@ public class C_ExpressionParser {
|
||||||
TRId trId = new TRId();
|
TRId trId = new TRId();
|
||||||
trId.setTableId(tableId);
|
trId.setTableId(tableId);
|
||||||
trId.setViewTable(false);
|
trId.setViewTable(false);
|
||||||
C_ColumnReference ref = new C_ColumnReference(trId, columnDataType,
|
ColumnData column=new ColumnData();
|
||||||
columnId);
|
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;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1383,16 +1390,16 @@ public class C_ExpressionParser {
|
||||||
private Expression getColumnReference(C_Expression exp) {
|
private Expression getColumnReference(C_Expression exp) {
|
||||||
C_ColumnReference c = (C_ColumnReference) exp;
|
C_ColumnReference c = (C_ColumnReference) exp;
|
||||||
String tableIdS = null;
|
String tableIdS = null;
|
||||||
if (c.getTrId().isViewTable()) {
|
if (c.getColumn().getTrId().isViewTable()) {
|
||||||
tableIdS = c.getTrId().getReferenceTargetTableId();
|
tableIdS = c.getColumn().getTrId().getReferenceTargetTableId();
|
||||||
} else {
|
} else {
|
||||||
tableIdS = c.getTrId().getTableId();
|
tableIdS = c.getColumn().getTrId().getTableId();
|
||||||
}
|
}
|
||||||
TableId tableId = new TableId(Long.valueOf(tableIdS));
|
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,
|
ColumnReference ref = new ColumnReference(tableId, columnId,
|
||||||
mapColumnDataType(c.getDataType()));
|
mapColumnDataType(ColumnDataType.getColumnDataTypeFromId(c.getColumn().getDataTypeName())));
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -754,7 +754,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReference columnReference = new C_ColumnReference(
|
C_ColumnReference columnReference = new C_ColumnReference(
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column);
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
|
||||||
switch (operatorType) {
|
switch (operatorType) {
|
||||||
|
@ -962,11 +962,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_NotLess(columnReference, firstArgColumnReference);
|
exp = new C_NotLess(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -991,11 +988,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_NotGreater(columnReference, firstArgColumnReference);
|
exp = new C_NotGreater(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1020,11 +1014,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_NotEquals(columnReference, firstArgColumnReference);
|
exp = new C_NotEquals(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1049,11 +1040,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_TextMatchSQLRegexp(columnReference,
|
exp = new C_TextMatchSQLRegexp(columnReference,
|
||||||
firstArgColumnReference);
|
firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
|
@ -1079,11 +1067,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_LessOrEquals(columnReference, firstArgColumnReference);
|
exp = new C_LessOrEquals(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1108,11 +1093,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_LessThan(columnReference, firstArgColumnReference);
|
exp = new C_LessThan(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1197,11 +1179,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_GreaterOrEquals(columnReference,
|
exp = new C_GreaterOrEquals(columnReference,
|
||||||
firstArgColumnReference);
|
firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
|
@ -1227,11 +1206,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_GreaterThan(columnReference, firstArgColumnReference);
|
exp = new C_GreaterThan(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1256,11 +1232,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_Equals(columnReference, firstArgColumnReference);
|
exp = new C_Equals(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1285,11 +1258,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_TextEndsWith(columnReference, firstArgColumnReference);
|
exp = new C_TextEndsWith(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1314,11 +1284,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_TextContains(columnReference, firstArgColumnReference);
|
exp = new C_TextContains(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
@ -1346,11 +1313,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
fArg = new C_ColumnReference(firstArgColumn);
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
fArg = new C_ColumnReference(firstArgColumn.getTrId(),
|
|
||||||
firstArgDataType, firstArgColumn.getColumnId());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
if(firstArg==null|| firstArg.isEmpty()){
|
if(firstArg==null|| firstArg.isEmpty()){
|
||||||
|
@ -1367,10 +1330,7 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (secondArgType) {
|
switch (secondArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType secondArgDataType = ColumnDataType
|
sArg = new C_ColumnReference(secondArgColumn);
|
||||||
.getColumnDataTypeFromId(secondArgColumn.getDataTypeName());
|
|
||||||
sArg = new C_ColumnReference(secondArgColumn.getTrId(),
|
|
||||||
secondArgDataType, secondArgColumn.getColumnId());
|
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
if(secondArg==null|| secondArg.isEmpty()){
|
if(secondArg==null|| secondArg.isEmpty()){
|
||||||
|
@ -1397,11 +1357,8 @@ public class ConditionOnMultiColumnTypeMap {
|
||||||
|
|
||||||
switch (firstArgType) {
|
switch (firstArgType) {
|
||||||
case COLUMN:
|
case COLUMN:
|
||||||
ColumnDataType firstArgDataType = ColumnDataType
|
|
||||||
.getColumnDataTypeFromId(firstArgColumn.getDataTypeName());
|
|
||||||
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
C_ColumnReference firstArgColumnReference = new C_ColumnReference(
|
||||||
firstArgColumn.getTrId(), firstArgDataType,
|
firstArgColumn);
|
||||||
firstArgColumn.getColumnId());
|
|
||||||
exp = new C_TextBeginsWith(columnReference, firstArgColumnReference);
|
exp = new C_TextBeginsWith(columnReference, firstArgColumnReference);
|
||||||
break;
|
break;
|
||||||
case VALUE:
|
case VALUE:
|
||||||
|
|
|
@ -330,7 +330,7 @@ public class ConditionTypeMap {
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
Log.debug("Data Type:" + dataType);
|
||||||
C_ColumnReference columnReference = new C_ColumnReference(
|
C_ColumnReference columnReference = new C_ColumnReference(
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
column);
|
||||||
Log.debug("Typed Column Reference:" + columnReference);
|
Log.debug("Typed Column Reference:" + columnReference);
|
||||||
|
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
|
|
|
@ -1,37 +1,29 @@
|
||||||
package org.gcube.portlets.user.td.expressionwidget.shared.model.leaf;
|
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.ColumnData;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class C_ColumnReference extends C_Leaf {
|
public class C_ColumnReference extends C_Leaf {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1007646449141930835L;
|
private static final long serialVersionUID = 1007646449141930835L;
|
||||||
|
|
||||||
protected String id = "ColumnReference";
|
protected String id = "ColumnReference";
|
||||||
protected TRId trId;
|
protected ColumnData column;
|
||||||
protected String columnId;
|
|
||||||
protected ColumnDataType dataType;
|
|
||||||
|
|
||||||
public C_ColumnReference() {
|
public C_ColumnReference() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public C_ColumnReference(TRId trId, ColumnDataType dataType, String columnId) {
|
public C_ColumnReference(ColumnData column) {
|
||||||
this.trId = trId;
|
this.column = column;
|
||||||
this.dataType = dataType;
|
if (column != null) {
|
||||||
this.columnId = columnId;
|
this.readableExpression = "ColumnReference(" + column.getLabel()
|
||||||
|
+ ")";
|
||||||
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 + ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -41,34 +33,17 @@ public class C_ColumnReference extends C_Leaf {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TRId getTrId() {
|
public ColumnData getColumn() {
|
||||||
return trId;
|
return column;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setTrId(TRId trId) {
|
public void setColumn(ColumnData column) {
|
||||||
this.trId = trId;
|
this.column = column;
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TypedColumnReference [id=" + id + ", trId=" + trId
|
return "C_ColumnReference [id=" + id + ", column=" + column + "]";
|
||||||
+ ", columnId=" + columnId + ", dataType=" + dataType + "]";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class C_ColumnReferencePlaceholder extends C_Leaf {
|
public class C_ColumnReferencePlaceholder extends C_Leaf {
|
||||||
|
|
||||||
private static final long serialVersionUID = 275747262118236529L;
|
private static final long serialVersionUID = 275747262118236529L;
|
||||||
|
|
|
@ -4,6 +4,12 @@ import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.expressionwidget.shared.expression.C_MultivaluedExpression;
|
import org.gcube.portlets.user.td.expressionwidget.shared.expression.C_MultivaluedExpression;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression {
|
public class C_ConstantList extends C_Leaf implements C_MultivaluedExpression {
|
||||||
private static final long serialVersionUID = 222662008523199480L;
|
private static final long serialVersionUID = 222662008523199480L;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.expression.C_Expression;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class C_Leaf extends C_Expression {
|
public class C_Leaf extends C_Expression {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author giancarlo
|
||||||
|
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
|
*
|
||||||
|
*/
|
||||||
public class TD_Value extends C_Leaf {
|
public class TD_Value extends C_Leaf {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2802022467528178596L;
|
private static final long serialVersionUID = 2802022467528178596L;
|
||||||
|
|
|
@ -536,14 +536,12 @@ public class ReplaceTypeMap {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
TD_Value sArg;
|
TD_Value sArg;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
|
@ -570,15 +568,12 @@ public class ReplaceTypeMap {
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
C_Expression posFrom;
|
C_Expression posFrom;
|
||||||
C_Expression posTo;
|
C_Expression posTo;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
|
@ -605,16 +600,15 @@ public class ReplaceTypeMap {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
TD_Value sArg;
|
TD_Value sArg;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
|
C_Expression columnReference;
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
} else {
|
} else {
|
||||||
|
@ -637,15 +631,12 @@ public class ReplaceTypeMap {
|
||||||
throws ReplaceTypeMapException {
|
throws ReplaceTypeMapException {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
columnReference=new C_Cast(columnRef,ColumnDataType.Text);
|
||||||
|
@ -666,15 +657,13 @@ public class ReplaceTypeMap {
|
||||||
private C_Expression columnValueReference(ColumnData column,
|
private C_Expression columnValueReference(ColumnData column,
|
||||||
ColumnDataType targetType) {
|
ColumnDataType targetType) {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=targetType){
|
if(dataType!=targetType){
|
||||||
columnReference=new C_Cast(columnRef,targetType);
|
columnReference=new C_Cast(columnRef,targetType);
|
||||||
|
@ -691,14 +680,13 @@ public class ReplaceTypeMap {
|
||||||
private C_Expression upperReference(ColumnData column,
|
private C_Expression upperReference(ColumnData column,
|
||||||
ColumnDataType targetType) {
|
ColumnDataType targetType) {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
|
@ -718,14 +706,13 @@ public class ReplaceTypeMap {
|
||||||
private C_Expression lowerReference(ColumnData column,
|
private C_Expression lowerReference(ColumnData column,
|
||||||
ColumnDataType targetType) {
|
ColumnDataType targetType) {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
|
@ -746,14 +733,13 @@ public class ReplaceTypeMap {
|
||||||
private C_Expression trimReference(ColumnData column,
|
private C_Expression trimReference(ColumnData column,
|
||||||
ColumnDataType targetType) {
|
ColumnDataType targetType) {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
|
@ -773,14 +759,13 @@ public class ReplaceTypeMap {
|
||||||
private C_Expression md5Reference(ColumnData column,
|
private C_Expression md5Reference(ColumnData column,
|
||||||
ColumnDataType targetType) {
|
ColumnDataType targetType) {
|
||||||
C_Expression exp;
|
C_Expression exp;
|
||||||
Log.debug("Column Data Type Name:" + column.getDataTypeName());
|
|
||||||
|
C_ColumnReference columnRef = new C_ColumnReference(
|
||||||
|
column);
|
||||||
|
|
||||||
ColumnDataType dataType = ColumnDataType
|
ColumnDataType dataType = ColumnDataType
|
||||||
.getColumnDataTypeFromId(column
|
.getColumnDataTypeFromId(column
|
||||||
.getDataTypeName());
|
.getDataTypeName());
|
||||||
Log.debug("Data Type:" + dataType);
|
|
||||||
|
|
||||||
C_ColumnReference columnRef = new C_ColumnReference(
|
|
||||||
column.getTrId(), dataType, column.getColumnId());
|
|
||||||
|
|
||||||
C_Expression columnReference;
|
C_Expression columnReference;
|
||||||
if(dataType!=ColumnDataType.Text){
|
if(dataType!=ColumnDataType.Text){
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package org.gcube.portlets.user.td.expressionwidget.shared.rule;
|
package org.gcube.portlets.user.td.expressionwidget.shared.rule;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
import org.gcube.portlets.user.td.gwtservice.shared.rule.description.RuleDescriptionData;
|
||||||
|
|
||||||
import com.google.gwt.editor.client.Editor.Path;
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
|
@ -13,21 +9,24 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author giancarlo
|
* @author giancarlo email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface RuleDescriptionDataProperties extends PropertyAccess<RuleDescriptionData> {
|
public interface RuleDescriptionDataProperties extends
|
||||||
|
PropertyAccess<RuleDescriptionData> {
|
||||||
|
|
||||||
@Path("id")
|
@Path("id")
|
||||||
ModelKeyProvider<RuleDescriptionData> id();
|
ModelKeyProvider<RuleDescriptionData> id();
|
||||||
|
|
||||||
ValueProvider<RuleDescriptionData, String> name();
|
ValueProvider<RuleDescriptionData, String> name();
|
||||||
|
|
||||||
ValueProvider<RuleDescriptionData, String> scopeLabel();
|
ValueProvider<RuleDescriptionData, String> scopeLabel();
|
||||||
|
|
||||||
ValueProvider<RuleDescriptionData, String> description();
|
ValueProvider<RuleDescriptionData, String> description();
|
||||||
|
|
||||||
ValueProvider<RuleDescriptionData, String> ownerLogin();
|
ValueProvider<RuleDescriptionData, String> ownerLogin();
|
||||||
|
|
||||||
ValueProvider<RuleDescriptionData, String> readableExpression();
|
ValueProvider<RuleDescriptionData, String> readableExpression();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,12 @@ import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author giancarlo
|
* @author giancarlo email: <a
|
||||||
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface RuleDescriptionDataPropertiesCombo extends PropertyAccess<RuleDescriptionData> {
|
public interface RuleDescriptionDataPropertiesCombo extends
|
||||||
|
PropertyAccess<RuleDescriptionData> {
|
||||||
|
|
||||||
@Path("id")
|
@Path("id")
|
||||||
ModelKeyProvider<RuleDescriptionData> id();
|
ModelKeyProvider<RuleDescriptionData> id();
|
||||||
|
@ -24,4 +25,3 @@ public interface RuleDescriptionDataPropertiesCombo extends PropertyAccess<Rule
|
||||||
@Path("name")
|
@Path("name")
|
||||||
ValueProvider<RuleDescriptionData, String> nameProv();
|
ValueProvider<RuleDescriptionData, String> nameProv();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue