Search in sources :

Example 6 with ExecutionLanguage

use of org.talend.dataquality.analysis.ExecutionLanguage in project tdq-studio-se by Talend.

the class DbmsLanguageFactory method createDbmsLanguage.

/**
 * Method "createDbmsLanguage".
 *
 * @param analysis
 * @return the dbms language associated to the connection of the given analysis or a default one.
 */
public static DbmsLanguage createDbmsLanguage(Analysis analysis, ExecutionLanguage... exeLanguage) {
    final AnalysisContext context = analysis.getContext();
    ExecutionLanguage theLanguage = null;
    if (exeLanguage != null && exeLanguage.length > 0) {
        theLanguage = exeLanguage[0];
    } else {
        theLanguage = analysis.getParameters().getExecutionLanguage();
    }
    if (theLanguage == ExecutionLanguage.JAVA) {
        return createDbmsLanguage(SupportDBUrlType.JAVADEFAULTURL);
    }
    if (context != null) {
        final DataManager dm = context.getConnection();
        if (dm != null) {
            return createDbmsLanguage(dm);
        }
    }
    return new DbmsLanguage();
}
Also used : ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage) DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager) AnalysisContext(org.talend.dataquality.analysis.AnalysisContext)

Example 7 with ExecutionLanguage

use of org.talend.dataquality.analysis.ExecutionLanguage in project tdq-studio-se by Talend.

the class ColumnAnalysisDetailsPage method refreshEnginSection.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage#refreshEnginSection()
     */
@Override
protected void refreshEnginSection() {
    execLang = execCombo.getText();
    ExecutionLanguage currentLanguage = ExecutionLanguage.get(execLang);
    refreshEnginSection(drillDownComposite, currentLanguage);
}
Also used : ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage)

Example 8 with ExecutionLanguage

use of org.talend.dataquality.analysis.ExecutionLanguage in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method changeExecuteLanguageToSql.

/**
 * DOC xqliu Comment method "changeExecuteLanguageToSql".
 *
 * @param enabled
 */
public void changeExecuteLanguageToSql(boolean enabled) {
    if (this.execCombo == null) {
        return;
    }
    if (!currentModelIsSqlEngine()) {
        int i = 0;
        for (ExecutionLanguage language : ExecutionLanguage.VALUES) {
            if (language.compareTo(ExecutionLanguage.SQL) == 0 && execCombo.getSelectionIndex() != i) {
                this.execCombo.select(i);
                refreshEnginSection();
            } else {
                i++;
            }
        }
    }
    execCombo.setEnabled(enabled);
}
Also used : ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage)

Example 9 with ExecutionLanguage

use of org.talend.dataquality.analysis.ExecutionLanguage in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method changeExecuteLanguageToJava.

/**
 * change ExecutionLanuage to Java.
 */
public void changeExecuteLanguageToJava(boolean isDisabled) {
    if (this.execCombo == null) {
        return;
    }
    if (currentModelIsSqlEngine()) {
        int i = 0;
        for (ExecutionLanguage language : ExecutionLanguage.VALUES) {
            if (language.compareTo(ExecutionLanguage.JAVA) == 0 && this.execCombo.getSelectionIndex() != i) {
                this.execCombo.select(i);
                refreshEnginSection();
            } else {
                i++;
            }
        }
    }
    if (isDisabled) {
        execCombo.setEnabled(false);
    }
}
Also used : ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage)

Example 10 with ExecutionLanguage

use of org.talend.dataquality.analysis.ExecutionLanguage in project tdq-studio-se by Talend.

the class AbstractPredefinedAnalysisAction method composePredefinedColumnIndicator.

protected ModelElementIndicator[] composePredefinedColumnIndicator(IndicatorEnum[] allowedEnum) {
    IRepositoryNode[] columns = getColumns();
    ModelElementIndicator[] predefinedColumnIndicator = new ModelElementIndicator[columns.length];
    ExecutionLanguage language = ExecutionLanguage.get(getMasterPage().getExecCombo().getText());
    for (int i = 0; i < columns.length; i++) {
        IRepositoryNode columnNode = columns[i];
        ModelElementIndicator columnIndicator = ModelElementIndicatorHelper.createModelElementIndicator(columnNode);
        for (IndicatorEnum oneEnum : allowedEnum) {
            columnIndicator.addTempIndicatorEnum(oneEnum);
            if (oneEnum.getChildren() != null) {
                for (IndicatorEnum childEnum : oneEnum.getChildren()) {
                    // MOD by zshen:need language to decide DatePatternFrequencyIndicator whether can be choose by
                    // user.
                    IRepositoryViewObject object = columnNode.getObject();
                    ModelElement element = null;
                    if (object instanceof MetadataColumnRepositoryObject) {
                        element = ((MetadataColumnRepositoryObject) object).getTdColumn();
                    } else if (object instanceof MetadataXmlElementTypeRepositoryObject) {
                        element = ((MetadataXmlElementTypeRepositoryObject) object).getModelElement();
                    }
                    if (element != null && ModelElementIndicatorRule.patternRule(childEnum, element, language)) {
                        columnIndicator.addTempIndicatorEnum(childEnum);
                    }
                }
            }
        }
        columnIndicator.storeTempIndicator();
        predefinedColumnIndicator[i] = columnIndicator;
    }
    return predefinedColumnIndicator;
}
Also used : ModelElement(orgomg.cwm.objectmodel.core.ModelElement) IRepositoryNode(org.talend.repository.model.IRepositoryNode) IndicatorEnum(org.talend.dq.nodes.indicator.type.IndicatorEnum) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ExecutionLanguage(org.talend.dataquality.analysis.ExecutionLanguage) MetadataColumnRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject) MetadataXmlElementTypeRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataXmlElementTypeRepositoryObject) ModelElementIndicator(org.talend.dataprofiler.core.model.ModelElementIndicator)

Aggregations

ExecutionLanguage (org.talend.dataquality.analysis.ExecutionLanguage)12 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)4 Indicator (org.talend.dataquality.indicators.Indicator)3 IndicatorEnum (org.talend.dq.nodes.indicator.type.IndicatorEnum)3 IRepositoryNode (org.talend.repository.model.IRepositoryNode)3 IEditorPart (org.eclipse.ui.IEditorPart)2 OpenItemEditorAction (org.talend.dataprofiler.core.ui.action.actions.OpenItemEditorAction)2 AnalysisEditor (org.talend.dataprofiler.core.ui.editor.analysis.AnalysisEditor)2 IndicatorUnit (org.talend.dataprofiler.core.ui.editor.preview.IndicatorUnit)2 DbmsLanguage (org.talend.dq.dbms.DbmsLanguage)2 RepositoryNode (org.talend.repository.model.RepositoryNode)2 DataManager (orgomg.cwm.foundation.softwaredeployment.DataManager)2 Expression (orgomg.cwm.objectmodel.core.Expression)2 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)1 CCombo (org.eclipse.swt.custom.CCombo)1 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)1 SelectionEvent (org.eclipse.swt.events.SelectionEvent)1