Search in sources :

Example 16 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method getDqRules.

/**
 * ADD gdbu 2011-6-1 bug : 19833
 *
 * DOC gdbu Comment method "getDqRules". Get all DQRule from analysis.
 *
 * @param analysis
 * @return
 */
public List<DQRule> getDqRules(Analysis analysis) {
    List<DQRule> result = new ArrayList<DQRule>();
    EList<Indicator> indicators = analysis.getResults().getIndicators();
    for (Indicator indicator : indicators) {
        IndicatorDefinition indicatorDefinition = indicator.getIndicatorDefinition();
        if (indicatorDefinition instanceof DQRule) {
            result.add((DQRule) indicatorDefinition);
        }
    }
    return result;
}
Also used : ArrayList(java.util.ArrayList) IndicatorDefinition(org.talend.dataquality.indicators.definition.IndicatorDefinition) Indicator(org.talend.dataquality.indicators.Indicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) DQRule(org.talend.dataquality.rules.DQRule)

Example 17 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class AbstractAnalysisResultPageWithChart method createMenuForAllDataEntity.

protected Map<String, Object> createMenuForAllDataEntity(Shell shell, DataExplorer dataExplorer, Analysis analysis, ChartDataEntity[] chartDataEntities) {
    Map<String, Object> menuMap = new HashMap<String, Object>();
    if (!analysis.getParameters().isStoreData()) {
        return menuMap;
    }
    for (ChartDataEntity oneDataEntity : chartDataEntities) {
        Indicator indicator = oneDataEntity.getIndicator();
        Menu menu = createMenu(shell, dataExplorer, analysis, oneDataEntity, getEditorName(indicator));
        ChartTableFactory.addJobGenerationMenu(menu, analysis, indicator);
        menuMap.put(oneDataEntity.getLabel(), menu);
    }
    return menuMap;
}
Also used : HashMap(java.util.HashMap) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) Menu(org.eclipse.swt.widgets.Menu) Indicator(org.talend.dataquality.indicators.Indicator)

Example 18 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class TableIndicator method createTableIndicatorWithRowCountIndicator.

/**
 * DOC xqliu Comment method "createTableIndicatorWithRowCountIndicator".
 *
 * @param table
 * @return
 */
public static TableIndicator createTableIndicatorWithRowCountIndicator(NamedColumnSet set) {
    TableIndicator tableIndicator = new TableIndicator(set);
    RowCountIndicator createIndicator = IndicatorsFactory.eINSTANCE.createRowCountIndicator();
    DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createIndicator);
    createIndicator.setAnalyzedElement(set);
    Indicator[] indicators = new Indicator[] { createIndicator };
    tableIndicator.setIndicators(indicators);
    return tableIndicator;
}
Also used : RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) Indicator(org.talend.dataquality.indicators.Indicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator)

Example 19 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class TableIndicator method setIndicators.

public void setIndicators(Indicator[] indicators) {
    this.clear();
    for (Indicator oneIndicator : indicators) {
        IndicatorEnum findIndicatorEnum = IndicatorEnum.findIndicatorEnum(oneIndicator.eClass());
        if (IndicatorEnum.isPlainIndicatorEnum(findIndicatorEnum)) {
            this.indicatorEnumList.add(findIndicatorEnum);
            createIndicatorUnit(findIndicatorEnum, oneIndicator);
        } else {
            this.addSpecialIndicator(findIndicatorEnum, oneIndicator);
        }
    }
    processIndicator();
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) Indicator(org.talend.dataquality.indicators.Indicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator)

Example 20 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class ModelElementIndicatorImpl method setIndicators.

// MOD klliu 2010-06-03 init Indicators of the gate
public void setIndicators(Indicator[] indicators) {
    clear();
    for (Indicator oneIndicator : indicators) {
        IndicatorEnum findIndicatorEnum = IndicatorEnum.findIndicatorEnum(oneIndicator.eClass());
        if (findIndicatorEnum == null) {
            // $NON-NLS-1$ //$NON-NLS-2$
            log.error("enum not found for indicator: " + oneIndicator.getName() + " of type " + oneIndicator.getClass());
            continue;
        }
        if (IndicatorEnum.isPlainIndicatorEnum(findIndicatorEnum)) {
            this.flatIndicatorEnumList.add(findIndicatorEnum);
            fillCategoryIndicators(findIndicatorEnum, oneIndicator);
        } else {
            this.addSpecialIndicator(findIndicatorEnum, oneIndicator);
        }
    }
    processCategoryIndicator();
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) UniqueCountIndicator(org.talend.dataquality.indicators.UniqueCountIndicator) AvgLengthWithBlankIndicator(org.talend.dataquality.indicators.AvgLengthWithBlankIndicator) FrequencyIndicator(org.talend.dataquality.indicators.FrequencyIndicator) MaxValueIndicator(org.talend.dataquality.indicators.MaxValueIndicator) MaxLengthWithBlankNullIndicator(org.talend.dataquality.indicators.MaxLengthWithBlankNullIndicator) ValidRegCodeCountIndicator(org.talend.dataquality.indicators.ValidRegCodeCountIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) AvgLengthWithBlankNullIndicator(org.talend.dataquality.indicators.AvgLengthWithBlankNullIndicator) MinLengthIndicator(org.talend.dataquality.indicators.MinLengthIndicator) MinValueIndicator(org.talend.dataquality.indicators.MinValueIndicator) LowerQuartileIndicator(org.talend.dataquality.indicators.LowerQuartileIndicator) AverageLengthIndicator(org.talend.dataquality.indicators.AverageLengthIndicator) MaxLengthWithBlankIndicator(org.talend.dataquality.indicators.MaxLengthWithBlankIndicator) MeanIndicator(org.talend.dataquality.indicators.MeanIndicator) DefValueCountIndicator(org.talend.dataquality.indicators.DefValueCountIndicator) WellFormE164PhoneCountIndicator(org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) AvgLengthWithNullIndicator(org.talend.dataquality.indicators.AvgLengthWithNullIndicator) MaxLengthWithNullIndicator(org.talend.dataquality.indicators.MaxLengthWithNullIndicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) InvalidRegCodeCountIndicator(org.talend.dataquality.indicators.InvalidRegCodeCountIndicator) UpperQuartileIndicator(org.talend.dataquality.indicators.UpperQuartileIndicator) ValidPhoneCountIndicator(org.talend.dataquality.indicators.ValidPhoneCountIndicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) PossiblePhoneCountIndicator(org.talend.dataquality.indicators.PossiblePhoneCountIndicator) MaxLengthIndicator(org.talend.dataquality.indicators.MaxLengthIndicator) CountsIndicator(org.talend.dataquality.indicators.CountsIndicator) MinLengthWithBlankNullIndicator(org.talend.dataquality.indicators.MinLengthWithBlankNullIndicator) NullCountIndicator(org.talend.dataquality.indicators.NullCountIndicator) MedianIndicator(org.talend.dataquality.indicators.MedianIndicator) Indicator(org.talend.dataquality.indicators.Indicator) BlankCountIndicator(org.talend.dataquality.indicators.BlankCountIndicator) TextIndicator(org.talend.dataquality.indicators.TextIndicator) DistinctCountIndicator(org.talend.dataquality.indicators.DistinctCountIndicator) DuplicateCountIndicator(org.talend.dataquality.indicators.DuplicateCountIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator) MinLengthWithBlankIndicator(org.talend.dataquality.indicators.MinLengthWithBlankIndicator) MinLengthWithNullIndicator(org.talend.dataquality.indicators.MinLengthWithNullIndicator) BoxIndicator(org.talend.dataquality.indicators.BoxIndicator)

Aggregations

Indicator (org.talend.dataquality.indicators.Indicator)178 ArrayList (java.util.ArrayList)58 RowCountIndicator (org.talend.dataquality.indicators.RowCountIndicator)40 CompositeIndicator (org.talend.dataquality.indicators.CompositeIndicator)31 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)31 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)28 Analysis (org.talend.dataquality.analysis.Analysis)27 DuplicateCountIndicator (org.talend.dataquality.indicators.DuplicateCountIndicator)27 UniqueCountIndicator (org.talend.dataquality.indicators.UniqueCountIndicator)27 AllMatchIndicator (org.talend.dataquality.indicators.columnset.AllMatchIndicator)26 ReturnCode (org.talend.utils.sugars.ReturnCode)25 SimpleStatIndicator (org.talend.dataquality.indicators.columnset.SimpleStatIndicator)24 UserDefIndicator (org.talend.dataquality.indicators.sql.UserDefIndicator)24 PatternMatchingIndicator (org.talend.dataquality.indicators.PatternMatchingIndicator)23 DistinctCountIndicator (org.talend.dataquality.indicators.DistinctCountIndicator)22 NullCountIndicator (org.talend.dataquality.indicators.NullCountIndicator)22 TdColumn (org.talend.cwm.relational.TdColumn)20 WhereRuleIndicator (org.talend.dataquality.indicators.sql.WhereRuleIndicator)18 FrequencyIndicator (org.talend.dataquality.indicators.FrequencyIndicator)17 Test (org.junit.Test)16