Search in sources :

Example 1 with ModelElementAnalysisHandler

use of org.talend.dq.analysis.ModelElementAnalysisHandler in project tdq-studio-se by Talend.

the class FunctionalDependencyAnalysisDetailsPage method initialize.

/*
     * (non-Javadoc)
     * 
     * @see
     * org.talend.dataprofiler.core.ui.editor.AbstractMetadataFormPage#initialize(org.eclipse.ui.forms.editor.FormEditor
     * )
     */
@Override
public void initialize(FormEditor editor) {
    super.initialize(editor);
    analysisHandler = new ModelElementAnalysisHandler();
    analysisHandler.setAnalysis(getCurrentModelElement());
    stringDataFilter = analysisHandler.getStringDataFilterwithContext();
}
Also used : ModelElementAnalysisHandler(org.talend.dq.analysis.ModelElementAnalysisHandler)

Example 2 with ModelElementAnalysisHandler

use of org.talend.dq.analysis.ModelElementAnalysisHandler in project tdq-studio-se by Talend.

the class ColumnAnalysisDetailsPage method recomputeIndicators.

public void recomputeIndicators() {
    analysisHandler = new ModelElementAnalysisHandler();
    analysisHandler.setAnalysis(getCurrentModelElement());
    // Handle JUDIs
    UDIHelper.updateJUDIsForAnalysis(getCurrentModelElement());
    stringDataFilter = analysisHandler.getStringDataFilterwithContext();
    EList<ModelElement> analyzedColumns = analysisHandler.getAnalyzedColumns();
    List<ModelElementIndicator> meIndicatorList = new ArrayList<ModelElementIndicator>();
    ModelElementIndicator currentIndicator = null;
    for (ModelElement element : analyzedColumns) {
        TdColumn tdColumn = SwitchHelpers.COLUMN_SWITCH.doSwitch(element);
        // MOD qiongli 2011-1-10,16796:delimitefile
        MetadataColumn mdColumn = SwitchHelpers.METADATA_COLUMN_SWITCH.doSwitch(element);
        if (tdColumn == null && mdColumn == null) {
            continue;
        }
        // MOD qiongli TDQ-7052 if the node is filtered ,it will be return null,so should create a new node.
        RepositoryNode repNode = RepositoryNodeHelper.recursiveFind(element);
        if (repNode == null) {
            repNode = RepositoryNodeHelper.createRepositoryNode(element);
        }
        // MOD mzhao feature 15750, The column is recompute from the file, here create a new repository view object.
        if (tdColumn == null && mdColumn != null) {
            currentIndicator = ModelElementIndicatorHelper.createDFColumnIndicator(repNode);
        } else if (tdColumn != null) {
            currentIndicator = ModelElementIndicatorHelper.createModelElementIndicator(repNode);
        }
        DataminingType dataminingType = DataminingType.get(analysisHandler.getDatamingType(element));
        MetadataHelper.setDataminingType(dataminingType == null ? DataminingType.NOMINAL : dataminingType, element);
        Collection<Indicator> indicatorList = analysisHandler.getIndicators(element);
        if (currentIndicator != null) {
            currentIndicator.setIndicators(indicatorList.toArray(new Indicator[indicatorList.size()]));
            meIndicatorList.add(currentIndicator);
        }
    }
    currentModelElementIndicators = meIndicatorList.toArray(new ModelElementIndicator[meIndicatorList.size()]);
}
Also used : DataminingType(org.talend.dataquality.indicators.DataminingType) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) MetadataColumn(org.talend.core.model.metadata.builder.connection.MetadataColumn) TdColumn(org.talend.cwm.relational.TdColumn) ModelElementAnalysisHandler(org.talend.dq.analysis.ModelElementAnalysisHandler) ArrayList(java.util.ArrayList) RepositoryNode(org.talend.repository.model.RepositoryNode) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator) UserDefIndicator(org.talend.dataquality.indicators.sql.UserDefIndicator) Indicator(org.talend.dataquality.indicators.Indicator) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Aggregations

ModelElementAnalysisHandler (org.talend.dq.analysis.ModelElementAnalysisHandler)2 ArrayList (java.util.ArrayList)1 MetadataColumn (org.talend.core.model.metadata.builder.connection.MetadataColumn)1 TdColumn (org.talend.cwm.relational.TdColumn)1 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)1 DataminingType (org.talend.dataquality.indicators.DataminingType)1 Indicator (org.talend.dataquality.indicators.Indicator)1 UserDefIndicator (org.talend.dataquality.indicators.sql.UserDefIndicator)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)1