use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class AbstractCommonActionProviderRealProjectTest method testGetConnectionCase5.
/**
* Test method for
* {@link org.talend.dataprofiler.core.ui.action.provider.AbstractCommonActionProvider#getConnection(java.lang.Object)}
* . case5 :input parameter is DBSchemaRepNode
*/
@Test
public void testGetConnectionCase5() {
// create FileConnection
// connection
IRepositoryViewObject lastVersion = null;
String propertyID = createConnectionItem(connectionName, null, null);
// $NON-NLS-1$
Schema createSchema = createSchema("Schema1");
try {
lastVersion = factory.getLastVersion(propertyID);
lastVersion = new MetadataSchemaRepositoryObject(lastVersion, createSchema);
} catch (PersistenceException e) {
log.error(e, e);
Assert.fail(e.getMessage());
}
// ~connection data
// ~FileConnection
// create DFColumnFolderRepNode
Assert.assertFalse(lastVersion == null);
DBSchemaRepNode dbSchemaRepNode = new DBSchemaRepNode(lastVersion, null, null, null);
// ~DFColumnFolderRepNode
AbstractCommonActionProvider provider = new AbstractCommonActionProvider();
Connection connection = provider.getConnection(dbSchemaRepNode);
Assert.assertTrue(connection != null);
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class SchemaAnalysisWizard method initCWMResourceBuilder.
@Override
public ModelElement initCWMResourceBuilder() {
Analysis analysis = (Analysis) super.initCWMResourceBuilder();
if (getAnalysisBuilder() != null) {
// MOD 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();
// Connection tdProvider = packageParameter.getTdDataProvider();
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()) {
SchemaIndicator createSchemaIndicator = SchemaFactory.eINSTANCE.createSchemaIndicator();
DBSchemaRepNode catalogNode = (DBSchemaRepNode) node;
Schema schema = ((MetadataSchemaRepositoryObject) catalogNode.getObject()).getSchema();
modelElement[i] = schema;
DefinitionHandler.getInstance().setDefaultIndicatorDefinition(createSchemaIndicator);
createSchemaIndicator.setAnalyzedElement(schema);
indicators[i] = createSchemaIndicator;
i++;
}
getAnalysisBuilder().addElementsToAnalyze(modelElement, indicators);
}
return analysis;
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class DBTableFolderRepNode method createParentNode.
/**
* create the node of parent.
*
* @return
*/
private RepositoryNode createParentNode() {
RepositoryNode dbParentRepNode = null;
if (viewObject instanceof MetadataCatalogRepositoryObject) {
dbParentRepNode = DQRepNodeCreateFactory.createDBCatalogRepNode(viewObject, null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
} else if (viewObject instanceof MetadataSchemaRepositoryObject) {
dbParentRepNode = new DBSchemaRepNode(viewObject, null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
}
viewObject.setRepositoryNode(dbParentRepNode);
return dbParentRepNode;
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class DBConnectionRepNode method initializedSchemaRepNode.
private void initializedSchemaRepNode(List<IRepositoryNode> nodes, Package pack) {
MetadataSchemaRepositoryObject metadataSchema = new MetadataSchemaRepositoryObject(getObject(), (Schema) pack);
RepositoryNode schemaNode = new DBSchemaRepNode(metadataSchema, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
schemaNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_SCHEMA);
schemaNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_SCHEMA);
metadataSchema.setRepositoryNode(schemaNode);
nodes.add(schemaNode);
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class DBViewRepNode method getParentViewObject.
/*
* (non-Javadoc)
*
* @see org.talend.dq.nodes.DQRepositoryNode#getParentViewObject()
*/
@Override
protected IRepositoryViewObject getParentViewObject() {
IRepositoryViewObject packageViewObject = null;
Package parentPackage = PackageHelper.getParentPackage(getTdView());
if (parentPackage instanceof Catalog) {
packageViewObject = new MetadataCatalogRepositoryObject(tdViewRepositoryObject.getViewObject(), (Catalog) parentPackage);
} else if (parentPackage instanceof Schema) {
packageViewObject = new MetadataSchemaRepositoryObject(tdViewRepositoryObject.getViewObject(), (Schema) parentPackage);
}
return packageViewObject;
}
Aggregations