Search in sources :

Example 1 with ExcludeEntries

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();
}
Also used : NodeBranchEntries(com.enonic.xp.node.NodeBranchEntries) ExcludeEntry(com.enonic.xp.repo.impl.version.search.ExcludeEntry) ExcludeEntries(com.enonic.xp.repo.impl.version.search.ExcludeEntries) NodeBranchEntry(com.enonic.xp.node.NodeBranchEntry)

Example 2 with ExcludeEntries

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);
}
Also used : InternalContext(com.enonic.xp.repo.impl.InternalContext) ExcludeEntries(com.enonic.xp.repo.impl.version.search.ExcludeEntries) SearchResult(com.enonic.xp.repo.impl.search.result.SearchResult)

Aggregations

ExcludeEntries (com.enonic.xp.repo.impl.version.search.ExcludeEntries)2 NodeBranchEntries (com.enonic.xp.node.NodeBranchEntries)1 NodeBranchEntry (com.enonic.xp.node.NodeBranchEntry)1 InternalContext (com.enonic.xp.repo.impl.InternalContext)1 SearchResult (com.enonic.xp.repo.impl.search.result.SearchResult)1 ExcludeEntry (com.enonic.xp.repo.impl.version.search.ExcludeEntry)1