use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject 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.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class SchemaAnalysisDPSelectionPage method addListeners.
@Override
protected void addListeners() {
addListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
if (object instanceof Schema) {
advanceToNextPageOrFinish();
}
}
});
addListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
Object object = ((IStructuredSelection) event.getSelection()).getFirstElement();
PackagesAnalyisParameter schemaPanameter = (PackagesAnalyisParameter) getConnectionParams();
List<IRepositoryNode> nodes = new ArrayList<IRepositoryNode>();
if (object instanceof DBSchemaRepNode) {
DBSchemaRepNode schemaNode = (DBSchemaRepNode) object;
Schema schema = ((MetadataSchemaRepositoryObject) schemaNode.getObject()).getSchema();
Connection tdProvider = ConnectionHelper.getTdDataProvider(SwitchHelpers.PACKAGE_SWITCH.doSwitch(schema));
RepositoryNode parent = schemaNode.getParent();
if (tdProvider != null && schemaPanameter != null) {
if (parent instanceof DBCatalogRepNode) {
schemaPanameter.setConnectionRepNode((DBConnectionRepNode) parent.getParent());
} else {
schemaPanameter.setConnectionRepNode((DBConnectionRepNode) parent);
}
schemaPanameter.setTdDataProvider(tdProvider);
}
nodes.add(schemaNode);
schemaPanameter.setPackages(nodes);
setPageComplete(true);
} else {
setPageComplete(false);
}
}
});
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class AnalysisSubFolderRepNode method doSwichNode.
/**
* DOC klliu Comment method "doSwichNode".
*
* @param analyzedElement
* @return
*/
private IRepositoryNode doSwichNode(ModelElement analyzedElement, AnalysisSubFolderRepNode childNodeFolder) {
Property anaEleProperty = PropertyHelper.getProperty(analyzedElement);
IRepositoryViewObject medataViewObject = null;
try {
medataViewObject = ProxyRepositoryFactory.getInstance().getLastVersion(anaEleProperty.getId());
} catch (Exception e) {
log.error(e);
}
// }
if (medataViewObject != null) {
if (analyzedElement instanceof DatabaseConnection) {
DBConnectionRepNode connNode = new DBConnectionRepNode(medataViewObject, this, ENodeType.REPOSITORY_ELEMENT, getProject());
connNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CONNECTIONS);
connNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CONNECTIONS);
medataViewObject.setRepositoryNode(connNode);
return connNode;
} else if (analyzedElement instanceof Catalog) {
RepositoryNode catalogNode = DQRepNodeCreateFactory.createDBCatalogRepNode(new MetadataCatalogRepositoryObject(medataViewObject, (Catalog) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
catalogNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_CATALOG);
catalogNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_CATALOG);
medataViewObject.setRepositoryNode(catalogNode);
return catalogNode;
} else if (analyzedElement instanceof Schema) {
RepositoryNode schemaNode = new DBSchemaRepNode(new MetadataSchemaRepositoryObject(medataViewObject, (Schema) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
schemaNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_SCHEMA);
schemaNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_SCHEMA);
medataViewObject.setRepositoryNode(schemaNode);
return schemaNode;
} else if (analyzedElement instanceof TdTable) {
DBTableRepNode tableNode = new DBTableRepNode(new TdTableRepositoryObject(medataViewObject, (TdTable) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
tableNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_TABLE);
tableNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_TABLE);
medataViewObject.setRepositoryNode(tableNode);
return tableNode;
} else if (analyzedElement instanceof TdView) {
DBViewRepNode viewNode = new DBViewRepNode(new TdViewRepositoryObject(medataViewObject, (TdView) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
viewNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_VIEW);
viewNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_VIEW);
medataViewObject.setRepositoryNode(viewNode);
return viewNode;
} else if (analyzedElement instanceof MetadataColumn) {
RepositoryNode columnNode = null;
if (analyzedElement instanceof TdColumn) {
columnNode = new DBColumnRepNode(new MetadataColumnRepositoryObject(medataViewObject, (MetadataColumn) analyzedElement), childNodeFolder, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
} else {
columnNode = new DFColumnRepNode(new MetadataColumnRepositoryObject(medataViewObject, (MetadataColumn) analyzedElement), this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
}
columnNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_COLUMN);
columnNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_COLUMN);
medataViewObject.setRepositoryNode(columnNode);
return columnNode;
}
}
return null;
}
use of org.talend.core.repository.model.repositoryObject.MetadataSchemaRepositoryObject in project tdq-studio-se by Talend.
the class DBViewFolderRepNode 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 DBCatalogRepNode method createRepositoryNodeSchema.
/**
* Create SchemaRepositoryNode under CatalogRepositoryNode.
*
* @param node parent CatalogRepositoryNode
* @param metadataCatalog parent CatalogViewObject
* @param schema the schema should to be added under the catalog
*/
private List<IRepositoryNode> createRepositoryNodeSchema(List<Schema> schemas) {
if (!schemaChildren.isEmpty()) {
return schemaChildren;
}
for (Schema schema : schemas) {
MetadataSchemaRepositoryObject metadataSchema = new MetadataSchemaRepositoryObject(((MetadataCatalogRepositoryObject) getObject()).getViewObject(), schema);
metadataSchema.setParentCatalogObject(metadataCatalogObject);
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);
schemaChildren.add(schemaNode);
}
return schemaChildren;
}
Aggregations