use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class PushNodeHandler method execute.
@Override
public Object execute() {
final NodeIds.Builder toBePushed = NodeIds.create();
final NodeIds.Builder toBeDeleted = NodeIds.create();
final NodeIds nodeIds = getNodeIds();
if (resolve) {
doResolve(nodeIds, toBePushed, toBeDeleted);
} else {
toBePushed.addAll(getNodeIds());
}
final PushNodesResult push = this.nodeService.push(toBePushed.build(), targetBranch);
final NodeIds deletedNodes = doDelete(toBeDeleted);
return new PushNodesResultMapper(push, deletedNodes);
}
use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class CompareContentsCommand method execute.
public CompareContentResults execute() {
this.nodeService.refresh(RefreshMode.ALL);
final NodeIds nodeIds = ContentNodeHelper.toNodeIds(this.contentIds);
final NodeComparisons comparisons = this.nodeService.compare(nodeIds, this.target);
return CompareResultTranslator.translate(comparisons);
}
use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class ContentNodeHelperTest method toNodeIds.
@Test
public void toNodeIds() {
final ContentIds contentIds = ContentIds.from("e1f57280-d672-4cd8-b674-98e26e5b69ae", "45d67001-7f2b-4093-99ae-639be9fdd1f6");
final NodeIds nodeIds = ContentNodeHelper.toNodeIds(contentIds);
assertEquals(NodeIds.from("e1f57280-d672-4cd8-b674-98e26e5b69ae", "45d67001-7f2b-4093-99ae-639be9fdd1f6"), nodeIds);
}
use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class DeleteNodeByIdCommandTest method delete_with_capital_letter_in_id.
@Test
public void delete_with_capital_letter_in_id() {
final Node node = createNode(CreateNodeParams.create().setNodeId(NodeId.from("myNodeId")).name("myNode").parent(NodePath.ROOT).build());
final Node childNode = createNode(CreateNodeParams.create().setNodeId(NodeId.from("myChildNodeId")).name("myChildNode").parent(node.path()).build());
final NodeIds nodeIds = doDeleteNode(node.id());
assertEquals(2, nodeIds.getSize());
assertNull(getNode(node.id()));
assertNull(getNode(childNode.id()));
}
use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class ResolveContentsToBePublishedCommand method getWorkResult.
private ResolveSyncWorkResult getWorkResult(final ContentId contentId) {
final NodeIds nodeIds = excludedContentIds != null ? NodeIds.from(excludedContentIds.stream().map(id -> NodeId.from(id.toString())).collect(Collectors.toList())) : NodeIds.empty();
final boolean includeChildren = excludeChildrenIds == null || !this.excludeChildrenIds.contains(contentId);
return nodeService.resolveSyncWork(SyncWorkResolverParams.create().includeChildren(includeChildren).includeDependencies(this.includeDependencies).nodeId(NodeId.from(contentId.toString())).excludedNodeIds(nodeIds).branch(this.target).statusesToStopDependenciesSearch(Set.of(CompareStatus.EQUAL)).build());
}
Aggregations