use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class IndicatorSelectDialog method updateIndicatorInfo.
public void updateIndicatorInfo(GridItem item) {
// $NON-NLS-1$
String DESCRIPTION = DefaultMessagesImpl.getString("IndicatorSelectDialog.description");
// $NON-NLS-1$
String PURPOSE = DefaultMessagesImpl.getString("IndicatorSelectDialog.purpose");
IIndicatorNode indicatorNode = ((IIndicatorNode) item.getData());
if (indicatorNode != null) {
Indicator indicator = indicatorNode.getIndicatorInstance();
if (indicator != null) {
IndicatorDefinition indicatorDefinition = indicator.getIndicatorDefinition();
if ("".equals(MetadataHelper.getPurpose(indicatorDefinition))) {
purposeLabel.setText(PURPOSE + " " + indicator.getName());
} else {
purposeLabel.setText(PURPOSE + " " + MetadataHelper.getPurpose(indicatorDefinition));
}
String description = DESCRIPTION + " " + MetadataHelper.getDescription(indicatorDefinition);
descriptionLabel.setText(description);
return;
}
}
purposeLabel.setText(PURPOSE + " " + item.getText());
descriptionLabel.setText(DESCRIPTION + " " + item.getText());
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class IndicatorSelectDialog method isMatchCurrentIndicator.
public boolean isMatchCurrentIndicator(ModelElementIndicator currentIndicator, IIndicatorNode indicatorNode) {
boolean returnValueForCurrentIndicator = true;
IIndicatorNode parentNode = indicatorNode.getParent();
boolean isParentPhoneStatistics = parentNode != null && parentNode.getIndicatorInstance() != null && parentNode.getIndicatorInstance() instanceof PhoneNumbStatisticsIndicator;
if (!ModelElementIndicatorRule.match(indicatorNode, currentIndicator, this.language)) {
returnValueForCurrentIndicator = false;
}
Indicator indicatorInstance = indicatorNode.getIndicatorInstance();
if (null != indicatorInstance && !(indicatorInstance instanceof DatePatternFreqIndicator) && null != indicatorInstance.getIndicatorDefinition() && indicatorInstance.getIndicatorDefinition().getSqlGenericExpression().size() < 1 && ExecutionLanguage.SQL.equals(language) && !UDIHelper.isJavaUDI(indicatorInstance) && !indicatorNode.hasChildren() && !(currentIndicator instanceof DelimitedFileIndicator) && !isParentPhoneStatistics) {
returnValueForCurrentIndicator = false;
}
return returnValueForCurrentIndicator;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class DQRuleUtilities method createIndicatorUnit.
/**
* DOC xqliu Comment method "createIndicatorUnit".
*
* @param fe
* @param tableIndicator
* @param analysis
* @return
*/
public static TableIndicatorUnit createIndicatorUnit(RuleRepNode ruleRepNode, TableIndicator tableIndicator, Analysis analysis) {
IndicatorDefinition whereRule = ruleRepNode.getRule();
for (Indicator indicator : tableIndicator.getIndicators()) {
if (whereRule.getName().equals(indicator.getName())) {
return null;
}
}
WhereRuleIndicator[] compositeWhereRuleIndicator = createCompositeWhereRuleIndicator(tableIndicator.getColumnSet(), whereRule);
IndicatorEnum type = IndicatorEnum.findIndicatorEnum(compositeWhereRuleIndicator[0].eClass());
TableIndicatorUnit addIndicatorUnit = tableIndicator.addSpecialIndicator(whereRule, type, compositeWhereRuleIndicator[0]);
DependenciesHandler.getInstance().setUsageDependencyOn(analysis, whereRule);
return addIndicatorUnit;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class PatternNode method createNewIndicatorInstance.
/*
* (non-Javadoc)
*
* @see org.talend.dq.nodes.indicator.IIndicatorNode#createNewIndicatorInstance()
*/
@Override
public Indicator createNewIndicatorInstance() {
Indicator patternIndicatorInstance = super.createNewIndicatorInstance();
IndicatorParameters createIndicatorParameter = IndicatorsFactory.eINSTANCE.createIndicatorParameters();
Domain createDomain = DomainFactory.eINSTANCE.createDomain();
createDomain.getPatterns().add(pattern);
createIndicatorParameter.setDataValidDomain(createDomain);
patternIndicatorInstance.setParameters(createIndicatorParameter);
return patternIndicatorInstance;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class AbstractNode method createNewIndicatorInstance.
/*
* (non-Javadoc)
*
* @see org.talend.dq.nodes.indicator.IIndicatorNode#createNewIndicatorInstance()
*/
public Indicator createNewIndicatorInstance() {
EFactoryImpl factory = (EFactoryImpl) indicatorEnum.getIndicatorType().getEPackage().getEFactoryInstance();
Indicator indicatorInstance = (Indicator) factory.create(indicatorEnum.getIndicatorType());
// special Enum is can not handle the name of indicator
if (indicatorInstance.getName() == indicatorInstance.eClass().getName() && IndicatorEnum.isSpecialIndicatorEnum(indicatorEnum)) {
indicatorInstance.setName(this.getLabel());
}
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicatorInstance);
return indicatorInstance;
}
Aggregations