this.repo = repository;
this.nodeTypes = nodeTypes;
this.workspaceName = workspaceName;
this.includeSystemContent = includeSystemContent;
this.systemWorkspaceName = includeSystemContent ? repo.getSystemWorkspaceName() : null;
this.queryableFilter = new NodeFilter() {
@Override
public final boolean includeNode( CachedNode node,
NodeCache cache ) {
// Include only queryable nodes ...
return node.isQueryable(cache);
}
@Override
public String toString() {
return "(queryable nodes)";
}
};
if (!this.includeSystemContent) {
final String systemWorkspaceKey = repo.getSystemWorkspaceKey();
this.queryableAndNonSystemFilter = new NodeFilter() {
@Override
public final boolean includeNode( CachedNode node,
NodeCache cache ) {
// Include only queryable nodes that are NOT in the system workspace ...
return node.isQueryable(cache) && !node.getKey().getWorkspaceKey().equals(systemWorkspaceKey);