use of org.talend.core.model.metadata.builder.connection.MetadataColumn in project tdq-studio-se by Talend.
the class DFColumnFolderRepNode method createMdcolumnsNode.
/**
* DOC qiongli Comment method "createTdcolumnsNode".
*
* @param tdcolumns
* @param repsNodes
*/
private void createMdcolumnsNode(List<MetadataColumn> mdColumns, List<IRepositoryNode> repsNodes) {
for (MetadataColumn mdColumn : mdColumns) {
MetadataColumnRepositoryObject metadataColumn = new MetadataColumnRepositoryObject(object, mdColumn);
metadataColumn.setId(mdColumn.getLabel());
metadataColumn.setLabel(mdColumn.getLabel());
DFColumnRepNode columnNode = new DFColumnRepNode(metadataColumn, this, ENodeType.TDQ_REPOSITORY_ELEMENT, getProject());
columnNode.setProperties(EProperties.LABEL, ERepositoryObjectType.METADATA_CON_COLUMN);
columnNode.setProperties(EProperties.CONTENT_TYPE, ERepositoryObjectType.METADATA_CON_COLUMN);
metadataColumn.setRepositoryNode(columnNode);
repsNodes.add(columnNode);
}
}
use of org.talend.core.model.metadata.builder.connection.MetadataColumn in project tdq-studio-se by Talend.
the class DFColumnFolderRepNode method getChildren.
@Override
public List<IRepositoryNode> getChildren() {
List<IRepositoryNode> repsNodes = new ArrayList<IRepositoryNode>();
List<MetadataColumn> mdColumns = new ArrayList<MetadataColumn>();
IRepositoryViewObject meataColumnSetObject = this.getObject();
if (meataColumnSetObject instanceof MetadataTableRepositoryObject) {
MetadataTableRepositoryObject mTableRepositoryObject = (MetadataTableRepositoryObject) meataColumnSetObject;
object = mTableRepositoryObject;
mTable = mTableRepositoryObject.getTable();
columns = mTable.getColumns();
}
if (columns != null && columns.size() > 0) {
for (MetadataColumn mec : columns) {
mdColumns.add(mec);
}
}
createMdcolumnsNode(mdColumns, repsNodes);
// MOD msjian 2011-7-13 feature 22206 : fix note 0091973 issue3
return filterResultsIfAny(repsNodes);
}
use of org.talend.core.model.metadata.builder.connection.MetadataColumn 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.model.metadata.builder.connection.MetadataColumn in project tdq-studio-se by Talend.
the class ModelElementIndicatorHelper method getColumns.
/**
* Get columns from modelElementIndicators
*
* @param modelElementIndicators
* @return
*/
public static final List<MetadataColumn> getColumns(ModelElementIndicator[] modelElementIndicators) {
List<MetadataColumn> columns = new ArrayList<MetadataColumn>();
for (ModelElementIndicator modelElementIndicator : modelElementIndicators) {
ColumnIndicator switchColumnIndicator = switchColumnIndicator(modelElementIndicator);
if (switchColumnIndicator == null) {
continue;
}
columns.add(switchColumnIndicator.getTdColumn());
}
return columns;
}
use of org.talend.core.model.metadata.builder.connection.MetadataColumn in project tdq-studio-se by Talend.
the class ResourceManager method getMapDBCatalogName.
/**
* Get the catalog name of current indicator.
*
* @param indicator we should find the name of analysis,analysisElement,indicatorDefinition.So that it should be
* used by some one analysis
*
* ColumnAnalysis like(../analysisName/columnName/indicatorName) others like(../analysisName/indicatorName)
* @return
*/
public static String getMapDBCatalogName(Indicator indicator) {
Analysis analysis = AnalysisHelper.getAnalysis(indicator);
String analysisUUID = null;
String indicatorUUID = ResourceHelper.getUUID(indicator);
String modelElementName = Path.EMPTY.toString();
if (analysis == null) {
// $NON-NLS-1$
log.error(Messages.getString("ResourceManager.CanNotGetAnalysis"));
} else {
analysisUUID = ResourceHelper.getUUID(analysis);
if (AnalysisType.MULTIPLE_COLUMN.equals(analysis.getParameters().getAnalysisType())) {
modelElementName = indicator.getAnalyzedElement().getName();
// TDQ-12795, only for file delimited connection, the name of the column maybe null, but the label always has value.
if (modelElementName == null) {
if (indicator.getAnalyzedElement() instanceof MetadataColumn) {
if (indicator.getAnalyzedElement().eIsProxy()) {
modelElementName = Path.EMPTY.toString();
} else {
modelElementName = ((MetadataColumn) indicator.getAnalyzedElement()).getLabel();
}
} else {
modelElementName = Path.EMPTY.toString();
log.error(Messages.getString("ResourceManager.CanNotGetColunName"));
}
}
}
}
return getTempMapDBFolder().append(analysisUUID).append(modelElementName).append(indicatorUUID).append("_").toString();
}
Aggregations