Search in sources :

Example 1 with DBCalculationViewFolderRepNode

use of org.talend.dq.nodes.DBCalculationViewFolderRepNode in project tdq-studio-se by Talend.

the class OverviewResultPage method wapperInput.

/**
 * DOC zshen Comment method "wapperInput".
 *
 * @param indicatorViewList
 * @param parentNode
 * @return
 */
private List<OverviewIndUIElement> wapperInput(List<ViewIndicator> indicatorViewList, IRepositoryNode parentNode) {
    List<OverviewIndUIElement> cataUIEleList = new ArrayList<OverviewIndUIElement>();
    List<IRepositoryNode> children = parentNode.getChildren();
    for (IRepositoryNode folderNode : children) {
        if (folderNode instanceof DBViewFolderRepNode || folderNode instanceof DBCalculationViewFolderRepNode) {
            List<IRepositoryNode> tableNodes = folderNode.getChildren();
            if (tableNodes == null || tableNodes.isEmpty()) {
                continue;
            }
            // MOD 20120315 klliu&yyin TDQ-2391, avoid getting many times for table nodes.
            for (ViewIndicator indicator : indicatorViewList) {
                boolean equals = false;
                for (IRepositoryNode tableNode : tableNodes) {
                    MetadataTable table = ((MetadataTableRepositoryObject) tableNode.getObject()).getTable();
                    String name = table.getName();
                    String tableName = indicator.getTableName();
                    // String connUuid = ResourceHelper.getUUID(table);
                    // String anaUuid = ResourceHelper.getUUID(indicator.getAnalyzedElement());
                    equals = name.equals(tableName);
                    if (equals) {
                        OverviewIndUIElement tableUIEle = new OverviewIndUIElement();
                        tableUIEle.setNode(tableNode);
                        tableUIEle.setOverviewIndicator(indicator);
                        if (DqRepositoryViewService.isComeFromRefrenceProject(getTdDataProvider()) && ColumnSetHelper.getColumns((ColumnSet) table).isEmpty()) {
                            tableUIEle.setVirtualNode(true);
                        }
                        cataUIEleList.add(tableUIEle);
                        break;
                    }
                }
                if (!equals) {
                    OverviewIndUIElement tableUIEle = new OverviewIndUIElement();
                    tableUIEle.setOverviewIndicator(indicator);
                    tableUIEle.setVirtualNode(true);
                    cataUIEleList.add(tableUIEle);
                }
            }
        }
    }
    return cataUIEleList;
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) ArrayList(java.util.ArrayList) MetadataTable(org.talend.core.model.metadata.builder.connection.MetadataTable) OverviewIndUIElement(org.talend.dataprofiler.core.model.OverviewIndUIElement) ViewIndicator(org.talend.dataquality.indicators.schema.ViewIndicator) DBViewFolderRepNode(org.talend.dq.nodes.DBViewFolderRepNode) DBCalculationViewFolderRepNode(org.talend.dq.nodes.DBCalculationViewFolderRepNode) MetadataTableRepositoryObject(org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject)

Aggregations

ArrayList (java.util.ArrayList)1 MetadataTable (org.talend.core.model.metadata.builder.connection.MetadataTable)1 MetadataTableRepositoryObject (org.talend.core.repository.model.repositoryObject.MetadataTableRepositoryObject)1 OverviewIndUIElement (org.talend.dataprofiler.core.model.OverviewIndUIElement)1 ViewIndicator (org.talend.dataquality.indicators.schema.ViewIndicator)1 DBCalculationViewFolderRepNode (org.talend.dq.nodes.DBCalculationViewFolderRepNode)1 DBViewFolderRepNode (org.talend.dq.nodes.DBViewFolderRepNode)1 IRepositoryNode (org.talend.repository.model.IRepositoryNode)1