use of com.enonic.xp.node.FindNodesByParentParams in project xp by enonic.
the class SecurityServiceImpl method getIdProviders.
@Override
public IdProviders getIdProviders() {
final FindNodesByParentParams findByParent = FindNodesByParentParams.create().parentPath(IdProviderNodeTranslator.getIdProvidersParentPath()).build();
final Nodes nodes = callWithContext(() -> {
final FindNodesByParentResult result = this.nodeService.findByParent(findByParent);
return this.nodeService.getByIds(result.getNodeIds());
});
return IdProviderNodeTranslator.fromNodes(nodes);
}
use of com.enonic.xp.node.FindNodesByParentParams in project xp by enonic.
the class ApplyNodePermissionsCommand method applyPermissionsToChildren.
private void applyPermissionsToChildren(final Node parent) {
final AccessControlList parentPermissions = parent.getPermissions();
final FindNodesByParentParams findByParentParams = FindNodesByParentParams.create().parentPath(parent.path()).size(NodeSearchService.GET_ALL_SIZE_FLAG).build();
final FindNodesByParentResult result = doFindNodesByParent(findByParentParams);
final Nodes children = GetNodesByIdsCommand.create(this).ids(result.getNodeIds()).build().execute();
for (Node child : children) {
applyPermissions(parentPermissions, child);
}
}
use of com.enonic.xp.node.FindNodesByParentParams in project xp by enonic.
the class RepositoryEntryServiceImpl method findRepositoryEntryIds.
@Override
public RepositoryIds findRepositoryEntryIds() {
final ImmutableList.Builder<RepositoryId> repositoryIds = ImmutableList.builder();
final FindNodesByParentParams findNodesByParentParams = FindNodesByParentParams.create().parentPath(RepositoryConstants.REPOSITORY_STORAGE_PARENT_PATH).size(-1).build();
final FindNodesByParentResult findNodesByParentResult = createContext().callWith(() -> FindNodesByParentCommand.create().params(findNodesByParentParams).indexServiceInternal(this.indexServiceInternal).storageService(this.nodeStorageService).searchService(this.nodeSearchService).build().execute());
findNodesByParentResult.getNodeIds().stream().map(nodeId -> RepositoryId.from(nodeId.toString())).forEach(repositoryIds::add);
return RepositoryIds.from(repositoryIds.build());
}
Aggregations