use of com.enonic.xp.node.SearchTarget in project xp by enonic.
the class FindNodesByMultiRepoQueryCommand method execute.
public FindNodesByMultiRepoQueryResult execute() {
final SearchTargets searchTargets = query.getSearchTargets();
final MultiRepoSearchSource.Builder searchSourceBuilder = MultiRepoSearchSource.create();
for (final SearchTarget searchTarget : searchTargets) {
searchSourceBuilder.add(SingleRepoSearchSource.create().branch(searchTarget.getBranch()).repositoryId(searchTarget.getRepositoryId()).acl(searchTarget.getPrincipalKeys()).build());
}
final SearchResult result = nodeSearchService.query(this.query.getNodeQuery(), searchSourceBuilder.build());
return FindNodesByMultiRepoQueryResultFactory.create(result);
}
Aggregations