Search in sources :

Example 46 with TdExpression

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);
        }
    }
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression)

Example 47 with TdExpression

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;
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression)

Example 48 with TdExpression

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);
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) CCombo(org.eclipse.swt.custom.CCombo) Composite(org.eclipse.swt.widgets.Composite) TdExpression(org.talend.cwm.relational.TdExpression) GridData(org.eclipse.swt.layout.GridData)

Example 49 with TdExpression

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);
        }
    }
}
Also used : TdExpression(org.talend.cwm.relational.TdExpression)

Example 50 with TdExpression

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);
    }
}
Also used : UDIndicatorDefinition(org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition) TdExpression(org.talend.cwm.relational.TdExpression)

Aggregations

TdExpression (org.talend.cwm.relational.TdExpression)121 Test (org.junit.Test)51 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)30 UDIndicatorDefinition (org.talend.dataquality.indicators.definition.userdefine.UDIndicatorDefinition)29 ArrayList (java.util.ArrayList)19 RegularExpression (org.talend.dataquality.domain.pattern.RegularExpression)19 Pattern (org.talend.dataquality.domain.pattern.Pattern)16 TdColumn (org.talend.cwm.relational.TdColumn)12 Expression (orgomg.cwm.objectmodel.core.Expression)12 BasicEList (org.eclipse.emf.common.util.BasicEList)11 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)11 Domain (org.talend.dataquality.domain.Domain)10 TdTable (org.talend.cwm.relational.TdTable)9 ProductVersion (org.talend.utils.ProductVersion)9 Analysis (org.talend.dataquality.analysis.Analysis)8 PatternComponent (org.talend.dataquality.domain.pattern.PatternComponent)8 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)8 File (java.io.File)7 IFile (org.eclipse.core.resources.IFile)6 IFolder (org.eclipse.core.resources.IFolder)6