use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class AnalysisEditor method initContext.
/**
* init the context for the analysis.
*/
private void initContext() {
Analysis analysis = getMasterPage().getCurrentModelElement();
contextManager = new JobContextManager(analysis.getContextType(), analysis.getDefaultContext());
this.setLastRunContextGroupName(AnalysisHelper.getContextGroupName(analysis));
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class FunctionalDependencyAnalysisResultPage method createResultSection.
@Override
protected void createResultSection(Composite parent) {
resultSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.analysisResults"), // $NON-NLS-1$ //$NON-NLS-2$
"");
Composite sectionClient = toolkit.createComposite(resultSection);
sectionClient.setLayout(new GridLayout(2, false));
sectionClient.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
resultSection.setClient(sectionClient);
Analysis analysis = this.masterPage.getAnalysisHandler().getAnalysis();
EList<Indicator> indicators = analysis.getResults().getIndicators();
if (indicators.size() > 0) {
columnDependencyIndicator = (ColumnDependencyIndicator) indicators.get(0);
}
createTable(sectionClient);
if (canShowChartForResultPage()) {
createChart(sectionClient, analysis);
}
resultSection.layout();
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class RedundancyAnalysisResultPage method createResultSection.
@Override
protected void createResultSection(Composite parent) {
resultSection = createSection(form, parent, DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.analysisResults"), // $NON-NLS-1$ //$NON-NLS-2$
"");
Composite sectionClient = toolkit.createComposite(resultSection);
sectionClient.setLayout(new GridLayout(2, false));
sectionClient.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
resultSection.setClient(sectionClient);
if (executeData == null || executeData.equals(PluginConstant.EMPTY_STRING)) {
return;
}
Table resultTable = new Table(sectionClient, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
resultTable.setLinesVisible(true);
resultTable.setHeaderVisible(true);
final TableColumn columnHeader0 = new TableColumn(resultTable, SWT.LEAD);
columnHeader0.setWidth(100);
final TableColumn columnHeader1 = new TableColumn(resultTable, SWT.LEAD);
columnHeader1.setWidth(150);
// add by hcheng for 6503:change the "set A" and "set B" labels
Analysis analysis = this.masterPage.getAnalysisHandler().getAnalysis();
EList<Indicator> indicators = analysis.getResults().getIndicators();
rowMatchingIndicatorA = (RowMatchingIndicator) indicators.get(0);
rowMatchingIndicatorB = (RowMatchingIndicator) indicators.get(1);
// MOD yyi 2009-10-27 9100: not save when remove element in comparison analysis
int sizeA = rowMatchingIndicatorA.getColumnSetA().size();
int sizeB = rowMatchingIndicatorA.getColumnSetB().size();
if (sizeA > 0 && sizeB > 0) {
TdColumn columnA = rowMatchingIndicatorA.getColumnSetA().get(0);
if (columnA.eIsProxy()) {
columnA = (TdColumn) EObjectHelper.resolveObject(columnA);
}
String tableNameA = ColumnHelper.getColumnOwnerAsColumnSet(columnA).getName();
TdColumn columnB = rowMatchingIndicatorA.getColumnSetB().get(0);
if (columnB.eIsProxy()) {
columnB = (TdColumn) EObjectHelper.resolveObject(columnB);
}
String tableNameB = ColumnHelper.getColumnOwnerAsColumnSet(columnB).getName();
// MOD zshen 11136: the chart of result lose one table
if (tableNameA.equals(tableNameB)) {
// $NON-NLS-1$
tableNameB = tableNameB + "(*)";
}
// ~11136
columnHeader1.setText(tableNameA);
if (!isHasDeactivatedIndicator) {
final TableColumn columnHeader2 = new TableColumn(resultTable, SWT.LEAD);
columnHeader2.setWidth(150);
columnHeader2.setText(tableNameB);
}
createTableItems(resultTable);
if (canShowChartForResultPage()) {
creatChart(sectionClient, tableNameA, tableNameB);
}
StringBuilder description = new StringBuilder();
description.append(DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.ASetFoundInB", setAMatchPercent, tableNameA, // $NON-NLS-1$
tableNameB));
if (!isHasDeactivatedIndicator) {
// $NON-NLS-1$
description.append("\n");
description.append(DefaultMessagesImpl.getString("ColumnsComparisonAnalysisResultPage.BSetFoundInA", setBMatchPercent, tableNameB, // $NON-NLS-1$
tableNameA));
}
resultSection.setDescription(description.toString());
}
resultSection.layout();
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class UnitTestBuildHelper method createAndInitAnalysis.
public static Analysis createAndInitAnalysis() {
Analysis ana = UnitTestBuildHelper.createRealAnalysis("anaA", null, false);
AnalysisParameters parameters = AnalysisFactory.eINSTANCE.createAnalysisParameters();
parameters.setExecutionLanguage(ExecutionLanguage.SQL);
ana.setParameters(parameters);
AnalysisContext context = AnalysisFactory.eINSTANCE.createAnalysisContext();
ana.setContext(context);
Connection createConnection = ConnectionFactory.eINSTANCE.createConnection();
createConnection.setName("MySQL");
context.setConnection(createConnection);
return ana;
}
use of org.talend.dataquality.analysis.Analysis in project tdq-studio-se by Talend.
the class UnitTestBuildHelper method createRealAnalysis.
/**
* DOC qiongli Comment method "createRealAnalysis".
*
* @param name
* @param folder
* @param isDelete
* @return
*/
public static Analysis createRealAnalysis(String name, IFolder folder, Boolean isDelete) {
IPath createPath = Path.EMPTY;
if (folder != null) {
createPath = new Path(folder.getFullPath().lastSegment());
}
Analysis analysis1 = AnalysisHelper.createAnalysis(name);
TDQAnalysisItem item1 = PropertiesFactoryImpl.eINSTANCE.createTDQAnalysisItem();
org.talend.core.model.properties.Property property1 = PropertiesFactory.eINSTANCE.createProperty();
property1.setId(EcoreUtil.generateUUID());
property1.setItem(item1);
property1.setLabel(analysis1.getName());
item1.setProperty(property1);
item1.setAnalysis(analysis1);
ItemState itemState = org.talend.core.model.properties.PropertiesFactory.eINSTANCE.createItemState();
itemState.setDeleted(isDelete);
item1.setState(itemState);
AnalysisResult analysisResult1 = AnalysisFactory.eINSTANCE.createAnalysisResult();
analysis1.setResults(analysisResult1);
try {
ProxyRepositoryFactory.getInstance().create(item1, createPath, false);
} catch (PersistenceException e) {
Assert.fail(e.getMessage());
}
return analysis1;
}
Aggregations