Search in sources :

Example 51 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class SummaryStatisticsState method getCustomerDataset.

public ICustomerDataset getCustomerDataset() {
    Map<IndicatorEnum, Double> map = new HashMap<IndicatorEnum, Double>();
    CustomerDefaultCategoryDataset customerdataset = new CustomerDefaultCategoryDataset();
    for (IndicatorUnit unit : units) {
        // MOD xqliu 2009-06-29 bug 7068
        String value = null;
        if (indicators2ValueMap.containsKey(unit)) {
            value = indicators2ValueMap.get(unit);
        } else {
            value = summaryUtil.getUnitValue(unit);
        }
        if (Java2SqlType.isNumbericInSQL(sqltype)) {
            try {
                map.put(unit.getType(), Double.parseDouble(value));
            } catch (Exception e) {
                log.error(e.getMessage(), e);
            }
        }
        ChartDataEntity entity = summaryUtil.createDataEntity(unit, value);
        customerdataset.addDataEntity(entity);
    }
    if (isIntact() && !isSupportDynamicChart) {
        CustomerDefaultBAWDataset dataset = new CustomerDefaultBAWDataset(map.get(IndicatorEnum.MeanIndicatorEnum), map.get(IndicatorEnum.MedianIndicatorEnum), map.get(IndicatorEnum.LowerQuartileIndicatorEnum), map.get(IndicatorEnum.UpperQuartileIndicatorEnum), map.get(IndicatorEnum.MinValueIndicatorEnum), map.get(IndicatorEnum.MaxValueIndicatorEnum), customerdataset);
        dataset.addDataEntity(customerdataset.getDataEntities());
        return dataset;
    } else {
        // MOD hcheng,Range indicator value should not appear in bar chart
        if (!isIntact()) {
            map.remove(IndicatorEnum.RangeIndicatorEnum);
            map.remove(IndicatorEnum.IQRIndicatorEnum);
        }
        for (IndicatorEnum indicatorEnum : map.keySet()) {
            customerdataset.addValue(map.get(indicatorEnum), indicatorEnum.getLabel(), indicatorEnum.getLabel());
        }
        return customerdataset;
    }
}
Also used : IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) HashMap(java.util.HashMap) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ChartDataEntity(org.talend.dq.indicators.preview.table.ChartDataEntity) CustomerDefaultCategoryDataset(org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset) CustomerDefaultBAWDataset(org.talend.dataprofiler.core.ui.editor.preview.model.dataset.CustomerDefaultBAWDataset)

Example 52 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class PatternLabelProvider method createIndicatorUnit.

/**
 * DOC xqliu Comment method "createIndicatorUnit".
 *
 * @param pfile
 * @param modelElementIndicator
 * @param analysis
 * @param indicatorDefinition
 * @return
 */
public static TypedReturnCode<IndicatorUnit> createIndicatorUnit(Pattern pattern, ModelElementIndicator modelElementIndicator, Analysis analysis, IndicatorDefinition indicatorDefinition) {
    TypedReturnCode<IndicatorUnit> result = new TypedReturnCode<IndicatorUnit>();
    for (Indicator indicator : modelElementIndicator.getIndicators()) {
        // MOD xwang 2011-08-01 bug TDQ-2730
        if (UDIHelper.getMatchingIndicatorName(indicatorDefinition, pattern).equals(indicator.getName()) && indicator instanceof PatternMatchingIndicator) {
            result.setOk(false);
            // $NON-NLS-1$
            result.setMessage(DefaultMessagesImpl.getString("PatternUtilities.Selected"));
            return result;
        }
    // ~
    }
    // MOD scorreia 2009-01-06: when expression type is not set (version
    // TOP-1.1.x), then it's supposed to be a
    // regexp pattern. This could be false because expression type was not
    // set into SQL pattern neither in TOP-1.1.
    // This means that there could exist the need for a migration task to
    // set the expression type depending on the
    // folder where the pattern is stored. The method
    // DomainHelper.getExpressionType(pattern) tries to find the type
    // of pattern.
    Indicator patternMatchingIndicator = null;
    String expressionType = DomainHelper.getExpressionType(pattern);
    boolean isSQLPattern = (ExpressionType.SQL_LIKE.getLiteral().equals(expressionType));
    if (indicatorDefinition != null) {
        patternMatchingIndicator = UDIFactory.createUserDefIndicator(indicatorDefinition, pattern);
    } else {
        patternMatchingIndicator = isSQLPattern ? PatternIndicatorFactory.createSqlPatternMatchingIndicator(pattern) : PatternIndicatorFactory.createRegexpMatchingIndicator(pattern);
    }
    IEditorPart theEdit = CorePlugin.getDefault().getCurrentActiveEditor();
    if (theEdit != null && theEdit instanceof AnalysisEditor && analysis.getContext().getConnection() == null) {
        theEdit.doSave(null);
    }
    ExecutionLanguage executionLanguage = analysis.getParameters().getExecutionLanguage();
    DbmsLanguage dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage(analysis);
    if (dbmsLanguage.isSql()) {
        // $NON-NLS-1$
        MessageUI.openWarning(DefaultMessagesImpl.getString("PatternUtilities.ConnectionError"));
        result.setOk(false);
        return result;
    }
    boolean isJavaEngin = ExecutionLanguage.JAVA.equals(executionLanguage);
    Expression returnExpression = dbmsLanguage.getRegexp(pattern);
    // MOD gdbu 2011-8-26 bug : TDQ-2169
    if ((ExpressionType.REGEXP.getLiteral().equals(expressionType) || ExpressionType.SQL_LIKE.getLiteral().equals(expressionType)) && returnExpression == null) {
        // ~TDQ-2169
        String executeType = isJavaEngin ? executionLanguage.getName() : dbmsLanguage.getDbmsName();
        boolean openPattern = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("PatternUtilities.Warning"), // $NON-NLS-1$ //$NON-NLS-2$
        DefaultMessagesImpl.getString("PatternUtilities.NoExpression", executeType, pattern.getName()));
        if (openPattern) {
            RepositoryNode node = RepositoryNodeHelper.recursiveFind(pattern);
            if (RepositoryNodeHelper.canOpenEditor(node)) {
                new OpenItemEditorAction(new IRepositoryNode[] { node }).run();
            }
        }
        result.setOk(false);
        return result;
    }
    // a regular expression for the analyzed
    // database, but we probably test also whether the analyzed database
    // support the regular expressions (=> check
    // DB type, DB number version, existence of UDF)
    DataManager dm = analysis.getContext().getConnection();
    if (dm != null) {
        TypedReturnCode<java.sql.Connection> trc = JavaSqlFactory.createConnection((Connection) dm);
        // MOD qiongli 2011-1-10 feature 16796
        boolean isDelimitedFileConnection = ConnectionUtils.isDelimitedFileConnection((DataProvider) dm);
        if (trc != null) {
            // SoftwareSystem softwareSystem = DatabaseContentRetriever.getSoftwareSystem(conn);
            // MOD sizhaoliu TDQ-6316
            dbmsLanguage = DbmsLanguageFactory.createDbmsLanguage(dm);
        }
        // MOD xqliu 2010-08-12 bug 14601
        if (!(isSQLPattern || DefinitionHandler.getInstance().canRunRegularExpressionMatchingIndicator(dbmsLanguage, isJavaEngin, pattern) || isDelimitedFileConnection)) {
            // MessageDialogWithToggle.openInformation(null,
            // DefaultMessagesImpl.getString("PatternUtilities.Pattern"), DefaultMessagesImpl //$NON-NLS-1$
            // .getString("PatternUtilities.couldnotSetIndicator")); //$NON-NLS-1$
            result.setOk(false);
            // $NON-NLS-1$
            result.setMessage(DefaultMessagesImpl.getString("PatternUtilities.couldnotSetIndicator"));
            return result;
        }
    // ~ 14601
    }
    // when the indicator is created.
    if (indicatorDefinition == null) {
        if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(patternMatchingIndicator)) {
            // $NON-NLS-1$
            log.error(DefaultMessagesImpl.getString("PatternUtilities.SetFailed", patternMatchingIndicator.getName()));
        }
    } else {
        patternMatchingIndicator.setIndicatorDefinition(indicatorDefinition);
    }
    IndicatorEnum type = IndicatorEnum.findIndicatorEnum(patternMatchingIndicator.eClass());
    IndicatorUnit addIndicatorUnit = modelElementIndicator.addSpecialIndicator(type, patternMatchingIndicator);
    DependenciesHandler.getInstance().setUsageDependencyOn(analysis, pattern);
    result.setOk(true);
    // $NON-NLS-1$
    result.setMessage(DefaultMessagesImpl.getString("PatternUtilities.OK"));
    result.setObject(addIndicatorUnit);
    return result;
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) Connection(org.talend.core.model.metadata.builder.connection.Connection) ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage) DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager) IEditorPart(org.eclipse.ui.IEditorPart) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) OpenItemEditorAction(org.talend.dataprofiler.core.ui.action.actions.OpenItemEditorAction) ColumnIndicator(org.talend.dataprofiler.core.model.ColumnIndicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) PatternMatchingIndicator(org.talend.dataquality.indicators.PatternMatchingIndicator) Indicator(org.talend.dataquality.indicators.Indicator) DbmsLanguage(org.talend.dq.dbms.DbmsLanguage) PatternMatchingIndicator(org.talend.dataquality.indicators.PatternMatchingIndicator) Expression(orgomg.cwm.objectmodel.core.Expression) TypedReturnCode(org.talend.utils.sugars.TypedReturnCode) AnalysisEditor(org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor)

Example 53 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class ModelElementIndicatorImpl method createSpecialIndicatorUnit.

private IndicatorUnit createSpecialIndicatorUnit(IndicatorEnum indicatorEnum, Indicator indicator) {
    Indicator tempIndicator = indicator;
    if (tempIndicator == null) {
        EFactoryImpl factory = (EFactoryImpl) indicatorEnum.getIndicatorType().getEPackage().getEFactoryInstance();
        tempIndicator = (Indicator) factory.create(indicatorEnum.getIndicatorType());
        // MOD scorreia 2008-09-18: bug 5131 fixed: set indicator's definition when the indicator is created.
        if (!DefinitionHandler.getInstance().setDefaultIndicatorDefinition(tempIndicator)) {
            // $NON-NLS-1$
            log.error(DefaultMessagesImpl.getString("ModelElementIndicatorImpl_COULDNOTSETDEF_GIVEN_IND0") + tempIndicator.getName());
        }
    }
    // }
    if (this.specialIndicatorUnitList == null) {
        this.specialIndicatorUnitList = new ArrayList<IndicatorUnit>();
    }
    IndicatorUnit indicatorUnit = new ColumnIndicatorUnit(indicatorEnum, tempIndicator, this);
    specialIndicatorUnitList.add(indicatorUnit);
    this.specialIndicatorUnitMap.put(tempIndicator.getName(), indicatorUnit);
    return indicatorUnit;
}
Also used : EFactoryImpl(org.eclipse.emf.ecore.impl.EFactoryImpl) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) 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)

Example 54 with IndicatorUnit

use of org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit in project tdq-studio-se by Talend.

the class ModelElementIndicatorImpl method createCategoryIndicatorUnits.

/**
 * create indicatorMappings according category indicatorEnum.
 *
 * @param categoryEnums
 * @return
 */
private IndicatorUnit[] createCategoryIndicatorUnits(IndicatorEnum[] categoryEnums) {
    List<IndicatorUnit> indicatorUnitList = new ArrayList<IndicatorUnit>();
    IndicatorUnit indicatorUnit;
    for (IndicatorEnum categoryEnum : categoryEnums) {
        if (null == categoryEnum) {
            continue;
        }
        if (!IndicatorEnum.isPlainIndicatorEnum(categoryEnum)) {
            // tempSpecialIndicatorEnumList.add(categoryEnum);
            continue;
        }
        indicatorUnit = getPlainIndicatorUnit(categoryEnum);
        switch(categoryEnum) {
            case CountsIndicatorEnum:
                CountsIndicator countsIndicator = (CountsIndicator) indicatorUnit.getIndicator();
                countsIndicator.setBlankCountIndicator((BlankCountIndicator) getPlainIndicatorUnit(IndicatorEnum.BlankCountIndicatorEnum).getIndicator());
                countsIndicator.setDistinctCountIndicator((DistinctCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DistinctCountIndicatorEnum).getIndicator());
                countsIndicator.setDuplicateCountIndicator((DuplicateCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DuplicateCountIndicatorEnum).getIndicator());
                countsIndicator.setRowCountIndicator((RowCountIndicator) getPlainIndicatorUnit(IndicatorEnum.RowCountIndicatorEnum).getIndicator());
                countsIndicator.setNullCountIndicator((NullCountIndicator) getPlainIndicatorUnit(IndicatorEnum.NullCountIndicatorEnum).getIndicator());
                countsIndicator.setUniqueCountIndicator((UniqueCountIndicator) getPlainIndicatorUnit(IndicatorEnum.UniqueIndicatorEnum).getIndicator());
                // MOD klliu bug 13411 2010-06-03
                countsIndicator.setDefaultValueIndicator((DefValueCountIndicator) getPlainIndicatorUnit(IndicatorEnum.DefValueCountIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.CountsIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case TextIndicatorEnum:
                TextIndicator textIndicator = (TextIndicator) indicatorUnit.getIndicator();
                textIndicator.setMinLengthIndicator((MinLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthIndicator((MaxLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthIndicatorEnum).getIndicator());
                textIndicator.setAverageLengthIndicator((AverageLengthIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthIndicatorEnum).getIndicator());
                // MOD yyi 2010-08-05
                textIndicator.setAvgLengthWithBlankIndicator((AvgLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setAvgLengthWithNullIndicator((AvgLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setAvgLengthWithBlankNullIndicator((AvgLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.AverageLengthWithNullBlankIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithBlankIndicator((MinLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithNullIndicator((MinLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setMinLengthWithBlankNullIndicator((MinLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MinLengthWithBlankNullIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithBlankIndicator((MaxLengthWithBlankIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithNullIndicator((MaxLengthWithNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithNullIndicatorEnum).getIndicator());
                textIndicator.setMaxLengthWithBlankNullIndicator((MaxLengthWithBlankNullIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxLengthWithBlankNullIndicatorEnum).getIndicator());
                // ~
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.TextIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case BoxIIndicatorEnum:
                BoxIndicator boxtIndicator = (BoxIndicator) indicatorUnit.getIndicator();
                boxtIndicator.setRangeIndicator((RangeIndicator) getPlainIndicatorUnit(IndicatorEnum.RangeIndicatorEnum).getIndicator());
                boxtIndicator.setIQR((IQRIndicator) getPlainIndicatorUnit(IndicatorEnum.IQRIndicatorEnum).getIndicator());
                boxtIndicator.setMeanIndicator((MeanIndicator) getPlainIndicatorUnit(IndicatorEnum.MeanIndicatorEnum).getIndicator());
                boxtIndicator.setMedianIndicator((MedianIndicator) getPlainIndicatorUnit(IndicatorEnum.MedianIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.BoxIIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case IQRIndicatorEnum:
                IQRIndicator iqrIndicator = (IQRIndicator) indicatorUnit.getIndicator();
                iqrIndicator.setLowerValue((LowerQuartileIndicator) getPlainIndicatorUnit(IndicatorEnum.LowerQuartileIndicatorEnum).getIndicator());
                iqrIndicator.setUpperValue((UpperQuartileIndicator) getPlainIndicatorUnit(IndicatorEnum.UpperQuartileIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.IQRIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case RangeIndicatorEnum:
                RangeIndicator rangeIndicator = (RangeIndicator) indicatorUnit.getIndicator();
                rangeIndicator.setLowerValue((MinValueIndicator) getPlainIndicatorUnit(IndicatorEnum.MinValueIndicatorEnum).getIndicator());
                rangeIndicator.setUpperValue((MaxValueIndicator) getPlainIndicatorUnit(IndicatorEnum.MaxValueIndicatorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.RangeIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            case PhoneNumbStatisticsIndicatorEnum:
                PhoneNumbStatisticsIndicator phoneNumbIndicator = (PhoneNumbStatisticsIndicator) indicatorUnit.getIndicator();
                phoneNumbIndicator.setValidPhoneCountIndicator((ValidPhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.ValidPhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setPossiblePhoneCountIndicator((PossiblePhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.PossiblePhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setValidRegCodeCountIndicator((ValidRegCodeCountIndicator) getPlainIndicatorUnit(IndicatorEnum.ValidRegCodeCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setInvalidRegCodeCountIndicator((InvalidRegCodeCountIndicator) getPlainIndicatorUnit(IndicatorEnum.InvalidRegCodeCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormE164PhoneCountIndicator((WellFormE164PhoneCountIndicator) getPlainIndicatorUnit(IndicatorEnum.WellFormE164PhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormIntePhoneCountIndicator((WellFormIntePhoneCountIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.WellFormIntePhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setWellFormNationalPhoneCountIndicator((WellFormNationalPhoneCountIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.WellFormNationalPhoneCountIndicatorEnum).getIndicator());
                phoneNumbIndicator.setFormatFreqPieIndicator((FormatFreqPieIndicatorImpl) getPlainIndicatorUnit(IndicatorEnum.FormatFreqPieIndictorEnum).getIndicator());
                indicatorUnit.setChildren(createCategoryIndicatorUnits(IndicatorEnum.PhoneNumbStatisticsIndicatorEnum.getChildren()));
                indicatorUnitList.add(indicatorUnit);
                break;
            default:
                indicatorUnitList.add(indicatorUnit);
                break;
        }
    }
    return indicatorUnitList.toArray(new IndicatorUnit[indicatorUnitList.size()]);
}
Also used : BoxIndicator(org.talend.dataquality.indicators.BoxIndicator) TextIndicator(org.talend.dataquality.indicators.TextIndicator) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) CountsIndicator(org.talend.dataquality.indicators.CountsIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) ArrayList(java.util.ArrayList) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator)

Aggregations

IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)54 ArrayList (java.util.ArrayList)24 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)17 ChartDataEntity (org.talend.dq.indicators.preview.table.ChartDataEntity)17 ColumnIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)13 CustomerDefaultCategoryDataset (org.talend.dataprofiler.common.ui.editor.preview.CustomerDefaultCategoryDataset)10 TreeItem (org.eclipse.swt.widgets.TreeItem)9 Indicator (org.talend.dataquality.indicators.Indicator)9 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)7 FrequencyExt (org.talend.dq.indicators.ext.FrequencyExt)7 BoxIndicator (org.talend.dataquality.indicators.BoxIndicator)5 CountsIndicator (org.talend.dataquality.indicators.CountsIndicator)5 IQRIndicator (org.talend.dataquality.indicators.IQRIndicator)5 PhoneNumbStatisticsIndicator (org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator)5 IRepositoryNode (org.talend.repository.model.IRepositoryNode)5 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)4 ColumnSetIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnSetIndicatorUnit)4 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)4 IChartTypeStates (org.talend.dataprofiler.core.ui.editor.preview.model.states.IChartTypeStates)3 AverageLengthIndicator (org.talend.dataquality.indicators.AverageLengthIndicator)3