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());
}
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);
}
Aggregations