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