use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.
the class ConnectionAnalysisDetailsPage method getCatalogIndicators.
@Override
public List<OverviewIndUIElement> getCatalogIndicators() {
ConnectionIndicator conIndicator = (ConnectionIndicator) getCurrentModelElement().getResults().getIndicators().get(0);
Connection analyzedElement = (Connection) conIndicator.getAnalyzedElement();
EList<CatalogIndicator> catalogIndicators = conIndicator.getCatalogIndicators();
List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
RepositoryNode connNode = RepositoryNodeHelper.recursiveFind(analyzedElement);
for (Indicator indicator : catalogIndicators) {
if (connNode != null) {
for (IRepositoryNode catalogNode : connNode.getChildren()) {
Catalog catalog = ((MetadataCatalogRepositoryObject) catalogNode.getObject()).getCatalog();
String connUuid = ResourceHelper.getUUID(catalog);
String anaUuid = ResourceHelper.getUUID(indicator.getAnalyzedElement());
if (connUuid.equals(anaUuid)) {
OverviewIndUIElement cataUIEle = new OverviewIndUIElement();
cataUIEle.setNode(catalogNode);
cataUIEle.setOverviewIndicator(indicator);
cataUIEleList.add(cataUIEle);
break;
}
}
}
}
return cataUIEleList;
}
use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.
the class AbstractCommonActionProviderRealProjectTest method testGetConnectionCase6.
/**
* Test method for
* {@link org.talend.dataprofiler.core.ui.action.provider.AbstractCommonActionProvider#getConnection(java.lang.Object)}
* . case6 :input parameter is DBTableFolderRepNode
*/
@Test
public void testGetConnectionCase6() {
// create FileConnection
// connection
IRepositoryViewObject lastVersion = null;
String propertyID = createConnectionItem(connectionName, null, null);
// $NON-NLS-1$
Catalog createCatalog = createCatalog("catalog1");
try {
lastVersion = factory.getLastVersion(propertyID);
lastVersion = new MetadataCatalogRepositoryObject(lastVersion, createCatalog);
} catch (PersistenceException e) {
log.error(e, e);
Assert.fail(e.getMessage());
}
// ~connection data
// ~FileConnection
// create DFColumnFolderRepNode
Assert.assertFalse(lastVersion == null);
RepositoryNode dbCatalogRepNode = DQRepNodeCreateFactory.createDBCatalogRepNode(lastVersion, null, ENodeType.TDQ_REPOSITORY_ELEMENT, null);
DBTableFolderRepNode dbTableFolderRepNode = new DBTableFolderRepNode(null, dbCatalogRepNode, null, null);
// ~DFColumnFolderRepNode
AbstractCommonActionProvider provider = new AbstractCommonActionProvider();
Connection connection = provider.getConnection(dbTableFolderRepNode);
Assert.assertTrue(connection != null);
}
use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.
the class CatalogAnalysisWizard method initCWMResourceBuilder.
@Override
public ModelElement initCWMResourceBuilder() {
Analysis analysis = (Analysis) super.initCWMResourceBuilder();
if (getAnalysisBuilder() != null) {
// DOC klliu 15750 2011-1-05 add the repnode on parameter
PackagesAnalyisParameter packageParameter = getParameter();
IRepositoryNode connectionRepNode = getParameter().getConnectionRepNode();
ConnectionItem item = (ConnectionItem) connectionRepNode.getObject().getProperty().getItem();
Connection tdProvider = item.getConnection();
getAnalysisBuilder().setAnalysisConnection(tdProvider);
Indicator[] indicators = new Indicator[packageParameter.getPackages().size()];
ModelElement[] modelElement = new ModelElement[packageParameter.getPackages().size()];
int i = 0;
for (IRepositoryNode node : packageParameter.getPackages()) {
CatalogIndicator createCatalogIndicator = SchemaFactory.eINSTANCE.createCatalogIndicator();
// MOD xqliu 2009-1-21 feature 4715
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createCatalogIndicator);
Catalog catalog = ((MetadataCatalogRepositoryObject) node.getObject()).getCatalog();
modelElement[i] = catalog;
createCatalogIndicator.setAnalyzedElement(catalog);
indicators[i] = createCatalogIndicator;
i++;
}
getAnalysisBuilder().addElementsToAnalyze(modelElement, indicators);
}
return analysis;
}
use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.
the class AnalysisSubFolderRepNode method doSwichNode.
/**
* DOC klliu Comment method "doSwichNode".
*
* @param analyzedElement
* @return
*/
private IRepositoryNode doSwichNode(ModelElement analyzedElement, AnalysisSubFolderRepNode childNodeFolder) {
Property anaEleProperty = PropertyHelper.getProperty(analyzedElement);
IRepositoryViewObject medataViewObject = null;
try {
medataViewObject = ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
} catch (Exception e) {
log.error(e);
}
// }
if (medataViewObject != null) {
if (analyzedElement instanceof DatabaseConnection) {
DBConnectionRepNode connNode = new DBConnectionRepNode(medataViewObject, this, ENodeType.REPOSITORY_ELEMENT, getProject());
connNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CONNECTIONS);
connNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CONNECTIONS);
medataViewObject.setRepositoryNode(connNode);
return connNode;
} else if (analyzedElement instanceof Catalog) {
RepositoryNode catalogNode = DQRepNodeCreateFactory.createDBCatalogRepNode(new MetadataCatalogRepositoryObject(medataViewObject, (Catalog) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
catalogNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_CATALOG);
catalogNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_CATALOG);
medataViewObject.setRepositoryNode(catalogNode);
return catalogNode;
} else if (analyzedElement instanceof Schema) {
RepositoryNode schemaNode = new DBSchemaRepNode(new MetadataSchemaRepositoryObject(medataViewObject, (Schema) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
schemaNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_SCHEMA);
schemaNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_SCHEMA);
medataViewObject.setRepositoryNode(schemaNode);
return schemaNode;
} else if (analyzedElement instanceof TdTable) {
DBTableRepNode tableNode = new DBTableRepNode(new TdTableRepositoryObject(medataViewObject, (TdTable) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
tableNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_TABLE);
tableNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_TABLE);
medataViewObject.setRepositoryNode(tableNode);
return tableNode;
} else if (analyzedElement instanceof TdView) {
DBViewRepNode viewNode = new DBViewRepNode(new TdViewRepositoryObject(medataViewObject, (TdView) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
viewNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_VIEW);
viewNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_VIEW);
medataViewObject.setRepositoryNode(viewNode);
return viewNode;
} else if (analyzedElement instanceof MetadataColumn) {
RepositoryNode columnNode = null;
if (analyzedElement instanceof TdColumn) {
columnNode = new DBColumnRepNode(new MetadataColumnRepositoryObject(medataViewObject, (MetadataColumn) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
} else {
columnNode = new DFColumnRepNode(new MetadataColumnRepositoryObject(medataViewObject, (MetadataColumn) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
}
columnNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_COLUMN);
columnNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_COLUMN);
medataViewObject.setRepositoryNode(columnNode);
return columnNode;
}
}
return null;
}
use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.
the class DBSchemaRepNode method getParentViewObject.
/*
* (non-Javadoc)
*
* @see org.talend.dq.nodes.DQRepositoryNode#getParentViewObject()
*/
@Override
protected IRepositoryViewObject getParentViewObject() {
IRepositoryViewObject packageViewObject = null;
Package parentPackage = PackageHelper.getParentPackage(getSchema());
if (parentPackage == null) {
return metadataSchemaObject.getViewObject();
} else if (parentPackage instanceof Catalog) {
packageViewObject = new MetadataCatalogRepositoryObject(metadataSchemaObject.getViewObject(), (Catalog) parentPackage);
}
return packageViewObject;
}
Aggregations