Search in sources :

Example 1 with MetadataSchemaRepositoryObject

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);
}
Also used : DBSchemaRepNode(org.talend.dq.nodes.DBSchemaRepNode) Schema(orgomg.cwm.resource.relational.Schema) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) PersistenceException(org.talend.commons.exception.PersistenceException) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject) Test(org.junit.Test)

Example 2 with MetadataSchemaRepositoryObject

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;
}
Also used : SchemaIndicator(org.talend.dataquality.indicators.schema.SchemaIndicator) DBSchemaRepNode(org.talend.dq.nodes.DBSchemaRepNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ConnectionItem(org.talend.core.model.properties.ConnectionItem) Schema(orgomg.cwm.resource.relational.Schema) Connection(org.talend.core.model.metadata.builder.connection.Connection) SchemaIndicator(org.talend.dataquality.indicators.schema.SchemaIndicator) Indicator(org.talend.dataquality.indicators.Indicator) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) PackagesAnalyisParameter(org.talend.dq.analysis.parameters.PackagesAnalyisParameter) Analysis(org.talend.dataquality.analysis.Analysis)

Example 3 with MetadataSchemaRepositoryObject

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;
}
Also used : MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Example 4 with MetadataSchemaRepositoryObject

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);
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Example 5 with MetadataSchemaRepositoryObject

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;
}
Also used : Schema(orgomg.cwm.resource.relational.Schema) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) Package(orgomg.cwm.objectmodel.core.Package) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) Catalog(orgomg.cwm.resource.relational.Catalog) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Aggregations

MetadataSchemaRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)11 IRepositoryNode (org.talend.repository.model.IRepositoryNode)7 RepositoryNode (org.talend.repository.model.RepositoryNode)7 Schema (orgomg.cwm.resource.relational.Schema)7 MetadataCatalogRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject)6 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)5 Connection (org.talend.core.model.metadata.builder.connection.Connection)3 DBSchemaRepNode (org.talend.dq.nodes.DBSchemaRepNode)3 Catalog (orgomg.cwm.resource.relational.Catalog)3 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)2 PackagesAnalyisParameter (org.talend.dq.analysis.parameters.PackagesAnalyisParameter)2 Package (orgomg.cwm.objectmodel.core.Package)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1 IDoubleClickListener (org.eclipse.jface.viewers.IDoubleClickListener)1 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)1 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)1 TreeSelection (org.eclipse.jface.viewers.TreeSelection)1 Test (org.junit.Test)1