Search in sources :

Example 1 with RoutableNodeVersionIds

use of com.enonic.xp.node.RoutableNodeVersionIds in project xp by enonic.

the class PublishContentCommand method commitPushedNodes.

private void commitPushedNodes(final NodeBranchEntries branchEntries) {
    final String commitEntryMessage = message == null ? ContentConstants.PUBLISH_COMMIT_PREFIX : String.join(ContentConstants.PUBLISH_COMMIT_PREFIX_DELIMITER, ContentConstants.PUBLISH_COMMIT_PREFIX, message);
    final NodeCommitEntry commitEntry = NodeCommitEntry.create().message(commitEntryMessage).build();
    final RoutableNodeVersionIds.Builder routableNodeVersionIds = RoutableNodeVersionIds.create();
    for (NodeBranchEntry branchEntry : branchEntries) {
        final RoutableNodeVersionId routableNodeVersionId = RoutableNodeVersionId.from(branchEntry.getNodeId(), branchEntry.getVersionId());
        routableNodeVersionIds.add(routableNodeVersionId);
    }
    nodeService.commit(commitEntry, routableNodeVersionIds.build());
}
Also used : RoutableNodeVersionIds(com.enonic.xp.node.RoutableNodeVersionIds) RoutableNodeVersionId(com.enonic.xp.node.RoutableNodeVersionId) NodeCommitEntry(com.enonic.xp.node.NodeCommitEntry) NodeBranchEntry(com.enonic.xp.node.NodeBranchEntry)

Example 2 with RoutableNodeVersionIds

use of com.enonic.xp.node.RoutableNodeVersionIds in project xp by enonic.

the class NodeServiceImpl method commit.

@Override
public NodeCommitEntry commit(final NodeCommitEntry nodeCommitEntry, final NodeIds nodeIds) {
    verifyContext();
    final InternalContext context = InternalContext.from(ContextAccessor.current());
    final RoutableNodeVersionIds.Builder routableNodeVersionIds = RoutableNodeVersionIds.create();
    final NodeBranchEntries branchNodeVersions = nodeStorageService.getBranchNodeVersions(nodeIds, false, context);
    branchNodeVersions.stream().map(branchEntry -> RoutableNodeVersionId.from(branchEntry.getNodeId(), branchEntry.getVersionId())).forEach(routableNodeVersionIds::add);
    return nodeStorageService.commit(nodeCommitEntry, routableNodeVersionIds.build(), context);
}
Also used : RoutableNodeVersionIds(com.enonic.xp.node.RoutableNodeVersionIds) NodeBranchEntries(com.enonic.xp.node.NodeBranchEntries) FindNodePathsByQueryResult(com.enonic.xp.node.FindNodePathsByQueryResult) NodePaths(com.enonic.xp.node.NodePaths) Nodes(com.enonic.xp.node.Nodes) SetNodeStateResult(com.enonic.xp.node.SetNodeStateResult) FindNodesByMultiRepoQueryResult(com.enonic.xp.node.FindNodesByMultiRepoQueryResult) RepositoryService(com.enonic.xp.repository.RepositoryService) NodeComparison(com.enonic.xp.node.NodeComparison) NodesHasChildrenResult(com.enonic.xp.node.NodesHasChildrenResult) Branch(com.enonic.xp.branch.Branch) Trace(com.enonic.xp.trace.Trace) NodeCommitId(com.enonic.xp.node.NodeCommitId) RepositoryId(com.enonic.xp.repository.RepositoryId) ContextAccessor(com.enonic.xp.context.ContextAccessor) NodeService(com.enonic.xp.node.NodeService) PushNodesResult(com.enonic.xp.node.PushNodesResult) BinaryReference(com.enonic.xp.util.BinaryReference) NodeSearchService(com.enonic.xp.repo.impl.search.NodeSearchService) CreateRootNodeParams(com.enonic.xp.node.CreateRootNodeParams) NodeComparisons(com.enonic.xp.node.NodeComparisons) AccessControlList(com.enonic.xp.security.acl.AccessControlList) Collectors(java.util.stream.Collectors) NodeId(com.enonic.xp.node.NodeId) RenameNodeParams(com.enonic.xp.node.RenameNodeParams) NodeCommitEntry(com.enonic.xp.node.NodeCommitEntry) OrderExpr(com.enonic.xp.query.expr.OrderExpr) RoutableNodeVersionId(com.enonic.xp.node.RoutableNodeVersionId) MoveNodeResult(com.enonic.xp.node.MoveNodeResult) BinaryService(com.enonic.xp.repo.impl.binary.BinaryService) ImportNodeVersionParams(com.enonic.xp.node.ImportNodeVersionParams) ReorderChildNodesResult(com.enonic.xp.node.ReorderChildNodesResult) IndexServiceInternal(com.enonic.xp.repo.impl.index.IndexServiceInternal) NodeVersion(com.enonic.xp.node.NodeVersion) Context(com.enonic.xp.context.Context) ApplyNodePermissionsResult(com.enonic.xp.node.ApplyNodePermissionsResult) LoadNodeResult(com.enonic.xp.node.LoadNodeResult) NodeCommitQuery(com.enonic.xp.node.NodeCommitQuery) FindNodesByParentParams(com.enonic.xp.node.FindNodesByParentParams) FindNodesByQueryResult(com.enonic.xp.node.FindNodesByQueryResult) PushNodesListener(com.enonic.xp.node.PushNodesListener) SyncWorkResolverParams(com.enonic.xp.node.SyncWorkResolverParams) Repository(com.enonic.xp.repository.Repository) RefreshMode(com.enonic.xp.node.RefreshMode) NodeVersionQuery(com.enonic.xp.node.NodeVersionQuery) ResolveSyncWorkResult(com.enonic.xp.node.ResolveSyncWorkResult) NodeStorageService(com.enonic.xp.repo.impl.storage.NodeStorageService) EventPublisher(com.enonic.xp.event.EventPublisher) RoutableNodeVersionIds(com.enonic.xp.node.RoutableNodeVersionIds) CreateNodeParams(com.enonic.xp.node.CreateNodeParams) MultiRepoNodeQuery(com.enonic.xp.node.MultiRepoNodeQuery) GetActiveNodeVersionsParams(com.enonic.xp.node.GetActiveNodeVersionsParams) Node(com.enonic.xp.node.Node) DuplicateNodeParams(com.enonic.xp.node.DuplicateNodeParams) NodeCommitQueryResult(com.enonic.xp.node.NodeCommitQueryResult) NodeNotFoundException(com.enonic.xp.node.NodeNotFoundException) ReorderChildNodesParams(com.enonic.xp.node.ReorderChildNodesParams) GetActiveNodeVersionsResult(com.enonic.xp.node.GetActiveNodeVersionsResult) ImportNodeResult(com.enonic.xp.node.ImportNodeResult) ImportNodeCommitParams(com.enonic.xp.node.ImportNodeCommitParams) Component(org.osgi.service.component.annotations.Component) SetNodeChildOrderParams(com.enonic.xp.node.SetNodeChildOrderParams) Tracer(com.enonic.xp.trace.Tracer) NodeVersionId(com.enonic.xp.node.NodeVersionId) NodeVersionQueryResult(com.enonic.xp.node.NodeVersionQueryResult) NodeEvents(com.enonic.xp.repo.impl.NodeEvents) FieldOrderExpr(com.enonic.xp.query.expr.FieldOrderExpr) Activate(org.osgi.service.component.annotations.Activate) ByteSource(com.google.common.io.ByteSource) NodeQuery(com.enonic.xp.node.NodeQuery) VersionIndexPath(com.enonic.xp.repo.impl.version.VersionIndexPath) InternalContext(com.enonic.xp.repo.impl.InternalContext) NodeVersionKey(com.enonic.xp.blob.NodeVersionKey) NodePath(com.enonic.xp.node.NodePath) GetNodeVersionsParams(com.enonic.xp.node.GetNodeVersionsParams) MoveNodeListener(com.enonic.xp.node.MoveNodeListener) UpdateNodeParams(com.enonic.xp.node.UpdateNodeParams) ImportNodeParams(com.enonic.xp.node.ImportNodeParams) NodeBranchEntries(com.enonic.xp.node.NodeBranchEntries) SetNodeStateParams(com.enonic.xp.node.SetNodeStateParams) BranchNotFoundException(com.enonic.xp.repository.BranchNotFoundException) ApplyNodePermissionsParams(com.enonic.xp.node.ApplyNodePermissionsParams) DeleteNodeListener(com.enonic.xp.node.DeleteNodeListener) FindNodesByParentResult(com.enonic.xp.node.FindNodesByParentResult) Reference(org.osgi.service.component.annotations.Reference) LoadNodeParams(com.enonic.xp.node.LoadNodeParams) MoveNodeParams(com.enonic.xp.node.MoveNodeParams) NodeIds(com.enonic.xp.node.NodeIds) RepositoryNotFoundException(com.enonic.xp.repository.RepositoryNotFoundException) InternalContext(com.enonic.xp.repo.impl.InternalContext)

Aggregations

NodeCommitEntry (com.enonic.xp.node.NodeCommitEntry)2 NodeVersionKey (com.enonic.xp.blob.NodeVersionKey)1 Branch (com.enonic.xp.branch.Branch)1 Context (com.enonic.xp.context.Context)1 ContextAccessor (com.enonic.xp.context.ContextAccessor)1 EventPublisher (com.enonic.xp.event.EventPublisher)1 ApplyNodePermissionsParams (com.enonic.xp.node.ApplyNodePermissionsParams)1 ApplyNodePermissionsResult (com.enonic.xp.node.ApplyNodePermissionsResult)1 CreateNodeParams (com.enonic.xp.node.CreateNodeParams)1 CreateRootNodeParams (com.enonic.xp.node.CreateRootNodeParams)1 DeleteNodeListener (com.enonic.xp.node.DeleteNodeListener)1 DuplicateNodeParams (com.enonic.xp.node.DuplicateNodeParams)1 FindNodePathsByQueryResult (com.enonic.xp.node.FindNodePathsByQueryResult)1 FindNodesByMultiRepoQueryResult (com.enonic.xp.node.FindNodesByMultiRepoQueryResult)1 FindNodesByParentParams (com.enonic.xp.node.FindNodesByParentParams)1 FindNodesByParentResult (com.enonic.xp.node.FindNodesByParentResult)1 FindNodesByQueryResult (com.enonic.xp.node.FindNodesByQueryResult)1 GetActiveNodeVersionsParams (com.enonic.xp.node.GetActiveNodeVersionsParams)1 GetActiveNodeVersionsResult (com.enonic.xp.node.GetActiveNodeVersionsResult)1 GetNodeVersionsParams (com.enonic.xp.node.GetNodeVersionsParams)1