use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.
the class RepositoryNodeHelper method createDBViewRepNode.
/**
* DOC talend Comment method "createDBViewRepNode".
*
* @param findModelElement
* @param lastVersion
* @return
*/
private static RepositoryNode createDBViewRepNode(TdView findModelElement, IRepositoryViewObject lastVersion) {
TdViewRepositoryObject tdViewRepositoryObject = new TdViewRepositoryObject(lastVersion, findModelElement);
tdViewRepositoryObject.setId(findModelElement.getName());
tdViewRepositoryObject.setLabel(findModelElement.getName());
DBViewRepNode dbViewRepNode = new DBViewRepNode(tdViewRepositoryObject, null, ENodeType.TDQ_REPOSITORY_ELEMENT, null);
dbViewRepNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_COLUMN);
dbViewRepNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_COLUMN);
tdViewRepositoryObject.setRepositoryNode(dbViewRepNode);
return dbViewRepNode;
}
use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.
the class DBViewFolderRepNode method createViewRepositoryNode.
/**
* DOC klliu Comment method "createTableRepositoryNode".
*
* @param tables
*/
private void createViewRepositoryNode(List<TdView> views, List<IRepositoryNode> node) {
if (views != null) {
for (TdView view : views) {
// create view object
TdViewRepositoryObject metadataView = new TdViewRepositoryObject(viewObject, view);
metadataView.setTableName(view.getName());
metadataView.setLabel(view.getName());
metadataView.setId(view.getName());
// create a node for ui
DBViewRepNode viewNode = new DBViewRepNode(metadataView, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
viewNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_TABLE);
viewNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_VIEW);
metadataView.setRepositoryNode(viewNode);
node.add(viewNode);
}
}
}
use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.
the class DBColumnRepNode method getParentViewObject.
/*
* (non-Javadoc)
*
* @see
* org.talend.dq.nodes.DQRepositoryNode#getParentViewObject(org.talend.core.model.repository.IRepositoryViewObject)
*/
@Override
protected IRepositoryViewObject getParentViewObject() {
IRepositoryViewObject returnViewObject = null;
MetadataTable columnOwnerAsMetadataTable = ColumnHelper.getColumnOwnerAsMetadataTable(getTdColumn());
if (columnOwnerAsMetadataTable instanceof TdTable) {
returnViewObject = new TdTableRepositoryObject(metadataColumnRepositoryObject.getViewObject(), (TdTable) columnOwnerAsMetadataTable);
} else if (columnOwnerAsMetadataTable instanceof TdView) {
returnViewObject = new TdViewRepositoryObject(metadataColumnRepositoryObject.getViewObject(), (TdView) columnOwnerAsMetadataTable);
}
return returnViewObject;
}
use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.
the class DBColumnFolderRepNode method getChildren.
@Override
public List<IRepositoryNode> getChildren() {
if (!this.isReload() && !children.isEmpty()) {
// MOD gdbu 2011-6-29 bug : 22204
return filterResultsIfAny(children);
}
children.clear();
String filterCharater = null;
IRepositoryViewObject meataColumnSetObject = this.getParent().getObject();
EList<MetadataColumn> columns = null;
if (meataColumnSetObject instanceof TdTableRepositoryObject) {
TdTableRepositoryObject tdTableRepositoryObject = (TdTableRepositoryObject) meataColumnSetObject;
// MOD klliu 2011-09-06 bug TDQ-3414
setItem((ConnectionItem) tdTableRepositoryObject.getViewObject().getProperty().getItem());
if (tdTableRepositoryObject.getTdTable().eIsProxy()) {
// reload the connection to make sure the connection(and all it's owned elements) is not proxy
reloadConnectionViewObject();
}
tdTable = tdTableRepositoryObject.getTdTable();
columns = tdTable.getColumns();
filterCharater = ColumnHelper.getColumnFilter(tdTable);
} else if (meataColumnSetObject instanceof TdViewRepositoryObject) {
TdViewRepositoryObject tdViewRepositoryObject = (TdViewRepositoryObject) meataColumnSetObject;
// MOD klliu 2011-09-06 bug TDQ-3414
setItem((ConnectionItem) tdViewRepositoryObject.getViewObject().getProperty().getItem());
if (tdViewRepositoryObject.getTdView().eIsProxy()) {
// reload the connection to make sure the connection(and all it's owned elements) is not proxy
reloadConnectionViewObject();
}
tdView = tdViewRepositoryObject.getTdView();
columns = tdView.getColumns();
filterCharater = ColumnHelper.getColumnFilter(tdView);
}
setConnection(getItem().getConnection());
// MOD TDQ-8718 20140430 the repository view cares about if use the filter or not, the column select dialog
// cares about if connect to DB or not.
List<TdColumn> tdcolumns = null;
if (columns.size() <= 0) {
if (isCallingFromColumnDialog()) {
tdcolumns = loadColumns(isLoadDBFromDialog());
} else if (!isOnFilterring()) {
// MOD gdbu 2011-6-28 bug : 22204
tdcolumns = loadColumns(true);
}
} else {
tdcolumns = new ArrayList<TdColumn>();
for (MetadataColumn mec : columns) {
tdcolumns.add((TdColumn) mec);
}
}
if (tdcolumns != null && filterCharater != null && !filterCharater.equals("")) {
// $NON-NLS-1$
tdcolumns = RepositoryNodeHelper.filterColumns(tdcolumns, filterCharater);
}
createTdcolumnsNode(tdcolumns, children);
this.setReload(false);
// MOD gdbu 2011-6-28 bug : 22204
return filterResultsIfAny(children);
// return children;
}
use of org.talend.core.repository.model.repositoryObject.TdViewRepositoryObject in project tdq-studio-se by Talend.
the class DBColumnFolderRepNode method createParentNode.
/**
* create the node of parent.
*
* @param object
* @return
*/
private RepositoryNode createParentNode(IRepositoryViewObject object) {
RepositoryNode dbParentRepNode = null;
if (object instanceof TdTableRepositoryObject) {
dbParentRepNode = new DBTableRepNode(object, null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
} else if (object instanceof TdViewRepositoryObject) {
dbParentRepNode = new DBViewRepNode(object, null, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
}
object.setRepositoryNode(dbParentRepNode);
return dbParentRepNode;
}
Aggregations