Search in sources :

Example 1 with JrxmlTempFolderRepNode

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

the class RepositoryNodeHelper method getJrxmlFileRepNodes.

/**
 * get JrxmlTempleteRepNodes which under the parentNode.
 *
 * @param parentNode
 * @param recursive
 * @return
 */
public static List<JrxmlTempleteRepNode> getJrxmlFileRepNodes(IRepositoryNode parentNode, boolean recursive) {
    List<JrxmlTempleteRepNode> result = new ArrayList<JrxmlTempleteRepNode>();
    List<IRepositoryNode> children = parentNode.getChildren();
    for (IRepositoryNode node : children) {
        if (node instanceof JrxmlTempleteRepNode) {
            result.add((JrxmlTempleteRepNode) node);
        } else if (node instanceof JrxmlTempFolderRepNode || node instanceof JrxmlTempSubFolderNode) {
            if (recursive) {
                result.addAll(getJrxmlFileRepNodes(node, recursive));
            }
        }
    }
    return result;
}
Also used : IRepositoryNode(org.talend.repository.model.IRepositoryNode) JrxmlTempFolderRepNode(org.talend.dq.nodes.JrxmlTempFolderRepNode) ArrayList(java.util.ArrayList) JrxmlTempleteRepNode(org.talend.dq.nodes.JrxmlTempleteRepNode) JrxmlTempSubFolderNode(org.talend.dq.nodes.JrxmlTempSubFolderNode)

Example 2 with JrxmlTempFolderRepNode

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

the class RepositoryNodeBuilder method createRepositoryNode.

private RepositoryNode createRepositoryNode(IRepositoryViewObject folder, RepositoryNode parentNode, EResourceConstant resConstant, org.talend.core.model.general.Project inWhichProject) throws PersistenceException {
    DQRepositoryNode subFolderNode = null;
    switch(resConstant) {
        case ANALYSIS:
            AnalysisFolderRepNode anaFolderNode = new AnalysisFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(anaFolderNode);
            parentNode.getChildren().add(anaFolderNode);
            return anaFolderNode;
        case REPORTS:
            ReportFolderRepNode repFolderNode = new ReportFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(repFolderNode);
            parentNode.getChildren().add(repFolderNode);
            return repFolderNode;
        case INDICATORS:
            IndicatorFolderRepNode indicatorFolderRepNode = new IndicatorFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(indicatorFolderRepNode);
            parentNode.getChildren().add(indicatorFolderRepNode);
            return indicatorFolderRepNode;
        case JRXML_TEMPLATE:
            JrxmlTempFolderRepNode jrxmlFolderNode = new JrxmlTempFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(jrxmlFolderNode);
            parentNode.getChildren().add(jrxmlFolderNode);
            return jrxmlFolderNode;
        case SOURCE_FILES:
            SourceFileFolderRepNode sourceFileFolder = new SourceFileFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(sourceFileFolder);
            parentNode.getChildren().add(sourceFileFolder);
            return sourceFileFolder;
        case PATTERNS:
            PatternFolderRepNode patternFolder = new PatternFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(patternFolder);
            parentNode.getChildren().add(patternFolder);
            return patternFolder;
        case RULES:
            RulesFolderRepNode ruleFolder = new RulesFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(ruleFolder);
            parentNode.getChildren().add(ruleFolder);
            return ruleFolder;
        case DB_CONNECTIONS:
            DBConnectionFolderRepNode dbFolder = new DBConnectionFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(dbFolder);
            parentNode.getChildren().add(dbFolder);
            return dbFolder;
        case FILEDELIMITED:
            DFConnectionFolderRepNode dfmFolder = new DFConnectionFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(dfmFolder);
            parentNode.getChildren().add(dfmFolder);
            return dfmFolder;
        case HADOOP_CLUSTER:
            if (HadoopClusterUtils.getDefault().isServiceInstalled()) {
                HadoopClusterFolderRepNode hcFolder = new HadoopClusterFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
                folder.setRepositoryNode(hcFolder);
                parentNode.getChildren().add(hcFolder);
                return hcFolder;
            }
        case EXCHANGE:
            ExchangeFolderRepNode exchangeFolder = new ExchangeFolderRepNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(exchangeFolder);
            parentNode.getChildren().add(exchangeFolder);
            return exchangeFolder;
        default:
            subFolderNode = new DQRepositoryNode(folder, parentNode, ENodeType.SYSTEM_FOLDER, inWhichProject);
            folder.setRepositoryNode(subFolderNode);
            parentNode.getChildren().add(subFolderNode);
            if (resConstant.equals(EResourceConstant.PATTERNS)) {
                // MOD gdbu 2011-8-26 bug 23303 : initialization regex and sql folder when initialization pattern folder
                createRepositoryNodeSubSystemFolder(subFolderNode, EResourceConstant.PATTERN_REGEX, inWhichProject);
                createRepositoryNodeSubSystemFolder(subFolderNode, EResourceConstant.PATTERN_SQL, inWhichProject);
            }
            break;
    }
    return subFolderNode;
}
Also used : DQRepositoryNode(org.talend.dq.nodes.DQRepositoryNode) IndicatorFolderRepNode(org.talend.dq.nodes.IndicatorFolderRepNode) SourceFileFolderRepNode(org.talend.dq.nodes.SourceFileFolderRepNode) JrxmlTempFolderRepNode(org.talend.dq.nodes.JrxmlTempFolderRepNode) HadoopClusterFolderRepNode(org.talend.dq.nodes.hadoopcluster.HadoopClusterFolderRepNode) PatternFolderRepNode(org.talend.dq.nodes.PatternFolderRepNode) RulesFolderRepNode(org.talend.dq.nodes.RulesFolderRepNode) ReportFolderRepNode(org.talend.dq.nodes.ReportFolderRepNode) AnalysisFolderRepNode(org.talend.dq.nodes.AnalysisFolderRepNode) ExchangeFolderRepNode(org.talend.dataprofiler.core.ui.exchange.ExchangeFolderRepNode) DBConnectionFolderRepNode(org.talend.dq.nodes.DBConnectionFolderRepNode) DFConnectionFolderRepNode(org.talend.dq.nodes.DFConnectionFolderRepNode)

Aggregations

JrxmlTempFolderRepNode (org.talend.dq.nodes.JrxmlTempFolderRepNode)2 ArrayList (java.util.ArrayList)1 ExchangeFolderRepNode (org.talend.dataprofiler.core.ui.exchange.ExchangeFolderRepNode)1 AnalysisFolderRepNode (org.talend.dq.nodes.AnalysisFolderRepNode)1 DBConnectionFolderRepNode (org.talend.dq.nodes.DBConnectionFolderRepNode)1 DFConnectionFolderRepNode (org.talend.dq.nodes.DFConnectionFolderRepNode)1 DQRepositoryNode (org.talend.dq.nodes.DQRepositoryNode)1 IndicatorFolderRepNode (org.talend.dq.nodes.IndicatorFolderRepNode)1 JrxmlTempSubFolderNode (org.talend.dq.nodes.JrxmlTempSubFolderNode)1 JrxmlTempleteRepNode (org.talend.dq.nodes.JrxmlTempleteRepNode)1 PatternFolderRepNode (org.talend.dq.nodes.PatternFolderRepNode)1 ReportFolderRepNode (org.talend.dq.nodes.ReportFolderRepNode)1 RulesFolderRepNode (org.talend.dq.nodes.RulesFolderRepNode)1 SourceFileFolderRepNode (org.talend.dq.nodes.SourceFileFolderRepNode)1 HadoopClusterFolderRepNode (org.talend.dq.nodes.hadoopcluster.HadoopClusterFolderRepNode)1 IRepositoryNode (org.talend.repository.model.IRepositoryNode)1