Package org.apache.jackrabbit.spi

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


        Name propName = resolver.getQName("doubleProp");

        QValue v = rs.getQValueFactory().create(234567);

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
View Full Code Here


        Name propName = resolver.getQName("dateProp");

        QValue v = rs.getQValueFactory().create(Calendar.getInstance());

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
View Full Code Here

        l.add("String value containing \u0633\u0634 unicode chars.");

        for (String val : l) {
            QValue v = vf.create(val, PropertyType.STRING);
            Batch b = rs.createBatch(si, nid);
            b.addProperty(nid, propName, v);
            rs.submit(b);

            PropertyInfo pi = getPropertyInfo(nid, propName);
            assertEquals(v, pi.getValues()[0]);
            assertEquals(v.getString(), pi.getValues()[0].getString());
View Full Code Here

                rs.getQValueFactory().create(NameConstants.MIX_LOCKABLE),
                rs.getQValueFactory().create(NameConstants.JCR_PRIMARYTYPE),
                rs.getQValueFactory().create(NameConstants.NT_VERSION)
        };
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, vs);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertTrue(pi.isMultiValued());
        assertEquals(Arrays.asList(vs), Arrays.asList(pi.getValues()));
View Full Code Here

        NodeId nid = getNodeId(testPath);
        Name propName = resolver.getQName("pathProp");

        QValue v = rs.getQValueFactory().create(resolver.getQPath(testPath));
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
View Full Code Here

        NodeId nid = getNodeId(testPath);
        Name propName = resolver.getQName("booleanProp");

        QValue v = rs.getQValueFactory().create(false);
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertFalse(pi.getValues()[0].getBoolean());
View Full Code Here

        String ref = rs.getNodeInfo(si, nid).getId().getUniqueID();
        Name propName = resolver.getQName("refProp");
        QValue v = rs.getQValueFactory().create(ref, PropertyType.REFERENCE);

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
View Full Code Here

        String ref = rs.getNodeInfo(si, nid).getId().getUniqueID();
        Name propName = resolver.getQName("weakRefProp");
        QValue v = rs.getQValueFactory().create(ref, PropertyType.WEAKREFERENCE);

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
        assertFalse(pi.isMultiValued());
        assertEquals(v, pi.getValues()[0]);
View Full Code Here

        QValue v = rs.getQValueFactory().create(NameConstants.JCR_AUTOCREATED);
        QValue v2 = rs.getQValueFactory().create(NameConstants.JCR_BASEVERSION);
        QValue v3 = rs.getQValueFactory().create(NameConstants.JCR_CONTENT);

        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, propName, v);
        b.setValue(pid, v2);
        b.setValue(pid, v3);
        rs.submit(b);

        PropertyInfo pi = rs.getPropertyInfo(si, getPropertyId(nid, propName));
View Full Code Here

    }

    public void testUseConsumedBatch() throws RepositoryException {
        NodeId nid = getNodeId(testPath);
        Batch b = rs.createBatch(si, nid);
        b.addProperty(nid, resolver.getQName("any"), rs.getQValueFactory().create(1.34));
        rs.submit(b);

        try {
            b.remove(nid);
            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.