Search in sources :

Example 16 with DataManager

use of orgomg.cwm.foundation.softwaredeployment.DataManager in project tdq-studio-se by Talend.

the class AnalysisContextImpl method setConnection.

/**
 * <!-- begin-user-doc --> <!-- end-user-doc -->
 * @generated
 */
public void setConnection(DataManager newConnection) {
    DataManager oldConnection = connection;
    connection = newConnection;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, AnalysisPackage.ANALYSIS_CONTEXT__CONNECTION, oldConnection, connection));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager)

Example 17 with DataManager

use of orgomg.cwm.foundation.softwaredeployment.DataManager 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 18 with DataManager

use of orgomg.cwm.foundation.softwaredeployment.DataManager in project tdq-studio-se by Talend.

the class AnalysisExecutorHelper method check.

/**
 * Method "check" checks that the analysis can be run.
 *
 * @param analysis the analysis to prepare
 * @return true if ok.
 */
public static ReturnCode check(Analysis analysis) {
    ReturnCode rc = new ReturnCode(Boolean.TRUE);
    // --- check existence of context
    AnalysisContext context = analysis.getContext();
    if (context == null) {
        // $NON-NLS-1$
        rc.setMessage(Messages.getString("AnalysisExecutor.ContextNull", analysis.getName()));
        rc.setOk(Boolean.FALSE);
        return rc;
    }
    // --- check that there exists at least on element to analyze
    if (context.getAnalysedElements().size() == 0) {
        // $NON-NLS-1$
        rc.setMessage(Messages.getString("ColumnAnalysisExecutor.AnalysisHaveAtLeastOneColumn"));
        rc.setOk(Boolean.FALSE);
        return rc;
    }
    // --- check that the connection has been set
    DataManager connection = context.getConnection();
    if (connection == null) {
        // $NON-NLS-1$
        rc.setMessage(Messages.getString("AnalysisExecutor.NoConnectionFound", analysis.getName()));
        rc.setOk(Boolean.FALSE);
        return rc;
    }
    if (log.isInfoEnabled()) {
        if (SoftwaredeploymentPackage.eINSTANCE.getDataProvider().isInstance(connection)) {
            // MOD 20130225 TDQ-6632 the name of the item should be given (not the pathname)
            // $NON-NLS-1$
            log.info(Messages.getString("AnalysisExecutor.CONNECTIONTO", connection.getName()));
        }
    }
    AnalysisResult results = analysis.getResults();
    if (results == null) {
        // $NON-NLS-1$
        rc.setMessage(Messages.getString("AnalysisExecutor.AnalysisnotNotPrepareCorrect", analysis.getName()));
        rc.setOk(Boolean.FALSE);
        return rc;
    }
    // --- check the the dependeny files are exists ADDED mzhao TDQ-10428---
    rc = checkDependentFiles(analysis);
    return rc;
}
Also used : ReturnCode(org.talend.utils.sugars.ReturnCode) DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager) AnalysisContext(org.talend.dataquality.analysis.AnalysisContext) AnalysisResult(org.talend.dataquality.analysis.AnalysisResult)

Example 19 with DataManager

use of orgomg.cwm.foundation.softwaredeployment.DataManager in project tdq-studio-se by Talend.

the class MatchAnalysisDetailsPage method setSampleDataShowWayStatus.

/*
     * (non-Javadoc)
     * 
     * @see org.talend.dataprofiler.core.ui.editor.analysis.AbstractAnalysisMetadataPage#setSampleDataShowWayStatus()
     */
@Override
protected void setSampleDataShowWayStatus() {
    DataManager connection = analysisHandler.getConnection();
    boolean isNotSupportRandom = connection != null && (connection instanceof DelimitedFileConnection || ((connection instanceof DatabaseConnection) && (ConnectionHelper.isInformix((DatabaseConnection) connection) || ConnectionHelper.isSybase((DatabaseConnection) connection))));
    sampleDataShowWayCombo.setEnabled(!isNotSupportRandom);
}
Also used : DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager) DelimitedFileConnection(org.talend.core.model.metadata.builder.connection.DelimitedFileConnection) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection)

Example 20 with DataManager

use of orgomg.cwm.foundation.softwaredeployment.DataManager in project tdq-studio-se by Talend.

the class AbstractAnalysisMetadataPage method reloadDataproviderAndFillConnCombo.

/**
 * This method will make connection elem become proxy, look out for use it.
 */
public void reloadDataproviderAndFillConnCombo() {
    List<IRepositoryNode> connsWithoutDeletion = getConnectionsWithoutDeleted();
    if (connsWithoutDeletion.size() == 0 && !RepositoryNodeHelper.isOpenDQCommonViewer()) {
        return;
    }
    connCombo.getTable().removeAll();
    fillComb(connsWithoutDeletion);
    DataManager connection = getCurrentModelElement().getContext().getConnection();
    if (connection == null) {
        // MOD TDQ-10654 msjian : when there is no connection selected, select 0,else still use the current one
        if (StringUtils.isBlank(connCombo.getText())) {
            connCombo.select(0);
        } else {
            int connIdx = findPositionOfCurrentConnection(connsWithoutDeletion, connCombo);
            connCombo.select(connIdx);
        }
    // TDQ-10654~
    } else {
        // Find the conn index first
        int connIdx = findPositionOfCurrentConnection(connsWithoutDeletion, connection);
        if (connIdx == -1) {
            IRepositoryNode currentConnectionNode = getCurrentConnectionRepNode();
            // The current connection is logical deleted!
            int deleteIndex = connCombo.getItemCount();
            if (currentConnectionNode != null) {
                addItemToCombo(currentConnectionNode, deleteIndex);
            } else {
                getLabelConnDeleted().setVisible(true);
                getLabelConnDeleted().setText(DefaultMessagesImpl.getString("AbstractPagePart.ChangeConnectionError1", // $NON-NLS-1$
                EObjectHelper.getURI(connection).path()));
            }
            connCombo.select(deleteIndex);
        } else {
            connCombo.select(connIdx);
        }
    }
    setSampleDataShowWayStatus();
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) DataManager(orgomg.cwm.foundation.softwaredeployment.DataManager)

Aggregations

DataManager (orgomg.cwm.foundation.softwaredeployment.DataManager)37 Analysis (org.talend.dataquality.analysis.Analysis)8 AnalysisContext (org.talend.dataquality.analysis.AnalysisContext)7 IRepositoryNode (org.talend.repository.model.IRepositoryNode)6 ArrayList (java.util.ArrayList)5 Connection (org.talend.core.model.metadata.builder.connection.Connection)5 TdColumn (org.talend.cwm.relational.TdColumn)4 Indicator (org.talend.dataquality.indicators.Indicator)4 RepositoryNode (org.talend.repository.model.RepositoryNode)4 Dependency (orgomg.cwm.objectmodel.core.Dependency)4 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)4 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)3 MetadataColumnRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataColumnRepositoryObject)3 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)3 CompositeIndicator (org.talend.dataquality.indicators.CompositeIndicator)3 SQLException (java.sql.SQLException)2 HashSet (java.util.HashSet)2 List (java.util.List)2 EList (org.eclipse.emf.common.util.EList)2 EObject (org.eclipse.emf.ecore.EObject)2