use of org.talend.dq.nodes.DBViewFolderRepNode in project tdq-studio-se by Talend.
the class TestComparisonLevelFactoryTest method testCreatComparisonLevelObject_3.
/**
* Test method for
* {@link org.talend.cwm.compare.factory.ComparisonLevelFactory#creatComparisonLevel(java.lang.Object)}. test for
* the type of : db view rep node
*/
@Test
public void testCreatComparisonLevelObject_3() {
//
RepositoryNode dbCatalogRepNode = createCatalogRepNode();
DBViewFolderRepNode node = new DBViewFolderRepNode(null, dbCatalogRepNode, null, null);
IComparisonLevel level = ComparisonLevelFactory.creatComparisonLevel(node);
Assert.assertTrue(level instanceof CatalogSchemaComparisonLevel);
}
use of org.talend.dq.nodes.DBViewFolderRepNode in project tdq-studio-se by Talend.
the class CatalogSchemaComparisonLevel method findDataProvider.
@Override
protected Connection findDataProvider() {
Connection provider = null;
if (selectedObj instanceof RepositoryNode) {
if (selectedObj instanceof DBTableFolderRepNode || selectedObj instanceof DBViewFolderRepNode) {
provider = ConnectionHelper.getTdDataProvider(getPackageFromObject(selectedObj));
}
Item connItem = null;
IRepositoryViewObject object = ((RepositoryNode) selectedObj).getObject();
if (null != object) {
connItem = object.getProperty().getItem();
} else {
connItem = ((RepositoryNode) selectedObj).getParent().getObject().getProperty().getItem();
}
provider = ((ConnectionItem) connItem).getConnection();
} else if (selectedObj instanceof Package) {
provider = ConnectionHelper.getTdDataProvider((Package) selectedObj);
}
return provider;
}
use of org.talend.dq.nodes.DBViewFolderRepNode in project tdq-studio-se by Talend.
the class ReloadDatabaseProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
// MOD bug 16532 scorreia 2010-10-19 hide menu when not in TOP standalone
// if (!PluginChecker.isOnlyTopLoaded()) {
// return;
// }
// ~
Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();
if (obj instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) obj;
if (shouldShowReloadMenu(node)) {
String menuText = RELOADDATABASE_MENUTEXT;
if (node instanceof DBTableFolderRepNode) {
menuText = RELOADTABLES_MENUTEXT;
} else if (node instanceof DBViewFolderRepNode) {
menuText = RELOADVIEWS_MENUTEXT;
} else if (node instanceof DBColumnFolderRepNode) {
menuText = RELOADCOLUMNS_MENUTEXT;
}
// menu.add(new ReloadDatabaseAction(node.getObject(), menuText));
menu.add(new ReloadDatabaseAction(node, menuText));
}
}
}
use of org.talend.dq.nodes.DBViewFolderRepNode in project tdq-studio-se by Talend.
the class ComparisonLevelFactory method creatComparisonLevel.
public static IComparisonLevel creatComparisonLevel(Object selectedObject) {
IComparisonLevel comparisonLevel = null;
if (selectedObject instanceof DBConnectionRepNode) {
// MOD klliu 2011-02-24 bug 19015
IRepositoryViewObject resObject = ((DBConnectionRepNode) selectedObject).getObject();
comparisonLevel = new RepositoryObjectComparisonLevel(resObject);
} else if (selectedObject instanceof DBTableFolderRepNode) {
// MOD mzhao FolderNode param need to pass for later reloading from this folder.
DBTableFolderRepNode dbFolderNode = (DBTableFolderRepNode) selectedObject;
comparisonLevel = new CatalogSchemaComparisonLevel(dbFolderNode);
} else if (selectedObject instanceof DBViewFolderRepNode) {
// MOC yyin 20121101, TDQ-6092, add a condition for the db which donot have catalog, like oracle.
if ((null == ((DBViewFolderRepNode) selectedObject).getCatalog()) && (((DBViewFolderRepNode) selectedObject).getParent() instanceof DBConnectionFolderRepNode)) {
// MOD yyi 2011-07-14 21512:the selected obj is db connection in this case
IRepositoryViewObject resObject = ((DBViewFolderRepNode) selectedObject).getParent().getObject();
comparisonLevel = new RepositoryObjectComparisonLevel(resObject);
} else {
DBViewFolderRepNode dbFolderNode = (DBViewFolderRepNode) selectedObject;
comparisonLevel = new CatalogSchemaComparisonLevel(dbFolderNode);
}
} else if (selectedObject instanceof DBColumnFolderRepNode) {
DBColumnFolderRepNode dbFolderNode = (DBColumnFolderRepNode) selectedObject;
comparisonLevel = new TableViewComparisonLevel(dbFolderNode);
} else if (selectedObject instanceof MetadataTable) {
MetadataTable resObject = (MetadataTable) selectedObject;
comparisonLevel = new FileMetadataTableComparisonLevel(resObject);
} else if (selectedObject instanceof Connection) {
// MOD qiongli 2011-9-5 feature TDQ-3317.
comparisonLevel = new DataProviderComparisonLevel(selectedObject);
} else {
comparisonLevel = null;
}
return comparisonLevel;
}
use of org.talend.dq.nodes.DBViewFolderRepNode in project tdq-studio-se by Talend.
the class PopComparisonUIProvider method fillContextMenu.
@Override
public void fillContextMenu(IMenuManager menu) {
// MOD mzhao user readonly role on svn repository mode.
if (!isShowMenu()) {
return;
}
// TDQ-9394 hide all "Reload" menu.
if (isShowMenu()) {
return;
}
Object obj = ((TreeSelection) this.getContext().getSelection()).getFirstElement();
if (obj instanceof RepositoryNode) {
RepositoryNode node = (RepositoryNode) obj;
if (shouldShowReloadMenu(node)) {
String menuText = COMPAREDATABASE_MENUTEXT;
if (node instanceof DBTableFolderRepNode) {
menuText = COMPARETABLES_MENUTEXT;
} else if (node instanceof DBViewFolderRepNode) {
menuText = COMPAREVIEWS_MENUTEXT;
} else if (node instanceof DBColumnFolderRepNode) {
menuText = COMPARECOLUMNS_MENUTEXT;
}
menu.add(new PopComparisonUIAction(node, menuText));
}
}
}
Aggregations