/** * Rename the path of the node with the minimal key. That is, assuming * <code>node</code> is the node with the minimal key (see * {@link #getMinimal()}), this method renames every segment of the path of * <code>node</code> up to {@link TreeManager#getRoot()} to <code>key</code> * . <em>Note: </em> If <code>node</code> is not the node with the minimal * key, the behavior of this method is not specified. */ protected final void renamePath(Node node, String key) throws RepositoryException { if (!treeManager.isRoot(node)) { Node p = node.getParent(); renamePath(p, key); Session s = node.getSession(); s.move(node.getPath(), p.getPath() + "/" + key); // If orderable, move to first child node if (p.getPrimaryNodeType().hasOrderableChildNodes()) { p.orderBefore(key, p.getNodes().nextNode().getName()); } } }
/** * Rename the path of the node with the minimal key. That is, assuming * <code>node</code> is the node with the minimal key (see * {@link #getMinimal()}), this method renames every segment of the path of * <code>node</code> up to {@link TreeManager#getRoot()} to <code>key</code> * . <em>Note: </em> If <code>node</code> is not the node with the minimal * key, the behavior of this method is not specified. */ protected final void renamePath(Node node, String key) throws RepositoryException { if (!treeManager.isRoot(node)) { Node p = node.getParent(); renamePath(p, key); Session s = node.getSession(); s.move(node.getPath(), p.getPath() + "/" + key); // If orderable, move to first child node if (p.getPrimaryNodeType().hasOrderableChildNodes()) { p.orderBefore(key, p.getNodes().nextNode().getName()); } } }
/** * Rename the path of the node with the minimal key. That is, assuming * <code>node</code> is the node with the minimal key (see * {@link #getMinimal()}), this method renames every segment of the path of * <code>node</code> up to {@link TreeManager#getRoot()} to <code>key</code> * . <em>Note: </em> If <code>node</code> is not the node with the minimal * key, the behavior of this method is not specified. */ protected final void renamePath(Node node, String key) throws RepositoryException { if (!treeManager.isRoot(node)) { Node p = node.getParent(); renamePath(p, key); Session s = node.getSession(); s.move(node.getPath(), p.getPath() + "/" + key); // If orderable, move to first child node if (p.getPrimaryNodeType().hasOrderableChildNodes()) { p.orderBefore(key, p.getNodes().nextNode().getName()); } } }