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));
}
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();
}
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;
}
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);
}
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();
}
Aggregations