Search in sources :

Example 6 with MetadataCatalogRepositoryObject

use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.

the class DBCatalogRepNode method getChildren.

/*
     * (non-Jsdoc)
     * 
     * @see org.talend.repository.model.RepositoryNode#getChildren()
     */
@Override
public List<IRepositoryNode> getChildren() {
    MetadataCatalogRepositoryObject metadataCatalog = (MetadataCatalogRepositoryObject) getObject();
    List<Schema> schemas = CatalogHelper.getSchemas(metadataCatalog.getCatalog());
    // MOD gdbu 2011-7-1 bug : 22204
    if (schemas != null && schemas.size() > 0) {
        return filterResultsIfAny(createRepositoryNodeSchema(schemas));
    } else {
        // feature 22206 2011-7-12 msjian: fixed its note 91852 issue2
        if (DQRepositoryNode.isUntilSchema()) {
            return createTableViewFolder(metadataCatalog);
        }
        return filterResultsIfAny(createTableViewFolder(metadataCatalog));
    }
// ~22204
}
Also used : Schema(orgomg.cwm.resource.relational.Schema) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject)

Example 7 with MetadataCatalogRepositoryObject

use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.

the class DBConnectionRepNode method initializedCatalogRepNode.

private void initializedCatalogRepNode(List<IRepositoryNode> nodes, Package pack) {
    if (pack instanceof Catalog) {
        MetadataCatalogRepositoryObject metadataCatalog = new MetadataCatalogRepositoryObject(getObject(), (Catalog) pack);
        RepositoryNode catalogNode = DQRepNodeCreateFactory.createDBCatalogRepNode(metadataCatalog, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
        catalogNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_CATALOG);
        catalogNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_CATALOG);
        metadataCatalog.setRepositoryNode(catalogNode);
        nodes.add(catalogNode);
    }
}
Also used : MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) IRepositoryNode(org.talend.repository.model.IRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) Catalog(orgomg.cwm.resource.relational.Catalog)

Example 8 with MetadataCatalogRepositoryObject

use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject 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)

Example 9 with MetadataCatalogRepositoryObject

use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.

the class TableViewFilterActionProvider method fillContextMenu.

@Override
public void fillContextMenu(IMenuManager menu) {
    // MOD mzhao user readonly role on svn repository mode.
    if (!isShowMenu()) {
        return;
    }
    TreeSelection currentSelection = ((TreeSelection) this.getContext().getSelection());
    Object obj = currentSelection.getFirstElement();
    if (obj instanceof RepositoryNode) {
        RepositoryNode node = (RepositoryNode) obj;
        if (ENodeType.TDQ_REPOSITORY_ELEMENT.equals(node.getType())) {
            // MOD gdbu 2011-12-29 TDQ-4283 Remove the "Table/View filter" menu under AnalysisSubFolderRepNode.
            if (node.getParent() instanceof AnalysisSubFolderRepNode) {
                return;
            }
            // ~TDQ-4283
            IRepositoryViewObject viewObject = node.getObject();
            if (viewObject instanceof MetadataSchemaRepositoryObject) {
                MetadataSchemaRepositoryObject schemaObject = (MetadataSchemaRepositoryObject) viewObject;
                // MOD yyin TDQ-4959 20120503
                TableViewFilterAction tvfAction = new TableViewFilterAction(schemaObject.getSchema(), node);
                menu.add(tvfAction);
            } else if (viewObject instanceof MetadataCatalogRepositoryObject) {
                MetadataCatalogRepositoryObject catalogObject = (MetadataCatalogRepositoryObject) viewObject;
                // MOD yyin TDQ-4959 20120503
                TableViewFilterAction tvfAction = new TableViewFilterAction(catalogObject.getCatalog(), node);
                menu.add(tvfAction);
            }
        }
    }
}
Also used : TableViewFilterAction(org.talend.dataprofiler.core.ui.action.actions.TableViewFilterAction) TreeSelection(org.eclipse.jface.viewers.TreeSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) MetadataSchemaRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)

Example 10 with MetadataCatalogRepositoryObject

use of org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject in project tdq-studio-se by Talend.

the class TestComparisonLevelFactoryTest method createCatalogRepNode.

private RepositoryNode createCatalogRepNode() {
    IRepositoryViewObject lastVersion = null;
    // $NON-NLS-1$
    databaseConnectionItem = UnitTestBuildHelper.createDatabaseConnectionItem("testCompareLevelConnection", null, false);
    Assert.assertNotNull(databaseConnectionItem);
    Assert.assertNotNull(databaseConnectionItem.getProperty());
    String propertyID = databaseConnectionItem.getProperty().getId();
    // $NON-NLS-1$
    Catalog createCatalog = createCatalog("catalog1");
    try {
        lastVersion = factory.getLastVersion(propertyID);
        lastVersion = new MetadataCatalogRepositoryObject(lastVersion, createCatalog);
    } catch (PersistenceException 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);
    return dbCatalogRepNode;
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) PersistenceException(org.talend.commons.exception.PersistenceException) MetadataCatalogRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject) RepositoryNode(org.talend.repository.model.RepositoryNode) Catalog(orgomg.cwm.resource.relational.Catalog)

Aggregations

MetadataCatalogRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataCatalogRepositoryObject)20 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)13 RepositoryNode (org.talend.repository.model.RepositoryNode)12 Catalog (orgomg.cwm.resource.relational.Catalog)12 IRepositoryNode (org.talend.repository.model.IRepositoryNode)9 ArrayList (java.util.ArrayList)6 Connection (org.talend.core.model.metadata.builder.connection.Connection)6 MetadataSchemaRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject)6 PersistenceException (org.talend.commons.exception.PersistenceException)4 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)4 Schema (orgomg.cwm.resource.relational.Schema)4 Test (org.junit.Test)3 TdTable (org.talend.cwm.relational.TdTable)3 TdView (org.talend.cwm.relational.TdView)3 Package (orgomg.cwm.objectmodel.core.Package)3 Indicator (org.talend.dataquality.indicators.Indicator)2 CatalogIndicator (org.talend.dataquality.indicators.schema.CatalogIndicator)2 PackagesAnalyisParameter (org.talend.dq.analysis.parameters.PackagesAnalyisParameter)2 List (java.util.List)1 DoubleClickEvent (org.eclipse.jface.viewers.DoubleClickEvent)1