Examples of orderBefore()


Examples of javax.jcr.Node.orderBefore()

        // give 'add_child_nodes' and 'nt-management' privilege
        // -> not sufficient privileges for a reorder
        allow(path, privilegesFromNames(new String[] {Privilege.JCR_ADD_CHILD_NODES, Privilege.JCR_NODE_TYPE_MANAGEMENT}));

        try {
            n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
            testSession.save();
            fail("test session must not be allowed to reorder nodes.");
        } catch (AccessDeniedException e) {
            // success.
        }
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        // give 'add_child_nodes', 'nt-management' and 'remove_child_nodes' at
        // 'path' -> reorder must succeed
        allow(path, privilegesFromNames(new String[] {Privilege.JCR_ADD_CHILD_NODES,
                Privilege.JCR_REMOVE_CHILD_NODES, Privilege.JCR_NODE_TYPE_MANAGEMENT}));

        n.orderBefore(Text.getName(childNPath2), Text.getName(childNPath));
        testSession.save();
    }

    /**
     * @see <a href="https://issues.apache.org/jira/browse/JCR-2420">JCR-2420</a>
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (int i = 0; i < instructions.length; i++) {
                String srcRelPath = instructions[i].getMemberHandle();
                Position pos = instructions[i].getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (int i = 0; i < instructions.length; i++) {
                String srcRelPath = Text.unescape(instructions[i].getMemberHandle());
                Position pos = instructions[i].getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

        getSession().save();

        NodeIterator it = testNode.getNodes();
        // todo: check order

        testNode.orderBefore("a", "c");
        getSession().save();

        it = testNode.getNodes();
        // todo: check order
    }
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (int i = 0; i < instructions.length; i++) {
                String srcRelPath = Text.unescape(instructions[i].getMemberHandle());
                Position pos = instructions[i].getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of javax.jcr.Node.orderBefore()

            for (OrderPatch.Member instruction : orderPatch.getOrderInstructions()) {
                String srcRelPath = Text.unescape(instruction.getMemberHandle());
                Position pos = instruction.getPosition();
                String destRelPath = getRelDestinationPath(pos, n.getNodes());
                // preform the reordering
                n.orderBefore(srcRelPath, destRelPath);
            }
            complete();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
View Full Code Here

Examples of org.apache.jackrabbit.api.security.JackrabbitAccessControlList.orderBefore()

                    srcEntry = entry;
                }

            }

            acl.orderBefore(srcEntry, destEntry);
            acMgr.setPolicy(path, acl);
            superuser.save();

            /* after reordering the permissions must be denied */
            assertFalse(getTestSession().hasPermission(path, actions));
View Full Code Here

Examples of org.apache.jackrabbit.api.security.JackrabbitAccessControlList.orderBefore()

      // position.
      for (int i = accessControlEntries.length - 1; i >= 0; i--) {
        AccessControlEntry ace = accessControlEntries[i];
        if (principal.equals(ace.getPrincipal())) {
          //this ACE is for the specified principal.
          jacl.orderBefore(ace, beforeEntry);
        }
      }
    } else {
      throw new IllegalArgumentException("The acl must be an instance of JackrabbitAccessControlList");
    }
View Full Code Here

Examples of org.apache.jackrabbit.api.security.JackrabbitAccessControlList.orderBefore()

        root.commit();

        AccessControlEntry[] aces = acl.getAccessControlEntries();
        acl.removeAccessControlEntry(aces[0]);
        acl.removeAccessControlEntry(aces[2]);
        acl.orderBefore(aces[4], aces[3]);
        acl.addAccessControlEntry(principals.get(4), privilegesFromNames(JCR_READ));
        acl.addAccessControlEntry(principals.get(5), privilegesFromNames(JCR_READ));
        acMgr.setPolicy(testPath, acl);
        root.commit();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.