use of org.talend.dataquality.properties.TDQAnalysisItem in project tdq-studio-se by Talend.
the class EMFSharedResourcesTest method createRealAnalysis.
private Item 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) {
fail(e.getMessage());
}
return item1;
}
use of org.talend.dataquality.properties.TDQAnalysisItem 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;
}
use of org.talend.dataquality.properties.TDQAnalysisItem in project tdq-studio-se by Talend.
the class ResourceViewLabelProviderTest method createAnalysis.
private void createAnalysis(String name, IPath createPath, Boolean isDelete) {
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());
}
}
use of org.talend.dataquality.properties.TDQAnalysisItem in project tdq-studio-se by Talend.
the class PropertyHelper method getModelElement.
/**
* DOC bZhou Comment method "getModelElement".
*
* Get model element from property recognized by current system.
*
* @param property
* @return
*/
public static ModelElement getModelElement(Property property) {
Item item = property.getItem();
assert item != null;
ModelElement element = (ModelElement) new org.talend.core.model.properties.util.PropertiesSwitch() {
@Override
public Object caseDatabaseConnectionItem(DatabaseConnectionItem object) {
return object.getConnection();
}
@Override
public Object caseMDMConnectionItem(MDMConnectionItem object) {
return object.getConnection();
}
@Override
public Object caseDelimitedFileConnectionItem(DelimitedFileConnectionItem object) {
return object.getConnection();
}
}.doSwitch(item);
if (element == null) {
element = new org.talend.dataquality.properties.util.PropertiesSwitch<ModelElement>() {
@Override
public ModelElement caseTDQReportItem(TDQReportItem object) {
return object.getReport();
}
@Override
public ModelElement caseTDQAnalysisItem(TDQAnalysisItem object) {
return object.getAnalysis();
}
@Override
public ModelElement caseTDQBusinessRuleItem(TDQBusinessRuleItem object) {
return object.getDqrule();
}
/*
* (non-Javadoc)
*
* @see
* org.talend.dataquality.properties.util.PropertiesSwitch#caseTDQMatchRuleItem(org.talend.dataquality
* .properties.TDQMatchRuleItem)
*/
@Override
public ModelElement caseTDQMatchRuleItem(TDQMatchRuleItem object) {
return object.getMatchRule();
}
@Override
public ModelElement caseTDQIndicatorDefinitionItem(TDQIndicatorDefinitionItem object) {
return object.getIndicatorDefinition();
}
@Override
public ModelElement caseTDQPatternItem(TDQPatternItem object) {
return object.getPattern();
}
}.doSwitch(item);
}
return element;
}
use of org.talend.dataquality.properties.TDQAnalysisItem in project tdq-studio-se by Talend.
the class RespositoryDetailView method createTechnicalDetail.
private void createTechnicalDetail(IRepositoryViewObject reposViewObj) {
// MOD klliu the DQRepositoryview unified with tos, so refactor as follow bug 19154 2011-02-28
if (reposViewObj.getProperty() != null) {
Item item = reposViewObj.getProperty().getItem();
if (item instanceof ConnectionItem) {
Connection conn = ((ConnectionItem) item).getConnection();
createTechnicalDetail(conn);
} else if (item instanceof TDQAnalysisItem) {
Analysis analysis = ((TDQAnalysisItem) item).getAnalysis();
createTechnicalDetail(analysis);
} else if (item instanceof TDQPatternItem) {
Pattern pattern = ((TDQPatternItem) item).getPattern();
createTechnicalDetail(pattern);
} else if (item instanceof TDQReportItem) {
Report report = ((TDQReportItem) item).getReport();
createTechnicalDetail(report);
}
}
}
Aggregations