Minor Updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@91815 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
a38018ff3a
commit
8a0f365d8d
|
@ -94,3 +94,67 @@ Compiling...
|
||||||
Compilation completed in 0.00 seconds
|
Compilation completed in 0.00 seconds
|
||||||
Removing invalidated units
|
Removing invalidated units
|
||||||
Finding entry point classes
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
30% complete (ETR: 10 seconds)
|
||||||
|
30% complete (ETR: 10 seconds)
|
||||||
|
30% complete (ETR: 10 seconds)
|
||||||
|
30% complete (ETR: 10 seconds)
|
||||||
|
40% complete (ETR: 8 seconds)
|
||||||
|
50% complete (ETR: 6 seconds)
|
||||||
|
60% complete (ETR: 4 seconds)
|
||||||
|
70% complete (ETR: 3 seconds)
|
||||||
|
80% complete (ETR: 2 seconds)
|
||||||
|
90% complete (ETR: 1 seconds)
|
||||||
|
100% complete (ETR: 0 seconds)
|
||||||
|
Compilation completed in 11.43 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 0 cached/archived units. Used 0 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
30% complete (ETR: 8 seconds)
|
||||||
|
30% complete (ETR: 8 seconds)
|
||||||
|
30% complete (ETR: 8 seconds)
|
||||||
|
30% complete (ETR: 8 seconds)
|
||||||
|
40% complete (ETR: 8 seconds)
|
||||||
|
50% complete (ETR: 6 seconds)
|
||||||
|
60% complete (ETR: 4 seconds)
|
||||||
|
70% complete (ETR: 3 seconds)
|
||||||
|
80% complete (ETR: 2 seconds)
|
||||||
|
90% complete (ETR: 1 seconds)
|
||||||
|
100% complete (ETR: 0 seconds)
|
||||||
|
Compilation completed in 17.45 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
Public resources found in...
|
||||||
|
Translatable source found in...
|
||||||
|
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
|
||||||
|
Compiling...
|
||||||
|
Compilation completed in 0.00 seconds
|
||||||
|
Removing invalidated units
|
||||||
|
Finding entry point classes
|
||||||
|
|
|
@ -197,6 +197,7 @@ public class ColumnExpressionPanel extends FramedPanel {
|
||||||
C_ExpressionContainer container = new C_ExpressionContainer();
|
C_ExpressionContainer container = new C_ExpressionContainer();
|
||||||
container.setId(C_ExpressionContainer.Contains.C_Expression);
|
container.setId(C_ExpressionContainer.Contains.C_Expression);
|
||||||
container.setExp(exp);
|
container.setExp(exp);
|
||||||
|
container.setReadableExpression(conditionWidget.getReadableExpression());
|
||||||
expressionEvent.setC_ExpressionContainer(container);
|
expressionEvent.setC_ExpressionContainer(container);
|
||||||
expressionEvent.setTrId(column.getTrId());
|
expressionEvent.setTrId(column.getTrId());
|
||||||
expressionEvent.setColumnId(column.getColumnId());
|
expressionEvent.setColumnId(column.getColumnId());
|
||||||
|
|
|
@ -58,6 +58,10 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
protected VerticalLayoutContainer vert;
|
protected VerticalLayoutContainer vert;
|
||||||
protected ColumnData column;
|
protected ColumnData column;
|
||||||
|
|
||||||
|
protected String readableExpression;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ConditionWidget(ColumnData column) {
|
ConditionWidget(ColumnData column) {
|
||||||
this.column = column;
|
this.column = column;
|
||||||
setBorders(true);
|
setBorders(true);
|
||||||
|
@ -90,7 +94,6 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
groupMatch.add(radioAll);
|
groupMatch.add(radioAll);
|
||||||
groupMatch.add(radioAny);
|
groupMatch.add(radioAny);
|
||||||
groupMatch.setValue(radioAll);
|
groupMatch.setValue(radioAll);
|
||||||
|
|
||||||
|
|
||||||
vert = new VerticalLayoutContainer();
|
vert = new VerticalLayoutContainer();
|
||||||
vert.setScrollMode(ScrollMode.AUTO);
|
vert.setScrollMode(ScrollMode.AUTO);
|
||||||
|
@ -363,7 +366,9 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
|
|
||||||
public C_Expression getExpression() {
|
public C_Expression getExpression() {
|
||||||
C_Expression exp = null;
|
C_Expression exp = null;
|
||||||
|
readableExpression = new String();
|
||||||
List<C_Expression> arguments = new ArrayList<C_Expression>();
|
List<C_Expression> arguments = new ArrayList<C_Expression>();
|
||||||
|
List<String> readableExpressionList = new ArrayList<String>();
|
||||||
TextField firstArg;
|
TextField firstArg;
|
||||||
TextField secondArg;
|
TextField secondArg;
|
||||||
C_Expression expression;
|
C_Expression expression;
|
||||||
|
@ -372,8 +377,7 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
Iterator<Widget> iteratorVert = vert.iterator();
|
Iterator<Widget> iteratorVert = vert.iterator();
|
||||||
HBoxLayoutContainer horiz;
|
HBoxLayoutContainer horiz;
|
||||||
while (iteratorVert.hasNext()) {
|
while (iteratorVert.hasNext()) {
|
||||||
horiz = (HBoxLayoutContainer) iteratorVert
|
horiz = (HBoxLayoutContainer) iteratorVert.next();
|
||||||
.next();
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<Operation> comboOp = (ComboBox<Operation>) horiz
|
ComboBox<Operation> comboOp = (ComboBox<Operation>) horiz
|
||||||
.getItemByItemId(itemIdCombo);
|
.getItemByItemId(itemIdCombo);
|
||||||
|
@ -387,21 +391,44 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
.getOperatorType(),
|
.getOperatorType(),
|
||||||
firstArg == null ? null : firstArg.getCurrentValue(),
|
firstArg == null ? null : firstArg.getCurrentValue(),
|
||||||
secondArg == null ? null : secondArg.getCurrentValue());
|
secondArg == null ? null : secondArg.getCurrentValue());
|
||||||
|
readableExpressionList.add(mapOp.getReadableExpression());
|
||||||
Log.debug(expression.toString());
|
Log.debug(expression.toString());
|
||||||
arguments.add(expression);
|
arguments.add(expression);
|
||||||
}
|
}
|
||||||
Log.debug("Expression Arguments Calculated: " +arguments.size());
|
Log.debug("Expression Arguments Calculated: " + arguments.size());
|
||||||
if (arguments.size() > 0) {
|
if (arguments.size() > 0) {
|
||||||
if (arguments.size() == 1) {
|
if (arguments.size() == 1) {
|
||||||
exp = arguments.get(0);
|
exp = arguments.get(0);
|
||||||
|
readableExpression = readableExpressionList.get(0);
|
||||||
} else {
|
} else {
|
||||||
Radio radio = (Radio) groupMatch.getValue();
|
Radio radio = (Radio) groupMatch.getValue();
|
||||||
Log.debug("Match:"+radio);
|
Log.debug("Match:" + radio);
|
||||||
if (radio.getName().compareTo("All") == 0) {
|
if (radio.getName().compareTo("All") == 0) {
|
||||||
exp = mapOp.createC_And(arguments);
|
exp = mapOp.createC_And(arguments);
|
||||||
|
readableExpression = "And(";
|
||||||
|
boolean first = true;
|
||||||
|
for (String read : readableExpressionList) {
|
||||||
|
if (first) {
|
||||||
|
readableExpression += read;
|
||||||
|
} else {
|
||||||
|
readableExpression += ", " + read;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readableExpression += ")";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (radio.getName().compareTo("Any") == 0) {
|
if (radio.getName().compareTo("Any") == 0) {
|
||||||
exp = mapOp.createC_Or(arguments);
|
exp = mapOp.createC_Or(arguments);
|
||||||
|
readableExpression = "Or(";
|
||||||
|
boolean first = true;
|
||||||
|
for (String read : readableExpressionList) {
|
||||||
|
if (first) {
|
||||||
|
readableExpression += read;
|
||||||
|
} else {
|
||||||
|
readableExpression += ", " + read;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
readableExpression += ")";
|
||||||
} else {
|
} else {
|
||||||
Log.error("No All or Any set!");
|
Log.error("No All or Any set!");
|
||||||
}
|
}
|
||||||
|
@ -412,5 +439,9 @@ public class ConditionWidget extends SimpleContainer {
|
||||||
Log.debug("C_Expression:" + exp.toString());
|
Log.debug("C_Expression:" + exp.toString());
|
||||||
return exp;
|
return exp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getReadableExpression() {
|
||||||
|
return readableExpression;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,18 +55,14 @@ public class ExpressionServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
List<OperationDefinition> capabilities = service.getCapabilities();
|
List<OperationDefinition> capabilities = service.getCapabilities();
|
||||||
|
|
||||||
OperationDefinition importSDMXCodelistOperation = OperationDefinitionMap.map(
|
OperationDefinition operation = OperationDefinitionMap.map(
|
||||||
OperationsId.FilterByExpression.toString(), capabilities);
|
OperationsId.FilterByExpression.toString(), capabilities);
|
||||||
|
|
||||||
|
|
||||||
|
Map<String, Object> parameterInstance = null;//retrieveOperationParameters(sdmxImportSession);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> parameterInstance=null;// = retrieveOperationParameters(sdmxImportSession);
|
|
||||||
|
|
||||||
OperationExecution invocation = new OperationExecution(
|
OperationExecution invocation = new OperationExecution(
|
||||||
importSDMXCodelistOperation.getOperationId(),
|
operation.getOperationId(),
|
||||||
parameterInstance);
|
parameterInstance);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class OperatorTypeMap {
|
public class OperatorTypeMap {
|
||||||
|
private String readableExpression;
|
||||||
|
|
||||||
public OperatorTypeMap(){
|
public OperatorTypeMap(){
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ public class OperatorTypeMap {
|
||||||
public C_Expression map(ColumnData column,C_OperatorType operatorType, String firstArg, String secondArg){
|
public C_Expression map(ColumnData column,C_OperatorType operatorType, String firstArg, String secondArg){
|
||||||
Log.debug("OperatorTypeMap Map");
|
Log.debug("OperatorTypeMap Map");
|
||||||
C_Expression exp=null;
|
C_Expression exp=null;
|
||||||
|
readableExpression=new String();
|
||||||
if(column.getTrId()==null){
|
if(column.getTrId()==null){
|
||||||
exp=mapPlaceHolder(column,operatorType,firstArg,secondArg);
|
exp=mapPlaceHolder(column,operatorType,firstArg,secondArg);
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,11 +66,11 @@ public class OperatorTypeMap {
|
||||||
C_Expression exp = null;
|
C_Expression exp = null;
|
||||||
Log.debug("Column Data Type Name:"+column.getDataTypeName());
|
Log.debug("Column Data Type Name:"+column.getDataTypeName());
|
||||||
ColumnDataType dataType=ColumnTypeMap.getColumnDataType(column.getDataTypeName());
|
ColumnDataType dataType=ColumnTypeMap.getColumnDataType(column.getDataTypeName());
|
||||||
Log.debug("Data Type:"+dataType);
|
Log.debug("Data Type:"+dataType);
|
||||||
|
|
||||||
C_ColumnReferencePlaceholder placeHolder=new C_ColumnReferencePlaceholder(dataType
|
C_ColumnReferencePlaceholder placeHolder=new C_ColumnReferencePlaceholder(dataType
|
||||||
, column.getColumnId());
|
, column.getColumnId());
|
||||||
Log.debug("placeHolder:"+placeHolder);
|
Log.debug("placeHolder:"+placeHolder);
|
||||||
|
String readablePlaceHolder=column.getColumnId();
|
||||||
|
|
||||||
List<TD_Value> arguments=new ArrayList<TD_Value>();
|
List<TD_Value> arguments=new ArrayList<TD_Value>();
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
|
@ -88,12 +89,14 @@ public class OperatorTypeMap {
|
||||||
break;
|
break;
|
||||||
case BEGINS_WITH:
|
case BEGINS_WITH:
|
||||||
exp=new C_TextBeginsWith(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_TextBeginsWith(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="Begins("+readablePlaceHolder+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case BETWEEN:
|
case BETWEEN:
|
||||||
fArg=new TD_Value(dataType,firstArg);
|
fArg=new TD_Value(dataType,firstArg);
|
||||||
sArg=new TD_Value(dataType,secondArg);
|
sArg=new TD_Value(dataType,secondArg);
|
||||||
range=new C_Range(fArg,sArg);
|
range=new C_Range(fArg,sArg);
|
||||||
exp=new C_Between(placeHolder,range);
|
exp=new C_Between(placeHolder,range);
|
||||||
|
readableExpression="Between("+readablePlaceHolder+", Range("+firstArg+", "+secondArg+"))";
|
||||||
break;
|
break;
|
||||||
case CONTAINS:
|
case CONTAINS:
|
||||||
separator=firstArg.indexOf(",");
|
separator=firstArg.indexOf(",");
|
||||||
|
@ -119,42 +122,56 @@ public class OperatorTypeMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exp=new C_TextContains(placeHolder,new C_ConstantList(arguments));
|
exp=new C_TextContains(placeHolder,new C_ConstantList(arguments));
|
||||||
|
readableExpression="Contains("+readablePlaceHolder;
|
||||||
|
for(TD_Value v:arguments){
|
||||||
|
readableExpression+=", "+v.getValue();
|
||||||
|
}
|
||||||
|
readableExpression+=")";
|
||||||
break;
|
break;
|
||||||
case DIVISION:
|
case DIVISION:
|
||||||
break;
|
break;
|
||||||
case ENDS_WITH:
|
case ENDS_WITH:
|
||||||
exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="TextEndsWith("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case EQUALS:
|
case EQUALS:
|
||||||
exp=new C_Equals(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_Equals(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="Equals("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case EXISTS:
|
case EXISTS:
|
||||||
//exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
//exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
||||||
break;
|
break;
|
||||||
case GREATER:
|
case GREATER:
|
||||||
exp=new C_GreaterThan(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_GreaterThan(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="GreaterThan("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case GREATER_OR_EQUALS:
|
case GREATER_OR_EQUALS:
|
||||||
exp=new C_GreaterOrEquals(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_GreaterOrEquals(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="GreaterOrEquals("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case IN:
|
case IN:
|
||||||
break;
|
break;
|
||||||
case IS_NOT_NULL:
|
case IS_NOT_NULL:
|
||||||
exp=new C_IsNotNull(placeHolder);
|
exp=new C_IsNotNull(placeHolder);
|
||||||
|
readableExpression="IsNotNull("+readablePlaceHolder+")";
|
||||||
break;
|
break;
|
||||||
case IS_NULL:
|
case IS_NULL:
|
||||||
exp=new C_IsNull(placeHolder);
|
exp=new C_IsNull(placeHolder);
|
||||||
|
readableExpression="IsNull("+readablePlaceHolder+")";
|
||||||
break;
|
break;
|
||||||
case LESSER:
|
case LESSER:
|
||||||
exp=new C_LessThan(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_LessThan(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="LessThan("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case LESSER_OR_EQUALS:
|
case LESSER_OR_EQUALS:
|
||||||
exp=new C_LessOrEquals(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_LessOrEquals(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="LessOrEquals("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case LIKE:
|
case LIKE:
|
||||||
break;
|
break;
|
||||||
case MATCH_REGEX:
|
case MATCH_REGEX:
|
||||||
exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="TextMatchSQLRegexp("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case MODULUS:
|
case MODULUS:
|
||||||
break;
|
break;
|
||||||
|
@ -165,6 +182,7 @@ public class OperatorTypeMap {
|
||||||
case NOT_BEGINS_WITH:
|
case NOT_BEGINS_WITH:
|
||||||
exp=new C_TextBeginsWith(placeHolder, new TD_Value(dataType,firstArg));
|
exp=new C_TextBeginsWith(placeHolder, new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextBeginsWith("+readablePlaceHolder+","+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case NOT_BETWEEN:
|
case NOT_BETWEEN:
|
||||||
fArg=new TD_Value(dataType,firstArg);
|
fArg=new TD_Value(dataType,firstArg);
|
||||||
|
@ -172,6 +190,7 @@ public class OperatorTypeMap {
|
||||||
range=new C_Range(fArg,sArg);
|
range=new C_Range(fArg,sArg);
|
||||||
exp=new C_Between(placeHolder,range);
|
exp=new C_Between(placeHolder,range);
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(Between("+readablePlaceHolder+", Range("+firstArg+", "+secondArg+")))";
|
||||||
break;
|
break;
|
||||||
case NOT_CONTAINS:
|
case NOT_CONTAINS:
|
||||||
separator=firstArg.indexOf(",");
|
separator=firstArg.indexOf(",");
|
||||||
|
@ -198,27 +217,37 @@ public class OperatorTypeMap {
|
||||||
}
|
}
|
||||||
exp=new C_TextContains(placeHolder,new C_ConstantList(arguments));
|
exp=new C_TextContains(placeHolder,new C_ConstantList(arguments));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(Contains("+readablePlaceHolder;
|
||||||
|
for(TD_Value v:arguments){
|
||||||
|
readableExpression+=", "+v.getValue();
|
||||||
|
}
|
||||||
|
readableExpression+="))";
|
||||||
break;
|
break;
|
||||||
case NOT_ENDS_WITH:
|
case NOT_ENDS_WITH:
|
||||||
exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_TextEndsWith(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextEndsWith("+readablePlaceHolder+","+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case NOT_EQUALS:
|
case NOT_EQUALS:
|
||||||
exp=new C_NotEquals(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_NotEquals(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotEquals("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_GREATER:
|
case NOT_GREATER:
|
||||||
exp=new C_NotGreater(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_NotGreater(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotGreater("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_IN:
|
case NOT_IN:
|
||||||
break;
|
break;
|
||||||
case NOT_LESSER:
|
case NOT_LESSER:
|
||||||
exp=new C_NotLess(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_NotLess(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotLess("+readablePlaceHolder+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_LIKE:
|
case NOT_LIKE:
|
||||||
break;
|
break;
|
||||||
case NOT_MATCH_REGEX:
|
case NOT_MATCH_REGEX:
|
||||||
exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg));
|
exp=new C_TextMatchSQLRegexp(placeHolder,new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextMatchSQLRegexp("+readablePlaceHolder+","+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case OR:
|
case OR:
|
||||||
break;
|
break;
|
||||||
|
@ -245,11 +274,10 @@ public class OperatorTypeMap {
|
||||||
Log.debug("Column Data Type Name:"+column.getDataTypeName());
|
Log.debug("Column Data Type Name:"+column.getDataTypeName());
|
||||||
ColumnDataType dataType=ColumnTypeMap.getColumnDataType(column.getDataTypeName());
|
ColumnDataType dataType=ColumnTypeMap.getColumnDataType(column.getDataTypeName());
|
||||||
Log.debug("Data Type:"+dataType);
|
Log.debug("Data Type:"+dataType);
|
||||||
|
|
||||||
C_TypedColumnReference columnReference=new C_TypedColumnReference(column.getTrId(), dataType
|
C_TypedColumnReference columnReference=new C_TypedColumnReference(column.getTrId(), dataType
|
||||||
, column.getColumnId());
|
, column.getColumnId());
|
||||||
Log.debug("Typed Column Reference:"+columnReference);
|
Log.debug("Typed Column Reference:"+columnReference);
|
||||||
|
String readableColumnReference=column.getLabel();
|
||||||
|
|
||||||
List<TD_Value> arguments=new ArrayList<TD_Value>();
|
List<TD_Value> arguments=new ArrayList<TD_Value>();
|
||||||
TD_Value fArg;
|
TD_Value fArg;
|
||||||
|
@ -268,12 +296,14 @@ public class OperatorTypeMap {
|
||||||
break;
|
break;
|
||||||
case BEGINS_WITH:
|
case BEGINS_WITH:
|
||||||
exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="TextBeginsWith("+readableColumnReference+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case BETWEEN:
|
case BETWEEN:
|
||||||
fArg=new TD_Value(dataType,firstArg);
|
fArg=new TD_Value(dataType,firstArg);
|
||||||
sArg=new TD_Value(dataType,secondArg);
|
sArg=new TD_Value(dataType,secondArg);
|
||||||
range=new C_Range(fArg,sArg);
|
range=new C_Range(fArg,sArg);
|
||||||
exp=new C_Between(columnReference,range);
|
exp=new C_Between(columnReference,range);
|
||||||
|
readableExpression="Between("+readableColumnReference+", Range("+firstArg+", "+secondArg+"))";
|
||||||
break;
|
break;
|
||||||
case CONTAINS:
|
case CONTAINS:
|
||||||
separator=firstArg.indexOf(",");
|
separator=firstArg.indexOf(",");
|
||||||
|
@ -299,42 +329,56 @@ public class OperatorTypeMap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exp=new C_TextContains(columnReference,new C_ConstantList(arguments));
|
exp=new C_TextContains(columnReference,new C_ConstantList(arguments));
|
||||||
|
readableExpression="Contains("+readableColumnReference;
|
||||||
|
for(TD_Value v:arguments){
|
||||||
|
readableExpression+=", "+v.getValue();
|
||||||
|
}
|
||||||
|
readableExpression+=")";
|
||||||
break;
|
break;
|
||||||
case DIVISION:
|
case DIVISION:
|
||||||
break;
|
break;
|
||||||
case ENDS_WITH:
|
case ENDS_WITH:
|
||||||
exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="TextEndsWith("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case EQUALS:
|
case EQUALS:
|
||||||
exp=new C_Equals(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_Equals(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="Equals("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case EXISTS:
|
case EXISTS:
|
||||||
//exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
//exp=new C_Exi(placeHolder,new C_ConstantList(arguments));
|
||||||
break;
|
break;
|
||||||
case GREATER:
|
case GREATER:
|
||||||
exp=new C_GreaterThan(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_GreaterThan(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="GreaterThan("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case GREATER_OR_EQUALS:
|
case GREATER_OR_EQUALS:
|
||||||
exp=new C_GreaterOrEquals(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_GreaterOrEquals(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="GreaterOrEquals("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case IN:
|
case IN:
|
||||||
break;
|
break;
|
||||||
case IS_NOT_NULL:
|
case IS_NOT_NULL:
|
||||||
exp=new C_IsNotNull(columnReference);
|
exp=new C_IsNotNull(columnReference);
|
||||||
|
readableExpression="IsNotNull("+readableColumnReference+")";
|
||||||
break;
|
break;
|
||||||
case IS_NULL:
|
case IS_NULL:
|
||||||
exp=new C_IsNull(columnReference);
|
exp=new C_IsNull(columnReference);
|
||||||
|
readableExpression="IsNull("+readableColumnReference+")";
|
||||||
break;
|
break;
|
||||||
case LESSER:
|
case LESSER:
|
||||||
exp=new C_LessThan(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_LessThan(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="LessThan("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case LESSER_OR_EQUALS:
|
case LESSER_OR_EQUALS:
|
||||||
exp=new C_LessOrEquals(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_LessOrEquals(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="LessOrEquals("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case LIKE:
|
case LIKE:
|
||||||
break;
|
break;
|
||||||
case MATCH_REGEX:
|
case MATCH_REGEX:
|
||||||
exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="TextMatchSQLRegexp("+readableColumnReference+", "+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case MODULUS:
|
case MODULUS:
|
||||||
break;
|
break;
|
||||||
|
@ -345,6 +389,7 @@ public class OperatorTypeMap {
|
||||||
case NOT_BEGINS_WITH:
|
case NOT_BEGINS_WITH:
|
||||||
exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextBeginsWith(columnReference,new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextBeginsWith("+readableColumnReference+", "+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case NOT_BETWEEN:
|
case NOT_BETWEEN:
|
||||||
fArg=new TD_Value(dataType,firstArg);
|
fArg=new TD_Value(dataType,firstArg);
|
||||||
|
@ -352,6 +397,7 @@ public class OperatorTypeMap {
|
||||||
range=new C_Range(fArg,sArg);
|
range=new C_Range(fArg,sArg);
|
||||||
exp=new C_Between(columnReference,range);
|
exp=new C_Between(columnReference,range);
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(Between("+readableColumnReference+", Range("+firstArg+", "+secondArg+")))";
|
||||||
break;
|
break;
|
||||||
case NOT_CONTAINS:
|
case NOT_CONTAINS:
|
||||||
separator=firstArg.indexOf(",");
|
separator=firstArg.indexOf(",");
|
||||||
|
@ -378,27 +424,37 @@ public class OperatorTypeMap {
|
||||||
}
|
}
|
||||||
exp=new C_TextContains(columnReference,new C_ConstantList(arguments));
|
exp=new C_TextContains(columnReference,new C_ConstantList(arguments));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(Contains("+readableColumnReference;
|
||||||
|
for(TD_Value v:arguments){
|
||||||
|
readableExpression+=", "+v.getValue();
|
||||||
|
}
|
||||||
|
readableExpression+="))";
|
||||||
break;
|
break;
|
||||||
case NOT_ENDS_WITH:
|
case NOT_ENDS_WITH:
|
||||||
exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextEndsWith(columnReference,new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextEndsWith("+readableColumnReference+","+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case NOT_EQUALS:
|
case NOT_EQUALS:
|
||||||
exp=new C_NotEquals(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_NotEquals(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotEquals("+readableColumnReference+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_GREATER:
|
case NOT_GREATER:
|
||||||
exp=new C_NotGreater(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_NotGreater(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotGreater("+readableColumnReference+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_IN:
|
case NOT_IN:
|
||||||
break;
|
break;
|
||||||
case NOT_LESSER:
|
case NOT_LESSER:
|
||||||
exp=new C_NotLess(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_NotLess(columnReference,new TD_Value(dataType,firstArg));
|
||||||
|
readableExpression="NotLess("+readableColumnReference+","+firstArg+")";
|
||||||
break;
|
break;
|
||||||
case NOT_LIKE:
|
case NOT_LIKE:
|
||||||
break;
|
break;
|
||||||
case NOT_MATCH_REGEX:
|
case NOT_MATCH_REGEX:
|
||||||
exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg));
|
exp=new C_TextMatchSQLRegexp(columnReference,new TD_Value(dataType,firstArg));
|
||||||
exp=new C_Not(exp);
|
exp=new C_Not(exp);
|
||||||
|
readableExpression="Not(TextMatchSQLRegexp("+readableColumnReference+","+firstArg+"))";
|
||||||
break;
|
break;
|
||||||
case OR:
|
case OR:
|
||||||
break;
|
break;
|
||||||
|
@ -425,6 +481,9 @@ public class OperatorTypeMap {
|
||||||
return or;
|
return or;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getReadableExpression() {
|
||||||
|
return readableExpression;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue