Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Batch.addNode()


    public void testReorder() throws RepositoryException {
        NodeId nid = getNodeId(testPath);

        Batch b = rs.createBatch(si, nid);
        b.addNode(nid, resolver.getQName("1"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("3"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("2"), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);

        b = rs.createBatch(si, nid);
        b.reorderNodes(nid, getNodeId(testPath + "/3"), null);
View Full Code Here


        NodeId nid = getNodeId(testPath);

        Batch b = rs.createBatch(si, nid);
        b.addNode(nid, resolver.getQName("1"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("3"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("2"), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);

        b = rs.createBatch(si, nid);
        b.reorderNodes(nid, getNodeId(testPath + "/3"), null);
        rs.submit(b);
View Full Code Here

    public void testReorder1() throws RepositoryException {
        NodeId nid = getNodeId(testPath);

        Batch b = rs.createBatch(si, nid);
        b.addNode(nid, resolver.getQName("2"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("3"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("1"), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);

        b = rs.createBatch(si, nid);
View Full Code Here

    public void testReorder1() throws RepositoryException {
        NodeId nid = getNodeId(testPath);

        Batch b = rs.createBatch(si, nid);
        b.addNode(nid, resolver.getQName("2"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("3"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("1"), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);

        b = rs.createBatch(si, nid);
        b.reorderNodes(nid, getNodeId(testPath + "/1"), getNodeId(testPath + "/2"));
View Full Code Here

        NodeId nid = getNodeId(testPath);

        Batch b = rs.createBatch(si, nid);
        b.addNode(nid, resolver.getQName("2"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("3"), NameConstants.NT_UNSTRUCTURED, null);
        b.addNode(nid, resolver.getQName("1"), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);

        b = rs.createBatch(si, nid);
        b.reorderNodes(nid, getNodeId(testPath + "/1"), getNodeId(testPath + "/2"));
        rs.submit(b);
View Full Code Here

    public void testRemove() throws RepositoryException {
        NodeId nid = getNodeId(testPath);
        Batch b = rs.createBatch(si, nid);

        NodeId id = getNodeId(testPath + "/aTestNode");
        b.addNode(nid, resolver.getQName("aTestNode"), NameConstants.NT_UNSTRUCTURED, null);
        b.addProperty(id, resolver.getQName("aString"), rs.getQValueFactory().create("ba", PropertyType.STRING));
        rs.submit(b);

        PropertyId pid = getPropertyId(id, resolver.getQName("aString"));
        b = rs.createBatch(si, nid);
View Full Code Here

    }

    private void createTestNode(String testPath) throws RepositoryException {
        Batch b = rs.createBatch(si, getNodeId("/"));
        String name = Text.getName(testPath);
        b.addNode(getNodeId("/"), resolver.getQName(name), NameConstants.NT_UNSTRUCTURED, null);
        rs.submit(b);
    }

    private void removeTestNode(String path) throws RepositoryException {
        Batch b = rs.createBatch(si, getNodeId("/"));
View Full Code Here

        try {
            rs.getNodeInfo(si, getNodeId(testPath));
        } catch (RepositoryException e) {
            Batch b = rs.createBatch(si, getNodeId("/"));
            b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null);
            rs.submit(b);
        }
    }

    protected void tearDown() throws Exception {
View Full Code Here

       
        try {
            rs.getNodeInfo(si, getNodeId(testPath));
        } catch (RepositoryException e) {
            Batch b = rs.createBatch(si, getNodeId("/"));
            b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null);
            rs.submit(b);
        }
    }

    protected void tearDown() throws Exception {
View Full Code Here

    public void testAddNode() throws RepositoryException {
        NodeId nid = getNodeId(testPath);
        Batch b = rs.createBatch(si, nid);

        b.addNode(nid, resolver.getQName("aNode"), NameConstants.NT_UNSTRUCTURED, null);
        b.addProperty(nid, resolver.getQName("aString"), rs.getQValueFactory().create("ba", PropertyType.STRING));
        b.addProperty(nid, resolver.getQName("aName"), new QValue[] {rs.getQValueFactory().create(NameConstants.JCR_ENCODING), rs.getQValueFactory().create(NameConstants.JCR_DATA)});
        b.addProperty(nid, resolver.getQName("aBinary"), rs.getQValueFactory().create(new byte[] { 'a', 'b', 'c'}));

        rs.submit(b);
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.