use of com.enonic.xp.repo.impl.version.search.ExcludeEntries in project xp by enonic.
the class FindNodesWithVersionDifferenceCommand method getExcludePaths.
private ExcludeEntries getExcludePaths(final InternalContext context) {
if (this.excludes.isEmpty()) {
return ExcludeEntries.empty();
}
final ExcludeEntries.Builder builder = ExcludeEntries.create();
final NodeBranchEntries result = this.nodeStorageService.getBranchNodeVersions(excludes, false, context);
for (final NodeBranchEntry entry : result) {
builder.add(new ExcludeEntry(entry.getNodePath(), false));
}
return builder.build();
}
use of com.enonic.xp.repo.impl.version.search.ExcludeEntries in project xp by enonic.
the class FindNodesWithVersionDifferenceCommand method execute.
public NodeVersionDiffResult execute() {
final InternalContext context = InternalContext.from(ContextAccessor.current());
final ExcludeEntries excludeEntries = getExcludePaths(context);
final SearchResult result = this.nodeSearchService.query(NodeVersionDiffQuery.create().source(source).target(target).nodePath(nodePath).excludes(excludeEntries).size(this.size).batchSize(BATCH_SIZE).build(), SingleRepoStorageSource.create(ContextAccessor.current().getRepositoryId(), SingleRepoStorageSource.Type.VERSION));
return NodeVersionDiffResultFactory.create(result);
}
Aggregations