use of org.craftercms.core.service.ItemFilter in project engine by craftercms.
the class SiteItemServiceImpl method getSiteTree.
@Deprecated
@Override
public SiteItem getSiteTree(String url, int depth, String includeByNameRegex, String excludeByNameRegex, Map<String, String> nodeXPathAndExpectedValuePairs) {
CompositeItemFilter compositeFilter = new CompositeItemFilter();
if (CollectionUtils.isNotEmpty(defaultFilters)) {
for (ItemFilter defaultFilter : defaultFilters) {
compositeFilter.addFilter(defaultFilter);
}
}
if (StringUtils.isNotEmpty(includeByNameRegex)) {
compositeFilter.addFilter(new IncludeByNameItemFilter(includeByNameRegex));
}
if (StringUtils.isNotEmpty(excludeByNameRegex)) {
compositeFilter.addFilter(new ExcludeByNameItemFilter(excludeByNameRegex));
}
if (MapUtils.isNotEmpty(nodeXPathAndExpectedValuePairs)) {
for (Map.Entry<String, String> pair : nodeXPathAndExpectedValuePairs.entrySet()) {
compositeFilter.addFilter(new ExpectedNodeValueItemFilter(pair.getKey(), pair.getValue()));
}
}
Tree tree = storeService.findTree(getSiteContext().getContext(), null, url, depth, compositeFilter, null);
if (tree != null) {
return createItemWrapper(tree);
} else {
return null;
}
}
Aggregations