use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method updateAggregateExpression.
private void updateAggregateExpression() {
EList<TdExpression> aggregate1argFunctions = getCurrentModelElement().getAggregate1argFunctions();
aggregate1argFunctions.clear();
for (AggregateDateExpression ade : afExpressionMapTemp.values()) {
TdExpression expression = ade.getAggregateExpression();
if (expression.getBody() != null && !PluginConstant.EMPTY_STRING.equals(expression.getBody())) {
aggregate1argFunctions.add(expression);
}
}
}
use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method getCurrentLanguageExp.
/**
* get Current Language Expression.
*
* @param tempViewValidRowsExpList
* @param language
* @param version
*/
public TdExpression getCurrentLanguageExp(List<TdExpression> tempViewValidRowsExpList, String language, String version) {
if (tempViewValidRowsExpList != null) {
for (TdExpression tdExp : tempViewValidRowsExpList) {
if (UDIUtils.isCurrentLanguageAndVersion(tdExp, language, version)) {
return tdExp;
}
}
}
TdExpression createTdExpression = BooleanExpressionHelper.createTdExpression(language, PluginConstant.EMPTY_STRING, version);
createTdExpression.setModificationDate(UDIUtils.getCurrentDateTime());
return createTdExpression;
}
use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method createNewLine.
/**
* DOC bZhou Comment method "creatNewLine". MOD mzhao feature 11128 Be able to add Java UDI, 2010-01-27
*
* @param expression
*/
private void createNewLine() {
if (dataBaseTitleComp == null || dataBaseTitleComp.isDisposed()) {
createDatabaseTitleComp();
}
final Composite lineComp = new Composite(dataBaseComp, SWT.NONE);
lineComp.setLayout(new GridLayout(5, false));
final CCombo combo = new CCombo(lineComp, SWT.BORDER);
combo.setLayoutData(new GridData());
((GridData) combo.getLayoutData()).widthHint = 150;
combo.setEditable(false);
// MOD xqliu 2010-02-25 feature 11201
combo.setItems(allDBTypeList.toArray(new String[allDBTypeList.size()]));
// ~
combo.select(0);
combo.addSelectionListener(new LangCombSelectionListener());
// MOD TDQ-6824 msjian 2013-2-8: when create expression, we should set correct language
TdExpression expression = BooleanExpressionHelper.createTdExpression(PatternLanguageType.findLanguageByName(combo.getText()), null);
// TDQ-6824~
String oldLanguage = expression.getLanguage();
expression.setModificationDate(UDIUtils.getCurrentDateTime());
removeDisposedComboFromTempExpMap();
putTdExpressToTempMap(combo, expression);
updateLineAndOtherCombos(combo, expression, oldLanguage);
}
use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.
the class IndicatorDefinitionMaterPage method updateDateExpression.
private void updateDateExpression() {
EList<TdExpression> date1argFunctions = getCurrentModelElement().getDate1argFunctions();
date1argFunctions.clear();
for (AggregateDateExpression ade : afExpressionMapTemp.values()) {
TdExpression expression = ade.getDateExpression();
if (expression.getBody() != null && !PluginConstant.EMPTY_STRING.equals(expression.getBody())) {
date1argFunctions.add(expression);
}
}
}
use of org.talend.cwm.relational.TdExpression in project tdq-studio-se by Talend.
the class UDIMasterPage method saveUDIExpression.
/**
* save UDI Expressions.
*/
private void saveUDIExpression() {
UDIndicatorDefinition def = (UDIndicatorDefinition) getCurrentModelElement();
EList<TdExpression> viewValidRowsExpression = def.getViewValidRowsExpression();
viewValidRowsExpression.clear();
viewValidRowsExpression = saveFromTempMapToDefinition(viewValidRowsExpression, tempViewValidRowsExpressionMap);
EList<TdExpression> viewInvalidRowsExpression = def.getViewInvalidRowsExpression();
viewInvalidRowsExpression.clear();
viewInvalidRowsExpression = saveFromTempMapToDefinition(viewInvalidRowsExpression, tempViewInvalidRowsExpressionMap);
EList<TdExpression> viewValidValuesExpression = def.getViewValidValuesExpression();
viewValidValuesExpression.clear();
viewValidValuesExpression = saveFromTempMapToDefinition(viewValidValuesExpression, tempViewValidValuesExpressionMap);
EList<TdExpression> viewInvalidValuesExpression = def.getViewInvalidValuesExpression();
viewInvalidValuesExpression.clear();
viewInvalidValuesExpression = saveFromTempMapToDefinition(viewInvalidValuesExpression, tempViewInvalidValuesExpressionMap);
EList<TdExpression> viewRowsExpression = def.getViewRowsExpression();
viewRowsExpression.clear();
viewRowsExpression = saveFromTempMapToDefinition(viewRowsExpression, tempViewRowsExpressionMap);
if (category != null) {
UDIHelper.setUDICategory(getCurrentModelElement(), category);
}
}
Aggregations