/** * Called when the <code>Visitor</code> is passed to a * <code>Property</code>. * <p> * It calls <code>TraversingItemVisitor.entering(Property, int)</code> * followed by <code>TraversingItemVisitor.leaving(Property, int)</code>. * Implement these abstract methods to specify behavior on 'arrival at' and * 'after leaving' the <code>Property</code>. * <p> * If this method throws, the visiting process is aborted. * * @param property the <code>Property</code> that is accepting this * visitor. * @throws RepositoryException if an error occurs. */ public void visit(Property property) throws RepositoryException { entering(property, currentLevel); leaving(property, currentLevel); }
public void visit(Node node) throws RepositoryException { // do not traverse into virtual paths if(!JcrHelper.isVirtualNode(node)) { super.visit(node); } }
private void assertEntry(final int index, final boolean isAllow) throws RepositoryException { AccessControlEntry first = AccessControlUtils.getAccessControlList(superuser, path).getAccessControlEntries()[index]; assertEquals(testUser.getPrincipal(), first.getPrincipal()); Node n = superuser.getNode("/jcr:system/rep:permissionStore/default/" + testUser.getPrincipal().getName()); TraversingItemVisitor v = new TraversingItemVisitor.Default(true, -1) { @Override protected void entering(Node node, int level) throws RepositoryException { if (node.isNodeType("rep:Permissions") && node.hasProperty("rep:accessControlledPath") && path.equals(node.getProperty("rep:accessControlledPath").getString())) { assertEquals(index, node.getProperty("rep:index").getLong()); assertEquals(isAllow, node.getProperty("rep:isAllow").getBoolean()); } } }; v.visit(n); } }