nodeIter.nextNode().accept(this);
/** * */ public void testAccept() throws RepositoryException { final Node n = testRootNode; ItemVisitor itemVisitor = new ItemVisitor() { public void visit(Property property) { fail("Wrong accept method executed."); } public void visit(Node node) throws RepositoryException { assertTrue("Visited node is not the same as the one passed in method visit(Node)", n.isSame(node)); } }; n.accept(itemVisitor); }
/** * Returns the descendants of <code>node</code> as an array in document * order. * @param node the starting node. * @return descendants of <code>node</code>. * @throws RepositoryException if an error occurs. */ private Node[] getDescendants(final Node node) throws RepositoryException { final List<Node> descendants = new ArrayList<Node>(); node.accept(new TraversingItemVisitor.Default() { protected void entering(Node n, int level) throws RepositoryException { if (!node.isSame(n)) { descendants.add(n); } } }); return descendants.toArray(new Node[descendants.size()]); } }
@Override public void accept(ItemVisitor visitor) throws RepositoryException { getNode().accept(visitor); }
@Override public void accept(ItemVisitor visitor) throws RepositoryException { getWrappedNode().accept(visitor); }
public void remove() throws RepositoryException { this.item.accept(new RemoveVisitor(false)); }
@Override public void visit(Node node) throws RepositoryException { if (!JcrHelper.isVirtualNode(node)) { if (node.hasProperty("hippotranslation:id")) { visit(node.getProperty("hippotranslation:id")); } NodeIterator children = node.getNodes(); while (children.hasNext()) { children.nextNode().accept(this); } } }
public static NodeIterator collectChildNodes( Node node, String namePattern) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( namePattern, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
public void purge(final String path) throws RepositoryException { if (path != null) { Node _node = getSession().getRootNode().getNode(path.substring(1)); _node.accept(new RemoveVisitor(true)); } }
public static NodeIterator collectChildNodes( Node node, String[] nameGlobs) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( nameGlobs, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
@Override public void onOk() { try { getModel().getObject().accept(new GenerateNewTranslationIdsVisitor()); } catch (RepositoryException e) { log.error("Failure during setting of new translation ids", e); } }
@Override public void onOk() { try { getModel().getObject().accept(new GenerateNewTranslationIdsVisitor()); } catch (RepositoryException e) { log.error("Failure during setting of new translation ids", e); } }
public static NodeIterator collectChildNodes( Node node, String namePattern) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( namePattern, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
public static NodeIterator collectChildNodes( Node node, String[] nameGlobs) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( nameGlobs, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
public static NodeIterator collectChildNodes( Node node, String[] nameGlobs) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( nameGlobs, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
public static NodeIterator collectChildNodes( Node node, String namePattern) throws RepositoryException { Collection<Item> nodes = new ArrayList<Item>(); node.accept(new ChildrenCollectorFilter( namePattern, nodes, true, false, 1)); return new NodeIteratorAdapter(nodes); }
public void traverseWithVisitor(Node root, IVisitor v) { root.accept(v); if (root.left != null) { traverseWithVisitor(root.left, v); } if (root.right != null) { traverseWithVisitor(root.right, v); } }
@Override public void visit(final Node node) throws RepositoryException { if (!((HippoNode)node).isVirtual()) { final String childPath = node.getPath(); if (!autoExportConfig.isExcludedPath(childPath) && ConfigurationItemCategory.SYSTEM != autoExportConfig.getCategoryForItem(childPath, false, currentModel)) { contentPaths.add(node.getPath()); for (Node child : new NodeIterable(node.getNodes())) { child.accept(this); } } } } @Override
@Override public void onOk() { try { getModelObject().accept(new RecomputeVisitor(automaticSave)); if (automaticSave) { UserSession.get().getJcrSession().save(); } } catch (RepositoryException e) { log.error("Error during fixing hippo:paths properties", e); } }
public void visit(Node node) throws RepositoryException { for (Node child : JcrUtils.getChildNodes(node)) { child.accept(this); } }