Search in sources :

Example 1 with PatternSqlSubFolderRepNode

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

the class RepositoryNodeHelper method getModelElementRepNodes.

/**
 * get RepositoryNode which contains a ModelElment(include: Analysis, Report, IndicatorDefinition, Pattern, DqRule)
 * under the parentNode.
 *
 * @param parentNode
 * @param recursive
 * @return
 */
public static List<RepositoryNode> getModelElementRepNodes(RepositoryNode parentNode, boolean recursive) {
    List<RepositoryNode> result = new ArrayList<RepositoryNode>();
    List<IRepositoryNode> children = parentNode.getChildren();
    for (IRepositoryNode node : children) {
        ModelElement modelElementFromRepositoryNode = RepositoryNodeHelper.getModelElementFromRepositoryNode(node);
        if (modelElementFromRepositoryNode != null) {
            result.add((RepositoryNode) node);
        } else {
            boolean isFolder = false;
            if (node instanceof AnalysisFolderRepNode) {
                AnalysisFolderRepNode anaFolderRepNode = (AnalysisFolderRepNode) node;
                isFolder = !anaFolderRepNode.isVirtualFolder();
            } else if (node instanceof ReportFolderRepNode) {
                ReportFolderRepNode repFolderRepNode = (ReportFolderRepNode) node;
                isFolder = !repFolderRepNode.isVirtualFolder();
            } else if (node instanceof UserDefIndicatorFolderRepNode || node instanceof PatternRegexFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLFolderRepNode) {
                isFolder = true;
            }
            if (isFolder && recursive) {
                result.addAll(getModelElementRepNodes((RepositoryNode) node, recursive));
            }
        }
    }
    return result;
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) ReportFolderRepNode(org.talend.dq.nodes.ReportFolderRepNode) PatternSqlSubFolderRepNode(org.talend.dq.nodes.PatternSqlSubFolderRepNode) ArrayList(java.util.ArrayList) UserDefIndicatorFolderRepNode(org.talend.dq.nodes.UserDefIndicatorFolderRepNode) AnalysisFolderRepNode(org.talend.dq.nodes.AnalysisFolderRepNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode) DQRepositoryNode(org.talend.dq.nodes.DQRepositoryNode) RulesSQLFolderRepNode(org.talend.dq.nodes.RulesSQLFolderRepNode) ModelElement(orgomg.cwm.objectmodel.core.ModelElement) PatternRegexFolderRepNode(org.talend.dq.nodes.PatternRegexFolderRepNode) PatternSqlFolderRepNode(org.talend.dq.nodes.PatternSqlFolderRepNode) PatternRegexSubFolderRepNode(org.talend.dq.nodes.PatternRegexSubFolderRepNode)

Example 2 with PatternSqlSubFolderRepNode

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

the class DeleteResourceProvider method shouldShowRenameFolderMenu.

private boolean shouldShowRenameFolderMenu(RepositoryNode node) {
    boolean show = false;
    if (node instanceof AnalysisSubFolderRepNode) {
        AnalysisSubFolderRepNode anaSubFolderNode = (AnalysisSubFolderRepNode) node;
        show = !anaSubFolderNode.isVirtualFolder();
    } else if (node instanceof ReportSubFolderRepNode) {
        ReportSubFolderRepNode repSubFolderNode = (ReportSubFolderRepNode) node;
        show = !repSubFolderNode.isVirtualFolder();
    } else if (node instanceof UserDefIndicatorSubFolderRepNode || node instanceof PatternRegexSubFolderRepNode || node instanceof PatternSqlSubFolderRepNode || node instanceof RulesSQLSubFolderRepNode || node instanceof RulesParserSubFolderRepNode || node instanceof DBConnectionSubFolderRepNode || node instanceof DFConnectionSubFolderRepNode || node instanceof JrxmlTempSubFolderNode) {
        show = true;
    }
    return show;
}
Also used : PatternSqlSubFolderRepNode(org.talend.dq.nodes.PatternSqlSubFolderRepNode) UserDefIndicatorSubFolderRepNode(org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode) PatternRegexSubFolderRepNode(org.talend.dq.nodes.PatternRegexSubFolderRepNode) RulesSQLSubFolderRepNode(org.talend.dq.nodes.RulesSQLSubFolderRepNode) DBConnectionSubFolderRepNode(org.talend.dq.nodes.DBConnectionSubFolderRepNode) DFConnectionSubFolderRepNode(org.talend.dq.nodes.DFConnectionSubFolderRepNode) ReportSubFolderRepNode(org.talend.dq.nodes.ReportSubFolderRepNode) RulesParserSubFolderRepNode(org.talend.dq.nodes.RulesParserSubFolderRepNode) AnalysisSubFolderRepNode(org.talend.dq.nodes.AnalysisSubFolderRepNode) JrxmlTempSubFolderNode(org.talend.dq.nodes.JrxmlTempSubFolderNode)

Aggregations

PatternRegexSubFolderRepNode (org.talend.dq.nodes.PatternRegexSubFolderRepNode)2 PatternSqlSubFolderRepNode (org.talend.dq.nodes.PatternSqlSubFolderRepNode)2 ArrayList (java.util.ArrayList)1 AnalysisFolderRepNode (org.talend.dq.nodes.AnalysisFolderRepNode)1 AnalysisSubFolderRepNode (org.talend.dq.nodes.AnalysisSubFolderRepNode)1 DBConnectionSubFolderRepNode (org.talend.dq.nodes.DBConnectionSubFolderRepNode)1 DFConnectionSubFolderRepNode (org.talend.dq.nodes.DFConnectionSubFolderRepNode)1 DQRepositoryNode (org.talend.dq.nodes.DQRepositoryNode)1 JrxmlTempSubFolderNode (org.talend.dq.nodes.JrxmlTempSubFolderNode)1 PatternRegexFolderRepNode (org.talend.dq.nodes.PatternRegexFolderRepNode)1 PatternSqlFolderRepNode (org.talend.dq.nodes.PatternSqlFolderRepNode)1 ReportFolderRepNode (org.talend.dq.nodes.ReportFolderRepNode)1 ReportSubFolderRepNode (org.talend.dq.nodes.ReportSubFolderRepNode)1 RulesParserSubFolderRepNode (org.talend.dq.nodes.RulesParserSubFolderRepNode)1 RulesSQLFolderRepNode (org.talend.dq.nodes.RulesSQLFolderRepNode)1 RulesSQLSubFolderRepNode (org.talend.dq.nodes.RulesSQLSubFolderRepNode)1 UserDefIndicatorFolderRepNode (org.talend.dq.nodes.UserDefIndicatorFolderRepNode)1 UserDefIndicatorSubFolderRepNode (org.talend.dq.nodes.UserDefIndicatorSubFolderRepNode)1 IRepositoryNode (org.talend.repository.model.IRepositoryNode)1 RepositoryNode (org.talend.repository.model.RepositoryNode)1