use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class CorrelationAnalysisDetailsPage method initializeIndicator.
private void initializeIndicator(Indicator indicator) {
if (indicator.getIndicatorDefinition() == null) {
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(indicator);
}
// MOD xqliu 2010-04-06 bug 12161
if (indicator instanceof CountAvgNullIndicator) {
if (((CountAvgNullIndicator) indicator).getChildIndicators().size() == 0) {
CountAvgNullIndicator countAvgNullIndicator = (CountAvgNullIndicator) indicator;
fillSimpleIndicators(countAvgNullIndicator);
}
for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
// recurse
initializeIndicator(child);
}
} else if (indicator instanceof CompositeIndicator) {
// MOD qiongli 2012-5-14 TDQ-5256 should initialize children
for (Indicator child : ((CompositeIndicator) indicator).getChildIndicators()) {
initializeIndicator(child);
}
}
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class FunctionalDependencyAnalysisDetailsPage method getColumnSet.
private List<RepositoryNode> getColumnSet(EReference reference) {
List<RepositoryNode> columns = new ArrayList<RepositoryNode>();
EList<Indicator> indicators = getCurrentModelElement().getResults().getIndicators();
for (Indicator indicator : indicators) {
TdColumn findColumn = (TdColumn) indicator.eGet(reference);
RepositoryNode recursiveFind = RepositoryNodeHelper.recursiveFind(findColumn);
if (recursiveFind == null) {
recursiveFind = RepositoryNodeHelper.createRepositoryNode(findColumn);
}
if (recursiveFind != null) {
columns.add(recursiveFind);
}
}
return columns;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class IndicatorPaginationInfo method createMenuForAllDataEntity.
/**
* DOC yyin Comment method "createMenuForAllDataEntity".
*
* @param shell
* @param dataExplorer
* @param analysis
* @param chartDataEntities
* @return
*/
protected Map<String, Object> createMenuForAllDataEntity(Composite composite, DataExplorer dataExplorer, Analysis analysis, ChartDataEntity[] chartDataEntities) {
Map<String, Object> menuMap = new HashMap<String, Object>();
final ExecutionLanguage currentEngine = analysis.getParameters().getExecutionLanguage();
// ADD msjian TDQ-7275 2013-5-21: when allow drill down is not checked, no menu display
if (ExecutionLanguage.JAVA == currentEngine && !analysis.getParameters().isStoreData()) {
return menuMap;
}
// TDQ-7275~
for (ChartDataEntity oneDataEntity : chartDataEntities) {
Indicator indicator = oneDataEntity.getIndicator();
Menu menu = TOPChartUtils.getInstance().createMenu(composite, dataExplorer, analysis, oneDataEntity, indicator, false);
ChartTableFactory.addJobGenerationMenu(menu, analysis, indicator);
menuMap.put(oneDataEntity.getLabel(), menu);
}
return menuMap;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class FunctionalDependencyAnalysisResultPage method initCustomerDataset.
/**
* DOC xqliu Comment method "initCustomerDataset".
*
* @return
*/
private CustomerDefaultCategoryDataset initCustomerDataset() {
CustomerDefaultCategoryDataset dataset = new CustomerDefaultCategoryDataset();
Analysis analysis = this.getAnalysisHandler().getAnalysis();
for (Indicator indicator2 : analysis.getResults().getIndicators()) {
ColumnDependencyIndicator indicator = (ColumnDependencyIndicator) indicator2;
String label = ColumnDependencyHelper.getIndicatorName(indicator);
if (getAnalysisHandler().getResultMetadata().getExecutionNumber() > 0) {
Long matchCount = indicator.getDistinctACount() == null ? 0 : indicator.getDistinctACount();
Long notMatchCount = indicator.getACount() == null ? 0 : indicator.getACount() - matchCount;
// $NON-NLS-1$
dataset.addValue(matchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.Match"), label);
// $NON-NLS-1$
dataset.addValue(notMatchCount, DefaultMessagesImpl.getString("ColumnDependencyResultPage.NotMatch"), label);
PatternChartDataEntity dataEntity = new PatternChartDataEntity();
dataEntity.setLabel(label);
dataEntity.setIndicator(indicator);
dataEntity.setNumMatch(matchCount.toString());
dataEntity.setNumNoMatch(notMatchCount.toString());
dataset.addDataEntity(dataEntity);
}
}
return dataset;
}
use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.
the class MasterPaginationInfo method createChart.
/**
* DOC bZhou Comment method "createChart".
*
* @param comp
* @param chartType
* @param units
*/
private void createChart(Composite comp, EIndicatorChartType chartType, List<IndicatorUnit> units) {
final IChartTypeStates chartTypeState = ChartTypeStatesFactory.getChartState(chartType, units);
boolean isPattern = chartTypeState instanceof PatternStatisticsState;
Object chart = null;
try {
// MOD TDQ-8787 20140722 yyin:(when first switch from master to result) if there is some dynamic event for
// the
// current indicator, use its dataset directly (TDQ-9241)
IEventReceiver event = EventManager.getInstance().findRegisteredEvent(units.get(0).getIndicator(), EventEnum.DQ_DYMANIC_CHART, 0);
if (event == null) {
chart = chartTypeState.getChart();
} else {
chart = chartTypeState.getChart(((DynamicChartEventReceiver) event).getDataset());
}
if (chart == null) {
return;
}
if (!isPattern) {
// need not to decorate the chart of Pattern(Regex/Sql/UdiMatch)
TOPChartUtils.getInstance().decorateChart(chart, false);
} else {
TOPChartUtils.getInstance().decoratePatternMatching(chart);
}
Object chartComp = TOPChartUtils.getInstance().createChartComposite(comp, SWT.NONE, chart, true);
addListenerToChartComp(chartComp, chartTypeState);
List<Indicator> indicators = getIndicators(units);
if (isSQLMode) {
// use the dynamic model for SQL mode only.
DynamicIndicatorModel dyModel = AnalysisUtils.createDynamicModel(chartType, indicators, chart);
if (EIndicatorChartType.SUMMARY_STATISTICS.equals(chartType)) {
if (units.size() == SummaryStatisticsState.FULL_FLAG) {
indicators = getIndicatorsForTable(units, false);
}
dyModel.setSummaryIndicators(indicators);
}
this.dynamicList.add(dyModel);
if (EIndicatorChartType.SUMMARY_STATISTICS.equals(chartType)) {
// for summary indicators: need to record the chart composite, which is used for create BAW chart
dyModel.setBawParentChartComp(chartComp);
}
}
} catch (Error e) {
// $NON-NLS-1$
log.error(DefaultMessagesImpl.getString("IndicatorPaginationInfo.FailToCreateChart"), e);
} catch (Exception exp) {
// $NON-NLS-1$
log.error(DefaultMessagesImpl.getString("IndicatorPaginationInfo.FailToCreateChart"), exp);
}
}
Aggregations