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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations