use of com.enonic.xp.node.NodeIds in project xp by enonic.
the class ResolveSyncWorkCommand method getParentIdsFromPaths.
private NodeIds getParentIdsFromPaths(final NodePaths parentPaths) {
final NodeIds.Builder parentIdBuilder = NodeIds.create();
for (final NodePath parent : parentPaths) {
final NodeId parentId = this.nodeStorageService.getIdForPath(parent, InternalContext.from(ContextAccessor.current()));
if (parentId == null) {
throw new NodeNotFoundException("Cannot find parent with path [" + parent + "]");
}
parentIdBuilder.add(parentId);
}
return parentIdBuilder.build();
}
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()));
}
Aggregations