Search in sources :

Example 1 with CreateBranchParams

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);
}
Also used : Branch(com.enonic.xp.branch.Branch) CreateBranchParams(com.enonic.xp.repository.CreateBranchParams) BranchMapper(com.enonic.xp.lib.repo.mapper.BranchMapper)

Example 2 with CreateBranchParams

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;
    });
}
Also used : AccessControlList(com.enonic.xp.security.acl.AccessControlList) BeforeEach(org.junit.jupiter.api.BeforeEach) Nodes(com.enonic.xp.node.Nodes) Arrays(java.util.Arrays) IdProviderKey(com.enonic.xp.security.IdProviderKey) QueryParser(com.enonic.xp.query.parser.QueryParser) IndexServiceInternalImpl(com.enonic.xp.repo.impl.elasticsearch.IndexServiceInternalImpl) SystemRepoInitializer(com.enonic.xp.repo.impl.repository.SystemRepoInitializer) Segment(com.enonic.xp.blob.Segment) AbstractElasticsearchIntegrationTest(com.enonic.xp.repo.impl.elasticsearch.AbstractElasticsearchIntegrationTest) NodeRepositoryServiceImpl(com.enonic.xp.repo.impl.repository.NodeRepositoryServiceImpl) SchedulerConstants(com.enonic.xp.scheduler.SchedulerConstants) Branch(com.enonic.xp.branch.Branch) IndexDataServiceImpl(com.enonic.xp.repo.impl.storage.IndexDataServiceImpl) CommitServiceImpl(com.enonic.xp.repo.impl.commit.CommitServiceImpl) RepositoryId(com.enonic.xp.repository.RepositoryId) ContextAccessor(com.enonic.xp.context.ContextAccessor) IndexServiceImpl(com.enonic.xp.repo.impl.index.IndexServiceImpl) ContextBuilder(com.enonic.xp.context.ContextBuilder) StorageDaoImpl(com.enonic.xp.repo.impl.elasticsearch.storage.StorageDaoImpl) Path(java.nio.file.Path) PushNodesResult(com.enonic.xp.node.PushNodesResult) IndexNameResolver(com.enonic.xp.repo.impl.repository.IndexNameResolver) User(com.enonic.xp.security.User) CreateRootNodeParams(com.enonic.xp.node.CreateRootNodeParams) AccessControlList(com.enonic.xp.security.acl.AccessControlList) NodeId(com.enonic.xp.node.NodeId) CreateRepositoryParams(com.enonic.xp.repository.CreateRepositoryParams) IndexType(com.enonic.xp.index.IndexType) NodeCommitEntry(com.enonic.xp.node.NodeCommitEntry) SearchDaoImpl(com.enonic.xp.repo.impl.elasticsearch.search.SearchDaoImpl) VersionServiceImpl(com.enonic.xp.repo.impl.version.VersionServiceImpl) TempDir(org.junit.jupiter.api.io.TempDir) NodeStorageServiceImpl(com.enonic.xp.repo.impl.storage.NodeStorageServiceImpl) BinaryServiceImpl(com.enonic.xp.repo.impl.binary.BinaryServiceImpl) NodeSearchServiceImpl(com.enonic.xp.repo.impl.search.NodeSearchServiceImpl) RoleKeys(com.enonic.xp.security.RoleKeys) Context(com.enonic.xp.context.Context) FindNodesByParentParams(com.enonic.xp.node.FindNodesByParentParams) RepositoryConstants(com.enonic.xp.repository.RepositoryConstants) FindNodesByQueryResult(com.enonic.xp.node.FindNodesByQueryResult) AccessControlEntry(com.enonic.xp.security.acl.AccessControlEntry) ContentConstants(com.enonic.xp.content.ContentConstants) EventPublisher(com.enonic.xp.event.EventPublisher) CreateNodeParams(com.enonic.xp.node.CreateNodeParams) Node(com.enonic.xp.node.Node) RepositoryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryServiceImpl) SchedulerRepoInitializer(com.enonic.xp.impl.scheduler.SchedulerRepoInitializer) SegmentLevel(com.enonic.xp.blob.SegmentLevel) CreateBranchParams(com.enonic.xp.repository.CreateBranchParams) AuditLogRepoInitializer(com.enonic.xp.core.impl.audit.AuditLogRepoInitializer) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) NodeQuery(com.enonic.xp.node.NodeQuery) RepositoryEntryServiceImpl(com.enonic.xp.repo.impl.repository.RepositoryEntryServiceImpl) PropertyTree(com.enonic.xp.data.PropertyTree) RepoConfiguration(com.enonic.xp.repo.impl.config.RepoConfiguration) RepositorySegmentUtils(com.enonic.xp.repository.RepositorySegmentUtils) Iterator(java.util.Iterator) InternalContext(com.enonic.xp.repo.impl.InternalContext) NodePath(com.enonic.xp.node.NodePath) AuthenticationInfo(com.enonic.xp.security.auth.AuthenticationInfo) Branches(com.enonic.xp.branch.Branches) UpdateNodeParams(com.enonic.xp.node.UpdateNodeParams) Mockito(org.mockito.Mockito) PatternIndexConfigDocument(com.enonic.xp.index.PatternIndexConfigDocument) NodeBranchEntries(com.enonic.xp.node.NodeBranchEntries) NodeVersionServiceImpl(com.enonic.xp.repo.impl.node.dao.NodeVersionServiceImpl) PrincipalKey(com.enonic.xp.security.PrincipalKey) Reference(com.enonic.xp.util.Reference) AuditLogConstants(com.enonic.xp.core.impl.audit.AuditLogConstants) FindNodesByParentResult(com.enonic.xp.node.FindNodesByParentResult) MemoryBlobStore(com.enonic.xp.internal.blobstore.MemoryBlobStore) NodeIds(com.enonic.xp.node.NodeIds) BranchServiceImpl(com.enonic.xp.repo.impl.branch.storage.BranchServiceImpl) CreateBranchParams(com.enonic.xp.repository.CreateBranchParams)

Aggregations

Branch (com.enonic.xp.branch.Branch)2 Segment (com.enonic.xp.blob.Segment)1 SegmentLevel (com.enonic.xp.blob.SegmentLevel)1 Branches (com.enonic.xp.branch.Branches)1 ContentConstants (com.enonic.xp.content.ContentConstants)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 ContextBuilder (com.enonic.xp.context.ContextBuilder)1 AuditLogConstants (com.enonic.xp.core.impl.audit.AuditLogConstants)1 AuditLogRepoInitializer (com.enonic.xp.core.impl.audit.AuditLogRepoInitializer)1 PropertyTree (com.enonic.xp.data.PropertyTree)1 EventPublisher (com.enonic.xp.event.EventPublisher)1 SchedulerRepoInitializer (com.enonic.xp.impl.scheduler.SchedulerRepoInitializer)1 IndexType (com.enonic.xp.index.IndexType)1 PatternIndexConfigDocument (com.enonic.xp.index.PatternIndexConfigDocument)1 MemoryBlobStore (com.enonic.xp.internal.blobstore.MemoryBlobStore)1 BranchMapper (com.enonic.xp.lib.repo.mapper.BranchMapper)1 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)1 CreateRootNodeParams (com.enonic.xp.node.CreateRootNodeParams)1 FindNodesByParentParams (com.enonic.xp.node.FindNodesByParentParams)1