Search in sources :

Example 1 with DateParameters

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

the class ModelElementIndicatorImpl method createPlainIndicatorUnit.

/**
 * Create a new IndicatorUnit according to indicatorEnum and indicator, if the parameter indicator is null, will
 * create a new indicator .
 *
 * @param indicatorEnum
 * @param indicator
 * @return
 */
private IndicatorUnit createPlainIndicatorUnit(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("Could not set the definition of the given indicator :" + tempIndicator.getName());
        }
        // for 4225, the frequency indicator need be initialized
        int sqlType = getJavaType();
        if (tempIndicator instanceof FrequencyIndicator && Java2SqlType.isDateInSQL(sqlType)) {
            IndicatorParameters parameters = tempIndicator.getParameters();
            if (parameters == null) {
                parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
                tempIndicator.setParameters(parameters);
            }
            DateParameters dateParameters = parameters.getDateParameters();
            // "Year Frequency Table" when applying on "Time" type
            if (dateParameters == null && !(indicatorEnum == IndicatorEnum.PatternFreqIndicatorEnum || indicatorEnum == IndicatorEnum.PatternLowFreqIndicatorEnum || indicatorEnum == IndicatorEnum.FrequencyIndicatorEnum || indicatorEnum == IndicatorEnum.LowFrequencyIndicatorEnum)) {
                dateParameters = IndicatorsFactory.eINSTANCE.createDateParameters();
                parameters.setDateParameters(dateParameters);
            }
        // TDQ-5357~
        // MOD scorreia 2008-06-19 default is already set in the model
        // dateParameters.setDateAggregationType(DateGrain.YEAR);
        }
    }
    IndicatorUnit indicatorUnit = new ColumnIndicatorUnit(indicatorEnum, tempIndicator, this);
    this.plainIndicatorUnitMap.put(indicatorEnum, indicatorUnit);
    return indicatorUnit;
}
Also used : EFactoryImpl(org.eclipse.emf.ecore.impl.EFactoryImpl) IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters) IndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit) ColumnIndicatorUnit(org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit) DateParameters(org.talend.dataquality.indicators.DateParameters) 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) FrequencyIndicator(org.talend.dataquality.indicators.FrequencyIndicator)

Example 2 with DateParameters

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

the class DateFrequencyIndicatorImpl method getParameters.

@Override
public IndicatorParameters getParameters() {
    IndicatorParameters parameters = super.getParameters();
    if (parameters == null) {
        parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    }
    DateParameters dateParameters = parameters.getDateParameters();
    if (dateParameters == null) {
        dateParameters = IndicatorsFactory.eINSTANCE.createDateParameters();
    }
    dateParameters.setDateAggregationType(DateGrain.DAY);
    parameters.setDateParameters(dateParameters);
    this.setParameters(parameters);
    return parameters;
}
Also used : IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters) DateParameters(org.talend.dataquality.indicators.DateParameters)

Example 3 with DateParameters

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

the class WeekFrequencyIndicatorImpl method getParameters.

@Override
public IndicatorParameters getParameters() {
    IndicatorParameters parameters = super.getParameters();
    if (parameters == null) {
        parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    }
    DateParameters dateParameters = parameters.getDateParameters();
    if (dateParameters == null) {
        dateParameters = IndicatorsFactory.eINSTANCE.createDateParameters();
    }
    dateParameters.setDateAggregationType(DateGrain.WEEK);
    parameters.setDateParameters(dateParameters);
    this.setParameters(parameters);
    return parameters;
}
Also used : IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters) DateParameters(org.talend.dataquality.indicators.DateParameters)

Example 4 with DateParameters

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

the class QuarterLowFrequencyIndicatorImpl method getParameters.

@Override
public IndicatorParameters getParameters() {
    IndicatorParameters parameters = super.getParameters();
    if (parameters == null) {
        parameters = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
    }
    DateParameters dateParameters = parameters.getDateParameters();
    if (dateParameters == null) {
        dateParameters = IndicatorsFactory.eINSTANCE.createDateParameters();
    }
    dateParameters.setDateAggregationType(DateGrain.QUARTER);
    parameters.setDateParameters(dateParameters);
    this.setParameters(parameters);
    return parameters;
}
Also used : IndicatorParameters(org.talend.dataquality.indicators.IndicatorParameters) DateParameters(org.talend.dataquality.indicators.DateParameters)

Example 5 with DateParameters

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

the class IndicatorParametersImpl method basicSetDateParameters.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 *
 * @generated
 */
public NotificationChain basicSetDateParameters(DateParameters newDateParameters, NotificationChain msgs) {
    DateParameters oldDateParameters = dateParameters;
    dateParameters = newDateParameters;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, IndicatorsPackage.INDICATOR_PARAMETERS__DATE_PARAMETERS, oldDateParameters, newDateParameters);
        if (msgs == null) {
            msgs = notification;
        } else {
            msgs.add(notification);
        }
    }
    return msgs;
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DateParameters(org.talend.dataquality.indicators.DateParameters)

Aggregations

DateParameters (org.talend.dataquality.indicators.DateParameters)17 IndicatorParameters (org.talend.dataquality.indicators.IndicatorParameters)15 Domain (org.talend.dataquality.domain.Domain)4 DateGrain (org.talend.dataquality.indicators.DateGrain)3 FrequencyIndicator (org.talend.dataquality.indicators.FrequencyIndicator)3 TdColumn (org.talend.cwm.relational.TdColumn)2 TextParameters (org.talend.dataquality.indicators.TextParameters)2 IndicatorDefinition (org.talend.dataquality.indicators.definition.IndicatorDefinition)2 ArrayList (java.util.ArrayList)1 EClass (org.eclipse.emf.ecore.EClass)1 EFactoryImpl (org.eclipse.emf.ecore.impl.EFactoryImpl)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 TdExpression (org.talend.cwm.relational.TdExpression)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 ColumnIndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.ColumnIndicatorUnit)1 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)1 RangeRestriction (org.talend.dataquality.domain.RangeRestriction)1 AverageLengthIndicator (org.talend.dataquality.indicators.AverageLengthIndicator)1 AvgLengthWithBlankIndicator (org.talend.dataquality.indicators.AvgLengthWithBlankIndicator)1 AvgLengthWithBlankNullIndicator (org.talend.dataquality.indicators.AvgLengthWithBlankNullIndicator)1