81: Allow the creation and use of expressions on multi column in TDM portlet

Updated MultiColumnFilterDialog 

Task-Url: https://support.d4science.org/issues/81

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@114739 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-05-13 17:07:00 +00:00
parent 69c6691c57
commit 9ef48c5c21
9 changed files with 1053 additions and 301 deletions

View File

@ -26,16 +26,17 @@
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry' <!-- <entry-point class='org.gcube.portlets.user.td.expressionwidget.client.ExpressionWidgetEntry'
/> --> /> -->
<!-- <set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property <!--
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property
name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger" name="log_DivLogger" value="ENABLED" /> <set-property name="log_GWTLogger"
value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED" value="ENABLED" /> <set-property name="log_SystemLogger" value="ENABLED"
/> --> /> -->
<set-property name="log_ConsoleLogger" value="DISABLED" /> <set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" /> <set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" /> <set-property name="log_GWTLogger" value="DISABLED" />
<set-property name="log_SystemLogger" value="DISABLED" /> <set-property name="log_SystemLogger" value="DISABLED" /> -->
<!-- Specify the paths for translatable code --> <!-- Specify the paths for translatable code -->
<source path='client' /> <source path='client' />

View File

@ -163,7 +163,7 @@ public class ColumnFilterDialog extends Window implements MonitorDialogListener
protected void callApplyFilter() { protected void callApplyFilter() {
filterColumnSession = new FilterColumnSession(column, exp); filterColumnSession = new FilterColumnSession(trId, exp);
Log.debug(filterColumnSession.toString()); Log.debug(filterColumnSession.toString());
ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession, ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession,

View File

@ -781,7 +781,7 @@ public class MultiColumnExpressionPanel extends FramedPanel {
UtilsGXT3.alert("Attention", e.getLocalizedMessage()); UtilsGXT3.alert("Attention", e.getLocalizedMessage());
return; return;
} }
parentMultiFilterDialog.applyFilter(column, exp); parentMultiFilterDialog.applyFilter(exp);
break; break;
case RowDeleteByExpression: case RowDeleteByExpression:
try { try {

View File

@ -105,9 +105,8 @@ public class MultiColumnFilterDialog extends Window implements MonitorDialogList
this.exp = exp; this.exp = exp;
} }
protected void applyFilter(ColumnData column,C_Expression exp) { protected void applyFilter(C_Expression exp) {
this.exp = exp; this.exp = exp;
this.column= column;
callApplyFilter(); callApplyFilter();
} }
@ -162,7 +161,7 @@ public class MultiColumnFilterDialog extends Window implements MonitorDialogList
protected void callApplyFilter() { protected void callApplyFilter() {
filterColumnSession = new FilterColumnSession(column, exp); filterColumnSession = new FilterColumnSession(trId, exp);
Log.debug(filterColumnSession.toString()); Log.debug(filterColumnSession.toString());
ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession, ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession,

View File

@ -163,7 +163,7 @@ public class RowsDeleteByExpressionDialog extends Window implements MonitorDialo
protected void callDeleteRows() { protected void callDeleteRows() {
filterColumnSession = new FilterColumnSession(column, exp); filterColumnSession = new FilterColumnSession(trId, exp);
Log.debug(filterColumnSession.toString()); Log.debug(filterColumnSession.toString());
ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession, ExpressionServiceAsync.INSTANCE.startFilterColumn(filterColumnSession,

View File

@ -661,7 +661,6 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
case NOT_MATCH_REGEX: case NOT_MATCH_REGEX:
case IN: case IN:
case NOT_IN: case NOT_IN:
case SOUNDEX:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(true);
@ -697,8 +696,27 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
btnAdd.setVisible(true); btnAdd.setVisible(true);
btnDel.setVisible(false); btnDel.setVisible(false);
break; break;
case SOUNDEX:
comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(true);
firstArgDate.setVisible(false);
andText.setVisible(false);
comboSecondArgType.setVisible(false);
comboSecondArgColumn.setVisible(false);
secondArgValue.setVisible(false);
secondArgDate.setVisible(false);
thresholdText.setVisible(false);
comboThreshold.setVisible(false);
btnAdd.setVisible(true);
btnDel.setVisible(false);
break;
case LEVENSHTEIN: case LEVENSHTEIN:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
storeThreshold.clear(); storeThreshold.clear();
storeThreshold storeThreshold
.addAll(ThresholdStore.thresholdsLevenshtein); .addAll(ThresholdStore.thresholdsLevenshtein);
@ -706,9 +724,9 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
comboThreshold.clear(); comboThreshold.clear();
comboThreshold.reset(); comboThreshold.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false); comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(false); firstArgValue.setVisible(true);
firstArgDate.setVisible(false); firstArgDate.setVisible(false);
andText.setVisible(false); andText.setVisible(false);
comboSecondArgType.setVisible(false); comboSecondArgType.setVisible(false);
@ -726,6 +744,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
break; break;
case SIMILARITY: case SIMILARITY:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
storeThreshold.clear(); storeThreshold.clear();
storeThreshold storeThreshold
.addAll(ThresholdStore.thresholdsSimilarity); .addAll(ThresholdStore.thresholdsSimilarity);
@ -733,9 +752,9 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
comboThreshold.clear(); comboThreshold.clear();
comboThreshold.reset(); comboThreshold.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false); comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(false); firstArgValue.setVisible(true);
firstArgDate.setVisible(false); firstArgDate.setVisible(false);
andText.setVisible(false); andText.setVisible(false);
comboSecondArgType.setVisible(false); comboSecondArgType.setVisible(false);
@ -918,9 +937,20 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
} }
}); });
comboDepth.setVisible(true); comboDepth.setVisible(true);
comboFirstElementColumn.setVisible(false); comboDepth.setValue(DepthOfExpressionStore.bottomFirstElement, true);
storeFirstElementColumn.clear();
storeFirstElementColumn.addAll(columns);
storeFirstElementColumn.commitChanges();
comboFirstElementColumn.clear();
comboFirstElementColumn.reset();
comboFirstElementColumn.setVisible(true);
comboOperator.setVisible(false); comboOperator.setVisible(false);
comboFirstArgType.setVisible(false); comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false); comboFirstArgColumn.setVisible(false);
@ -1426,7 +1456,6 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
case NOT_MATCH_REGEX: case NOT_MATCH_REGEX:
case IN: case IN:
case NOT_IN: case NOT_IN:
case SOUNDEX:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(true);
@ -1462,8 +1491,27 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
btnAdd.setVisible(true); btnAdd.setVisible(true);
btnDel.setVisible(true); btnDel.setVisible(true);
break; break;
case SOUNDEX:
comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(true);
firstArgDate.setVisible(false);
andText.setVisible(false);
comboSecondArgType.setVisible(false);
comboSecondArgColumn.setVisible(false);
secondArgValue.setVisible(false);
secondArgDate.setVisible(false);
thresholdText.setVisible(false);
comboThreshold.setVisible(false);
btnAdd.setVisible(true);
btnDel.setVisible(true);
break;
case LEVENSHTEIN: case LEVENSHTEIN:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
storeThreshold.clear(); storeThreshold.clear();
storeThreshold storeThreshold
.addAll(ThresholdStore.thresholdsLevenshtein); .addAll(ThresholdStore.thresholdsLevenshtein);
@ -1471,9 +1519,9 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
comboThreshold.clear(); comboThreshold.clear();
comboThreshold.reset(); comboThreshold.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false); comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(false); firstArgValue.setVisible(true);
firstArgDate.setVisible(false); firstArgDate.setVisible(false);
andText.setVisible(false); andText.setVisible(false);
comboSecondArgType.setVisible(false); comboSecondArgType.setVisible(false);
@ -1491,6 +1539,7 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
break; break;
case SIMILARITY: case SIMILARITY:
comboFirstArgType.reset(); comboFirstArgType.reset();
comboFirstArgType.setValue(ArgType.VALUE, true);
storeThreshold.clear(); storeThreshold.clear();
storeThreshold storeThreshold
.addAll(ThresholdStore.thresholdsSimilarity); .addAll(ThresholdStore.thresholdsSimilarity);
@ -1498,9 +1547,9 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
comboThreshold.clear(); comboThreshold.clear();
comboThreshold.reset(); comboThreshold.reset();
comboFirstArgType.setVisible(true); comboFirstArgType.setVisible(false);
comboFirstArgColumn.setVisible(false); comboFirstArgColumn.setVisible(false);
firstArgValue.setVisible(false); firstArgValue.setVisible(true);
firstArgDate.setVisible(false); firstArgDate.setVisible(false);
andText.setVisible(false); andText.setVisible(false);
comboSecondArgType.setVisible(false); comboSecondArgType.setVisible(false);

View File

@ -15,7 +15,7 @@ public class DepthOfExpressionStore implements Serializable {
private static ArrayList<DepthOfExpressionElement> store; private static ArrayList<DepthOfExpressionElement> store;
private static DepthOfExpressionElement bottomFirstElement = new DepthOfExpressionElement( public static DepthOfExpressionElement bottomFirstElement = new DepthOfExpressionElement(
0, DepthOfExpressionType.BOTTOM, 0, DepthOfExpressionType.BOTTOM,
DepthOfExpressionType.BOTTOM.getLabel()); DepthOfExpressionType.BOTTOM.getLabel());
private static DepthOfExpressionElement startAndFirstElement = new DepthOfExpressionElement( private static DepthOfExpressionElement startAndFirstElement = new DepthOfExpressionElement(

View File

@ -36,8 +36,9 @@
<set-property name="log_ConsoleLogger" value="ENABLED" /> <set-property name="log_ConsoleLogger" value="ENABLED" />
<set-property name="log_DivLogger" value="ENABLED" /> <set-property name="log_DivLogger" value="ENABLED" />
<set-property name="log_GWTLogger" value="ENABLED" /> <set-property name="log_GWTLogger" value="ENABLED" />
<set-property name="log_SystemLogger" value="ENABLED" /> --> <set-property name="log_SystemLogger" value="ENABLED" />
-->
<set-property name="log_ConsoleLogger" value="DISABLED" /> <set-property name="log_ConsoleLogger" value="DISABLED" />
<set-property name="log_DivLogger" value="DISABLED" /> <set-property name="log_DivLogger" value="DISABLED" />
<set-property name="log_GWTLogger" value="DISABLED" /> <set-property name="log_GWTLogger" value="DISABLED" />