use of org.talend.dq.nodes.UserDefIndicatorFolderRepNode 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;
}
use of org.talend.dq.nodes.UserDefIndicatorFolderRepNode in project tdq-studio-se by Talend.
the class RepositoryNodeHelper method getUdisRepositoryNodes.
/**
* get all of UDI
*
* @param withDeleted care about which move into recycle bin
* @return the list of UDI
*/
public static List<IRepositoryNode> getUdisRepositoryNodes(boolean withDeleted) {
// EResourceConstant.LIBRARIES.getName());
RepositoryNode node = getRootNode(ERepositoryObjectType.TDQ_LIBRARIES);
List<IRepositoryNode> udisNodes = new ArrayList<IRepositoryNode>();
if (node != null) {
List<IRepositoryNode> childrens = node.getChildren();
for (IRepositoryNode subNode : childrens) {
if (EResourceConstant.INDICATORS.getName().equals((subNode.getObject().getLabel()))) {
List<IRepositoryNode> subChildren = subNode.getChildren();
for (IRepositoryNode udisNode : subChildren) {
if (udisNode instanceof UserDefIndicatorFolderRepNode) {
udisNodes.addAll(getModelElementFromFolder(udisNode, withDeleted));
}
}
}
}
}
return udisNodes;
}
Aggregations