Examples of child()


Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

        NodeBuilder sourceBuilder = builder;
        String sourceParent = PathUtils.getParentPath(source);
        for (String name : PathUtils.elements(sourceParent)) {
            if (sourceBuilder.hasChildNode(name)) {
                sourceBuilder = sourceBuilder.child(name);
            } else {
                return false;
            }
        }
        String sourceName = PathUtils.getName(source);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

        String sourceName = PathUtils.getName(source);
        if (!sourceBuilder.hasChildNode(sourceName)) {
            return false;
        }

        NodeState sourceState = sourceBuilder.child(sourceName).getNodeState();
        targetBuilder.setChildNode(targetName, sourceState);

        setRoot(builder.getNodeState());
        return true;
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

    @Test
    public void testSingleNodeCreation() throws Exception {
        NodeState root = EMPTY_NODE;

        NodeBuilder builder = root.builder();
        builder.child("oak:index").child("solr")
                .setProperty(JCR_PRIMARYTYPE, "oak:queryIndexDefinition")
                .setProperty("type", "solr");

        NodeState before = builder.getNodeState();
        builder.child("newnode").setProperty("prop", "val");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

        builder.child("oak:index").child("solr")
                .setProperty(JCR_PRIMARYTYPE, "oak:queryIndexDefinition")
                .setProperty("type", "solr");

        NodeState before = builder.getNodeState();
        builder.child("newnode").setProperty("prop", "val");
        NodeState after = builder.getNodeState();

        NodeState indexed = hook.processCommit(before, after);

        QueryIndex queryIndex = new SolrQueryIndex("solr", server, configuration);
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

    @Test
    public void testPropertyAddition() throws Exception {
        NodeState root = EMPTY_NODE;

        NodeBuilder builder = root.builder();
        builder.child("oak:index").child("solr")
                .setProperty(JCR_PRIMARYTYPE, "oak:queryIndexDefinition")
                .setProperty("type", "solr");

        NodeState before = builder.getNodeState();
        builder.setProperty("foo", "bar");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

        rootBuilder.setChildNode("a", createBC(true));

        NodeState c = rootBuilder.getNodeState().getChildNode("a").getChildNode("c");
        assertTrue(c.hasProperty("c"));

        rootBuilder.child("a").child("c").setProperty("c2", "c2Value");

        c = rootBuilder.getNodeState().getChildNode("a").getChildNode("c");
        assertTrue(c.hasProperty("c"));
        assertTrue(c.hasProperty("c2"));
    }
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

    }

    @Test
    public void testMove() {
        NodeBuilder rootBuilder = base.builder();
        assertTrue(rootBuilder.getChildNode("y").moveTo(rootBuilder.child("x"), "yy"));

        NodeState newRoot = rootBuilder.getNodeState();
        assertFalse(newRoot.hasChildNode("y"));
        assertTrue(newRoot.hasChildNode("x"));
        assertTrue(newRoot.getChildNode("x").hasChildNode("q"));
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

    }

    @Test
    public void testCopy() {
        NodeBuilder rootBuilder = base.builder();
        assertTrue(rootBuilder.getChildNode("y").copyTo(rootBuilder.child("x"), "yy"));

        NodeState newRoot = rootBuilder.getNodeState();
        assertTrue(newRoot.hasChildNode("y"));
        assertTrue(newRoot.hasChildNode("x"));
        assertTrue(newRoot.getChildNode("x").hasChildNode("q"));
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

    }

    @Test
    public void assertion_OAK781() {
        NodeBuilder rootBuilder = EMPTY_NODE.builder();
        rootBuilder.child("a").setChildNode("b", createBC(false));

        NodeState r = rootBuilder.getNodeState();
        NodeState a = r.getChildNode("a");
        NodeState b = a.getChildNode("b");
        NodeState c = b.getChildNode("c");
View Full Code Here

Examples of org.apache.jackrabbit.oak.spi.state.NodeBuilder.child()

        assertTrue(a.exists());
        assertFalse(b.exists());
        assertTrue(c.exists());

        // No assertion must fail in .child("c")
        rootBuilder.child("a").child("b").child("c");

        rootBuilder = new MemoryNodeBuilder(r);

        // No assertion must fail in .child("c")
        rootBuilder.child("a").child("b").child("c");
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.