Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.Root.commit()


        r.getChild("N6").addChild("N7");
        root.commit();
        root.move("/root/N6/N7", "/root/N3/N12");
        r.getChild("N3").getChild("N12").remove();
        r.getChild("N6").remove();
        root.commit();
    }
   
    private static void checkEqual(Tree tree1, Tree tree2) {
        assertEquals(tree1.getChildrenCount(Long.MAX_VALUE), tree2.getChildrenCount(Long.MAX_VALUE));
        assertEquals(tree1.getPropertyCount(), tree2.getPropertyCount());
View Full Code Here


        Root root = session.getLatestRoot();
        Tree tree = root.getTree("/");
        Tree x = tree.addChild("x");
        Tree y = x.addChild("y");
        Tree z = y.addChild("z");
        root.commit();

        // Acquire a fresh new root to avoid problems from lingering state
        this.root = new ImmutableRoot(session.getLatestRoot(), TreeTypeProvider.EMPTY);
    }
View Full Code Here

        this.treeAPath = treeA.getPath();
        Tree treeB = tree.addChild("tree-b");
        this.treeBPath = treeB.getPath();

        createNodes(treeA, 10, 5)// 111111 nodes in treeA
        root.commit();
    }

    private static void createNodes(Tree tree, int count, int depth) {
        for (int c = 0; c < count; c++) {
            Tree child = tree.addChild("n-" + depth + '-' + c);
View Full Code Here

        Root root1 = session.getLatestRoot();

        // Concurrent changes to trunk: enforce rebase
        Root root2 = session.getLatestRoot();
        root2.getTree("/").addChild("any");
        root2.commit();

        root1.move(treeAPath, PathUtils.concat(treeBPath, "tree-a-moved"));
        root1.commit();
    }
View Full Code Here

            if (root == null || userManager == null) {
                throw new LoginException("Cannot synchronize user.");
            }
            context = syncHandler.createContext(idp, userManager, root);
            context.sync(externalUser);
            root.commit();

            Set<? extends Principal> principals = getPrincipals(externalUser.getId());
            if (!principals.isEmpty()) {
                if (!subject.isReadOnly()) {
                    subject.getPrincipals().addAll(principals);
View Full Code Here

    public void testExactPathFiltering() throws Exception {
        Root root = createRoot();
        Tree tree = root.getTree("/");
        tree.addChild("somenode");
        tree.addChild("someothernode");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "");
        filter.restrictPath("/somenode", Filter.PathRestriction.EXACT);
        Cursor cursor = index.query(filter, store.getRoot());
View Full Code Here

        parent.addChild("child1");
        Tree child2 = parent.addChild("child2");
        child2.addChild("descendant");
        Tree someothernode = tree.addChild("someothernode");
        someothernode.addChild("someotherchild");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "");
        filter.restrictPath("/somenode", Filter.PathRestriction.DIRECT_CHILDREN);
        Cursor cursor = index.query(filter, store.getRoot());
View Full Code Here

        parent.addChild("child1");
        Tree child2 = parent.addChild("child2");
        child2.addChild("descendant");
        Tree someothernode = tree.addChild("someothernode");
        someothernode.addChild("someotherchild");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "");
        filter.restrictPath("/somenode", Filter.PathRestriction.ALL_CHILDREN);
        Cursor cursor = index.query(filter, store.getRoot());
View Full Code Here

        Root root = createRoot();
        Tree tree = root.getTree("/");
        tree.addChild("somenode").setProperty("foo", "bar");
        tree.addChild("someothernode").setProperty("foo", "bard");
        tree.addChild("anotherone").setProperty("foo", "a fool's bar");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        FilterImpl filter = new FilterImpl(mock(SelectorImpl.class), "");
        filter.restrictProperty("foo", Operator.EQUAL, PropertyValues.newString("bar"));
        Cursor cursor = index.query(filter, store.getRoot());
View Full Code Here

        Root root = createRoot();
        Tree tree = root.getTree("/");
        tree.addChild("asamplenode").setProperty("jcr:primaryType", "nt:unstructured");
        tree.addChild("afoldernode").setProperty("jcr:primaryType", "nt:folder");
        tree.addChild("anothersamplenode").setProperty("jcr:primaryType", "nt:unstructured");
        root.commit();

        QueryIndex index = new SolrQueryIndex("solr", server, configuration);
        SelectorImpl selector = mock(SelectorImpl.class);
        Set<String> primaryTypes = new HashSet<String>();
        primaryTypes.add("nt:folder");
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.