81: Allow the creation and use of expressions on multi column in TDM portlet
Task-Url: https://support.d4science.org/issues/81 Updated readable expression, now is part of C_Expression git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-expression-widget@114898 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
65ddb80023
commit
b359825701
|
@ -895,8 +895,6 @@ public class ColumnExpressionPanel extends FramedPanel {
|
|||
condContainer = new C_ExpressionContainer();
|
||||
condContainer.setId(C_ExpressionContainer.Contains.C_Expression);
|
||||
condContainer.setExp(exp);
|
||||
condContainer.setReadableExpression(conditionWidget
|
||||
.getReadableExpression());
|
||||
exWrapper = new ExpressionWrapper(column.getTrId(), column,
|
||||
condContainer);
|
||||
|
||||
|
|
|
@ -607,7 +607,6 @@ public class MultiColumnExpressionPanel extends FramedPanel {
|
|||
condContainer = new C_ExpressionContainer();
|
||||
condContainer.setId(C_ExpressionContainer.Contains.C_Expression);
|
||||
condContainer.setExp(exp);
|
||||
condContainer.setReadableExpression(exp.getReadableExpression());
|
||||
exWrapper = new ExpressionWrapper(null, null, condContainer);
|
||||
|
||||
ExpressionWrapperNotification expressionWrapperNotification = new ExpressionWrapperNotification(
|
||||
|
|
|
@ -528,12 +528,11 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
|
|||
if (allRows) {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression, true,
|
||||
null, "AllRows()");
|
||||
null);
|
||||
} else {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cConditionExpression,
|
||||
conditionWidget.getReadableExpression());
|
||||
cConditionExpression);
|
||||
}
|
||||
|
||||
ExpressionWrapper exWrapper = new ExpressionWrapper(
|
||||
|
@ -568,16 +567,15 @@ public class ReplaceColumnByExpressionPanel extends FramedPanel {
|
|||
if (allRows) {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression, true,
|
||||
null, "AllRows()");
|
||||
null);
|
||||
} else {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cConditionExpression,
|
||||
conditionWidget.getReadableExpression());
|
||||
cConditionExpression);
|
||||
}
|
||||
C_ExpressionContainer replaceExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cReplaceExpression, replaceWidget.getReadableExpression());
|
||||
cReplaceExpression);
|
||||
|
||||
ExpressionWrapper exWrapper = new ExpressionWrapper(
|
||||
column.getTrId(), column,
|
||||
|
|
|
@ -534,12 +534,11 @@ public class ReplaceColumnByMultiColumnExpressionPanel extends FramedPanel {
|
|||
if (allRows) {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression, true,
|
||||
null, "AllRows()");
|
||||
null);
|
||||
} else {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cConditionExpression,
|
||||
cConditionExpression.getReadableExpression());
|
||||
cConditionExpression);
|
||||
}
|
||||
|
||||
ExpressionWrapper exWrapper = new ExpressionWrapper(
|
||||
|
@ -574,16 +573,15 @@ public class ReplaceColumnByMultiColumnExpressionPanel extends FramedPanel {
|
|||
if (allRows) {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression, true,
|
||||
null, "AllRows()");
|
||||
null);
|
||||
} else {
|
||||
conditionExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cConditionExpression,
|
||||
cConditionExpression.getReadableExpression());
|
||||
cConditionExpression);
|
||||
}
|
||||
C_ExpressionContainer replaceExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cReplaceExpression, replaceWidget.getReadableExpression());
|
||||
cReplaceExpression);
|
||||
|
||||
ExpressionWrapper exWrapper = new ExpressionWrapper(
|
||||
column.getTrId(), column, conditionExpressionContainer,
|
||||
|
|
|
@ -432,7 +432,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
|
|||
case Template:
|
||||
replaceExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cReplaceExpression, replaceWidget.getReadableExpression());
|
||||
cReplaceExpression);
|
||||
exWrapper = new ExpressionWrapper(
|
||||
replaceExpressionContainer, column.getTrId(), column);
|
||||
expressionWrapperNotification=new ExpressionWrapperNotification(exWrapper);
|
||||
|
@ -442,7 +442,7 @@ public class ReplaceExpressionPanel extends FramedPanel {
|
|||
case AddColumn:
|
||||
replaceExpressionContainer = new C_ExpressionContainer(
|
||||
C_ExpressionContainer.Contains.C_Expression,
|
||||
cReplaceExpression, replaceWidget.getReadableExpression());
|
||||
cReplaceExpression);
|
||||
exWrapper = new ExpressionWrapper(
|
||||
replaceExpressionContainer, column.getTrId(), column);
|
||||
expressionWrapperNotification=new ExpressionWrapperNotification(exWrapper);
|
||||
|
|
|
@ -1992,7 +1992,14 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
|
|||
DateField firstArgDate = (DateField) horiz
|
||||
.getItemByItemId(itemIdFirstArgDate);
|
||||
Date firstDate = firstArgDate.getCurrentValue();
|
||||
firstArg=sdf.format(firstDate);
|
||||
if(firstDate==null){
|
||||
throw new ConditionTypeMapException("Set a valid date and fill all arguments!");
|
||||
} else {
|
||||
firstArg=sdf.format(firstDate);
|
||||
if(firstArg==null){
|
||||
throw new ConditionTypeMapException("Set a valid date and fill all arguments!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TextField firstArgText = (TextField) horiz
|
||||
.getItemByItemId(itemIdFirstArgValue);
|
||||
|
@ -2021,12 +2028,15 @@ public class ConditionOnMultiColumnWidget extends SimpleContainer {
|
|||
DateField secondArgDate = (DateField) horiz
|
||||
.getItemByItemId(itemIdSecondArgDate);
|
||||
Date secondDate = secondArgDate.getCurrentValue();
|
||||
secondArg=sdf.format(secondDate);
|
||||
if(secondDate==null){
|
||||
|
||||
} else {
|
||||
secondArg=sdf.format(secondDate);
|
||||
}
|
||||
} else {
|
||||
TextField secondArgText = (TextField) horiz
|
||||
.getItemByItemId(itemIdSecondArgValue);
|
||||
secondArg=secondArgText.getCurrentValue();
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -673,6 +673,10 @@ public class ConditionOnMultiColumnTypeMap {
|
|||
firstArgColumn.getColumnId());
|
||||
break;
|
||||
case VALUE:
|
||||
if(firstArg==null|| firstArg.isEmpty()){
|
||||
throw new ConditionTypeMapException(
|
||||
"Fill all arguments!");
|
||||
}
|
||||
checkTypeArgument(column, firstArg);
|
||||
fArg = new TD_Value(dataType, firstArg);
|
||||
break;
|
||||
|
@ -680,6 +684,7 @@ public class ConditionOnMultiColumnTypeMap {
|
|||
throw new ConditionTypeMapException(
|
||||
"No valid first argument type selected!");
|
||||
}
|
||||
|
||||
|
||||
switch (secondArgType) {
|
||||
case COLUMN:
|
||||
|
@ -690,6 +695,10 @@ public class ConditionOnMultiColumnTypeMap {
|
|||
secondArgColumn.getColumnId());
|
||||
break;
|
||||
case VALUE:
|
||||
if(secondArg==null|| secondArg.isEmpty()){
|
||||
throw new ConditionTypeMapException(
|
||||
"Fill all arguments!");
|
||||
}
|
||||
checkTypeArgument(column, secondArg);
|
||||
sArg = new TD_Value(dataType, secondArg);
|
||||
break;
|
||||
|
@ -1344,6 +1353,10 @@ public class ConditionOnMultiColumnTypeMap {
|
|||
|
||||
break;
|
||||
case VALUE:
|
||||
if(firstArg==null|| firstArg.isEmpty()){
|
||||
throw new ConditionTypeMapException(
|
||||
"Fill all arguments!");
|
||||
}
|
||||
checkTypeArgument(column, firstArg);
|
||||
fArg = new TD_Value(dataType, firstArg);
|
||||
break;
|
||||
|
@ -1360,6 +1373,10 @@ public class ConditionOnMultiColumnTypeMap {
|
|||
secondArgDataType, secondArgColumn.getColumnId());
|
||||
break;
|
||||
case VALUE:
|
||||
if(secondArg==null|| secondArg.isEmpty()){
|
||||
throw new ConditionTypeMapException(
|
||||
"Fill all arguments!");
|
||||
}
|
||||
checkTypeArgument(column, secondArg);
|
||||
sArg = new TD_Value(dataType, secondArg);
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue