Search in sources :

Example 51 with Branch

use of com.enonic.xp.branch.Branch in project xp by enonic.

the class BaseSiteHandler method doCreatePortalRequest.

protected PortalRequest doCreatePortalRequest(final WebRequest webRequest, final String baseUri, final String baseSubPath) {
    final RepositoryId repositoryId = findRepository(baseSubPath);
    final Branch branch = findBranch(baseSubPath);
    final ContentPath contentPath = findContentPath(baseSubPath);
    final PortalRequest portalRequest = new PortalRequest(webRequest);
    portalRequest.setBaseUri(baseUri);
    portalRequest.setRepositoryId(repositoryId);
    portalRequest.setBranch(branch);
    portalRequest.setContentPath(contentPath);
    return portalRequest;
}
Also used : Branch(com.enonic.xp.branch.Branch) ContentPath(com.enonic.xp.content.ContentPath) RepositoryId(com.enonic.xp.repository.RepositoryId) PortalRequest(com.enonic.xp.portal.PortalRequest)

Example 52 with Branch

use of com.enonic.xp.branch.Branch in project xp by enonic.

the class LoadRunnableTask method importRepoBranches.

private RepoLoadResult importRepoBranches(final Path rootDir, final Repository repository) {
    final RepoLoadResult.Builder builder = RepoLoadResult.create(repository.getId());
    for (Branch branch : repository.getBranches()) {
        if (isSystemRepoMaster(repository, branch)) {
            continue;
        }
        final NodeImportResult nodeImportResult = importRepoBranch(repository.getId().toString(), branch.getValue(), rootDir);
        builder.add(NodeImportResultTranslator.translate(nodeImportResult, branch));
    }
    return builder.build();
}
Also used : Branch(com.enonic.xp.branch.Branch) RepoLoadResult(com.enonic.xp.dump.RepoLoadResult) NodeImportResult(com.enonic.xp.export.NodeImportResult)

Aggregations

Branch (com.enonic.xp.branch.Branch)52 Test (org.junit.jupiter.api.Test)19 Node (com.enonic.xp.node.Node)13 RepositoryId (com.enonic.xp.repository.RepositoryId)12 Context (com.enonic.xp.context.Context)10 NodeId (com.enonic.xp.node.NodeId)8 AbstractNodeTest (com.enonic.xp.repo.impl.node.AbstractNodeTest)8 Repository (com.enonic.xp.repository.Repository)7 ContextAccessor (com.enonic.xp.context.ContextAccessor)5 ContextBuilder (com.enonic.xp.context.ContextBuilder)5 ContentId (com.enonic.xp.content.ContentId)4 PropertyTree (com.enonic.xp.data.PropertyTree)4 CreateBranchParams (com.enonic.xp.repository.CreateBranchParams)4 ContentConstants (com.enonic.xp.content.ContentConstants)3 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)3 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)3 GetActiveNodeVersionsResult (com.enonic.xp.node.GetActiveNodeVersionsResult)3 NodeIds (com.enonic.xp.node.NodeIds)3 NodePath (com.enonic.xp.node.NodePath)3 NodeVersionMetadata (com.enonic.xp.node.NodeVersionMetadata)3