Package org.apache.jackrabbit.spi

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


    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


        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);

        NodeId id = rs.getIdFactory().createNodeId(nid, resolver.getQPath("aNode"));
View Full Code Here

        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);

        NodeId id = rs.getIdFactory().createNodeId(nid, resolver.getQPath("aNode"));
        Iterator<? extends ItemInfo> it = rs.getItemInfos(si, id);
View Full Code Here

            rs.getNodeInfo(si, getNodeId(testPath));
        } catch (RepositoryException e) {
            Batch b = rs.createBatch(si, getNodeId("/"));
            b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null);
            QValueFactory qvf = rs.getQValueFactory();
            b.addProperty(getNodeId("/test"), resolver.getQName("prop"), qvf.create("value", PropertyType.STRING));
            b.addProperty(getNodeId("/test"), resolver.getQName("propMV"), new QValue[] {qvf.create(1), qvf.create(2)});
            rs.submit(b);
        }
    }
View Full Code Here

        } catch (RepositoryException e) {
            Batch b = rs.createBatch(si, getNodeId("/"));
            b.addNode(getNodeId("/"), resolver.getQName("test"), NameConstants.NT_UNSTRUCTURED, null);
            QValueFactory qvf = rs.getQValueFactory();
            b.addProperty(getNodeId("/test"), resolver.getQName("prop"), qvf.create("value", PropertyType.STRING));
            b.addProperty(getNodeId("/test"), resolver.getQName("propMV"), new QValue[] {qvf.create(1), qvf.create(2)});
            rs.submit(b);
        }
    }

    @Override
View Full Code Here

        NodeId content = getNodeId(filePath + "/" + NameConstants.JCR_CONTENT);

        QValue lastModified = rs.getQValueFactory().create(Calendar.getInstance());
        QValue mimeType = rs.getQValueFactory().create("text/plain", PropertyType.STRING);
        QValue enc = rs.getQValueFactory().create("utf-8", PropertyType.STRING);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_LASTMODIFIED), lastModified);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_MIMETYPE), mimeType);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_ENCODING), enc);

        InputStream data = new ByteArrayInputStream("\u0633\u0634".getBytes("UTF-8"));
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_DATA), rs.getQValueFactory().create(data));
View Full Code Here

        QValue lastModified = rs.getQValueFactory().create(Calendar.getInstance());
        QValue mimeType = rs.getQValueFactory().create("text/plain", PropertyType.STRING);
        QValue enc = rs.getQValueFactory().create("utf-8", PropertyType.STRING);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_LASTMODIFIED), lastModified);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_MIMETYPE), mimeType);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_ENCODING), enc);

        InputStream data = new ByteArrayInputStream("\u0633\u0634".getBytes("UTF-8"));
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_DATA), rs.getQValueFactory().create(data));
View Full Code Here

        QValue lastModified = rs.getQValueFactory().create(Calendar.getInstance());
        QValue mimeType = rs.getQValueFactory().create("text/plain", PropertyType.STRING);
        QValue enc = rs.getQValueFactory().create("utf-8", PropertyType.STRING);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_LASTMODIFIED), lastModified);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_MIMETYPE), mimeType);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_ENCODING), enc);

        InputStream data = new ByteArrayInputStream("\u0633\u0634".getBytes("UTF-8"));
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_DATA), rs.getQValueFactory().create(data));

        rs.submit(b);
View Full Code Here

        b.addProperty(content, resolver.getQName(JcrConstants.JCR_LASTMODIFIED), lastModified);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_MIMETYPE), mimeType);
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_ENCODING), enc);

        InputStream data = new ByteArrayInputStream("\u0633\u0634".getBytes("UTF-8"));
        b.addProperty(content, resolver.getQName(JcrConstants.JCR_DATA), rs.getQValueFactory().create(data));

        rs.submit(b);

        // test properties of the file node
        String uri = rs.getItemUri(fileID, si);
View Full Code Here

        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);
        b.remove(pid);
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.