Package javax.jcr

Examples of javax.jcr.Node.removeMixin()


        n.setProperty("jcr:title", "blah blah");
        testRootNode.getSession().save();

        // remove mix:title, jcr:title should be gone as there's no matching
        // definition in nt:folder
        n.removeMixin("mix:title");
        testRootNode.getSession().save();
        assertFalse(n.hasProperty("jcr:title"));

        // add mix:title to a nt:unstructured node and set jcr:title property
        Node n1 = testRootNode.addNode(nodeName2, ntUnstructured);
View Full Code Here


        // remove mix:title, jcr:title should stay since it adopts the residual
        // property definition declared in nt:unstructured
        testRootNode.getSession().save();

        n1.removeMixin("mix:title");
        testRootNode.getSession().save();
        assertTrue(n1.hasProperty("jcr:title"));

        assertEquals(
                n1.getProperty("jcr:title").getDefinition().getDeclaringNodeType().getName(),
View Full Code Here

        n2.addMixin(mixReferenceable);
        testRootNode.getSession().save();

        // remove mix:referenceable, jcr:uuid should always get removed
        // since it is a protcted property
        n2.removeMixin(mixReferenceable);
        testRootNode.getSession().save();
        assertFalse(n2.hasProperty("jcr:uuid"));
    }

View Full Code Here

                    // clear existing mixins first
                    Node node = (Node) item;
                    for (NodeType mixin : node.getMixinNodeTypes()) {
                        String mixinName = mixin.getName();
                        if (!newMixins.remove(mixinName)) {
                            node.removeMixin(mixinName);
                        }
                    }
                   
                    // add new mixins
                    for (String mixin : newMixins) {
View Full Code Here

                if (property.getName().equals("jcr:mixinTypes")) {
                   
                    // clear all mixins
                    Node parent = (Node) session.getItem(property.getParentPath());
                    for (NodeType mixin : parent.getMixinNodeTypes()) {
                        parent.removeMixin(mixin.getName());
                    }
                   
                } else {
                   
                    session.getItem(property.getPath()).remove();
View Full Code Here

    public void testRemoveMixinWithoutMixinProperty() throws Exception {
        Node node = testRootNode.addNode(
                "testRemoveMixinWithoutMixinProperty", NT_UNSTRUCTURED);
        superuser.save();
        try {
            node.removeMixin(JcrConstants.MIX_REFERENCEABLE);
            fail();
        } catch (NoSuchNodeTypeException e) {
            // success
        } finally {
            node.remove();
View Full Code Here

                "testRemoveInheritedMixin", NT_UNSTRUCTURED);
        node.addMixin(JcrConstants.MIX_VERSIONABLE);
        superuser.save();

        try {
            node.removeMixin(JcrConstants.MIX_REFERENCEABLE);
            fail();
        } catch (NoSuchNodeTypeException e) {
            // success
        } finally {
            node.remove();
View Full Code Here

                throw new NotExecutableException();
            }

            Node node = superuser.getNode(user.getPath());
            assertTrue(node.isNodeType(JcrConstants.MIX_REFERENCEABLE));
            node.removeMixin(JcrConstants.MIX_REFERENCEABLE);
        catch (NoSuchNodeTypeException e) {
            // success
        } finally {
            superuser.refresh(false);
        }
View Full Code Here

    public void testRemoveMixVersionable() throws Exception {
        Node node = testRootNode.addNode(nodeName1);
        node.addMixin(mixVersionable);
        superuser.save();

        node.removeMixin(mixVersionable);
        superuser.save();
    }

    public void testRemoveMixVersionable1() throws Exception {
        Node node = testRootNode.addNode(nodeName1);
View Full Code Here

        Node node = testRootNode.addNode(nodeName1);
        node.addMixin(mixReferenceable);
        node.addMixin(mixVersionable);
        superuser.save();

        node.removeMixin(mixVersionable);
        superuser.save();
    }

    public void testRemoveAddMixVersionable() throws Exception {
        Node node = testRootNode.addNode(nodeName1);
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.