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
}
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);
}
}
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;
}
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);
}
}
}
}
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;
}
Aggregations