use of com.enonic.xp.repository.CreateBranchParams in project xp by enonic.
the class CreateBranchHandler method doCreateBranch.
private BranchMapper doCreateBranch() {
final CreateBranchParams createBranchParams = CreateBranchParams.from(branchId);
final Branch createdBranch = repositoryServiceSupplier.get().createBranch(createBranchParams);
return createdBranch == null ? null : new BranchMapper(createdBranch);
}
use of com.enonic.xp.repository.CreateBranchParams in project xp by enonic.
the class AbstractNodeTest method createTestRepository.
private void createTestRepository() {
final AccessControlList rootPermissions = AccessControlList.of(AccessControlEntry.create().principal(TEST_DEFAULT_USER.getKey()).allowAll().build());
ContextBuilder.from(ContextAccessor.current()).authInfo(AuthenticationInfo.create().principals(RoleKeys.ADMIN).user(User.ANONYMOUS).build()).build().callWith(() -> {
this.repositoryService.createRepository(CreateRepositoryParams.create().repositoryId(TEST_REPO_ID).rootPermissions(rootPermissions).build());
TEST_REPO_BRANCHES.stream().filter(branch -> !RepositoryConstants.MASTER_BRANCH.equals(branch)).forEach(branch -> {
final CreateBranchParams createBranchParams = CreateBranchParams.from(branch.toString());
this.repositoryService.createBranch(createBranchParams);
});
refresh();
return null;
});
}
Aggregations