Examples of addMixin()


Examples of javax.jcr.Node.addMixin()

     * @since oak 1.0
     */
    public void testSetEmptyMixins() throws RepositoryException {
        // create node with mixin test:AA
        Node n = testRootNode.addNode("foo", "nt:folder");
        n.addMixin("test:AA");
        superuser.save();

        ((JackrabbitNode) n).setMixins(new String[0]);
        superuser.save();

View Full Code Here

Examples of javax.jcr.Node.addMixin()

    }

    public void testSetMixins() throws RepositoryException {
        // create node with mixin test:AA
        Node n = testRootNode.addNode("foo", "nt:folder");
        n.addMixin("test:AA");
        n.setProperty("test:propAA", "AA");
        n.setProperty("test:propA", "A");
        superuser.save();

        // 'downgrade' from test:AA to test:A
View Full Code Here

Examples of javax.jcr.Node.addMixin()

            node.getNode("myResource").remove();
        }

        Node resource = node.addNode("myResource", "nt:resource");
        // nt:resource not longer referenceable since JCR 2.0
        resource.addMixin("mix:referenceable");
        resource.setProperty("jcr:encoding", ENCODING);
        resource.setProperty("jcr:mimeType", "text/plain");
        resource.setProperty("jcr:data", "Hello w\u00F6rld.", PropertyType.BINARY);
        resource.setProperty("jcr:lastModified", Calendar.getInstance());
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        resource.setProperty("jcr:lastModified", Calendar.getInstance());

        Node resReference = getOrAddNode(node, "reference");
        resReference.setProperty("ref", resource);
        // make this node itself referenceable
        resReference.addMixin("mix:referenceable");

        Node multiReference = node.addNode("multiReference");
        ValueFactory factory = node.getSession().getValueFactory();
        multiReference.setProperty("ref", new Value[] {
            factory.createValue(resource),
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    @Test
    public void getReferences() throws RepositoryException {
        Session session = getAdminSession();
        Node referee = getNode("/foo");
        referee.addMixin("mix:referenceable");
        getNode(TEST_PATH).setProperty("reference", session.getValueFactory().createValue(referee));
        session.save();

        PropertyIterator refs = referee.getReferences();
        assertTrue(refs.hasNext());
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    @Test
    public void getNamedReferences() throws RepositoryException {
        Session session = getAdminSession();
        Node referee = getNode("/foo");
        referee.addMixin("mix:referenceable");
        Value value = session.getValueFactory().createValue(referee);
        getNode(TEST_PATH).setProperty("reference1", value);
        getNode("/bar").setProperty("reference2", value);
        session.save();
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    @Test
    public void getWeakReferences() throws RepositoryException {
        Session session = getAdminSession();
        Node referee = getNode("/foo");
        referee.addMixin("mix:referenceable");
        getNode(TEST_PATH).setProperty("weak-reference", session.getValueFactory().createValue(referee, true));
        session.save();

        PropertyIterator refs = referee.getWeakReferences();
        assertTrue(refs.hasNext());
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    @Test
    public void getNamedWeakReferences() throws RepositoryException {
        Session session = getAdminSession();
        Node referee = getNode("/foo");
        referee.addMixin("mix:referenceable");
        Value value = session.getValueFactory().createValue(referee, true);
        getNode(TEST_PATH).setProperty("weak-reference1", value);
        getNode("/bar").setProperty("weak-reference2", value);
        session.save();
View Full Code Here

Examples of javax.jcr.Node.addMixin()

        Node testNode = getNode(TEST_PATH);
        NodeType[] mix = testNode.getMixinNodeTypes();
        assertEquals(0, mix.length);

        testNode.addMixin("mix:test");
        testNode.getSession().save();

        Session session2 = createAnonymousSession();
        try {
            mix = session2.getNode(TEST_PATH).getMixinNodeTypes();
View Full Code Here

Examples of javax.jcr.Node.addMixin()

    public void workspaceCopyWithReferences() throws RepositoryException {
        Session session = getAdminSession();
        ValueFactory vf = session.getValueFactory();
        Node root = session.getRootNode();
        Node other = root.addNode("other");
        other.addMixin("mix:referenceable");
        Node src = root.addNode("src");
        Node test = src.addNode("test");
        test.addMixin("mix:referenceable");
        src.setProperty("test", test);
        src.setProperty("other", other);
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.