Package javax.jcr

Examples of javax.jcr.Node.removeMixin()


        node.addMixin(mixinName);
        testRootNode.getSession().save();
        node.checkin();

        try {
            node.removeMixin(mixinName);
            fail("Node.removeMixin(String mixinName) must throw a " +
                    "VersionException if the node is checked-in.");
        } catch (VersionException e) {
            // success
        }
View Full Code Here


        // Removing the mixin will either succeed or will fail with a
        // ConstraintViolationException
        // (per Section 14.15 of JSR-283 specification)
        try {
            // remove mixin
            b.removeMixin(mixShareable);
            b.getSession().save();
            // If this happens, then b shouldn't be shareable anymore ...
            assertFalse(b.isNodeType(mixShareable));
        } catch (ConstraintViolationException e) {
            // one possible outcome if removing 'mix:shareable' isn't supported
View Full Code Here

                    if (mixins.contains(name)){
                        // do not add existing mixins
                        mixins.remove(name);
                    } else {
                        // remove mixin that are not contained in the new list
                        n.removeMixin(name);
                    }
                }

                // add the remaining mixing types that are not yet set
                for (String mixin : mixins) {
View Full Code Here

        if (JCR_MIXINNODETYPES.equals(propertyName)) {
            // remove all mixin nodetypes
            try {
                Node n = (Node)item;
                for (NodeType mixin : n.getMixinNodeTypes()) {
                    n.removeMixin(mixin.getName());
                }
            } catch (RepositoryException e) {
                // NoSuchNodeTypeException, ConstraintViolationException should never occur...
                throw new JcrDavException(e);
            }
View Full Code Here

            testRootNode.save();
        } catch (RepositoryException e) {
            throw new NotExecutableException();
        }

        node.removeMixin(mixReferenceable);
        assertTrue("Removing Mixin must not take effect but after Node has been saved.", node.isNodeType(mixReferenceable));
        List<NodeType> mixins = Arrays.asList(node.getMixinNodeTypes());
        assertTrue("Removing Mixin must not take effect but after Node has been saved.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
    }
View Full Code Here

            node.addMixin(mixReferenceable);
        } catch (RepositoryException e) {
            throw new NotExecutableException();
        }

        node.removeMixin(mixReferenceable);
        testRootNode.save();

        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", node.isNodeType(mixReferenceable));
        List<NodeType> mixins = Arrays.asList(node.getMixinNodeTypes());
        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
View Full Code Here

        } catch (RepositoryException e) {
            throw new NotExecutableException();
        }

        node.addMixin(mixReferenceable);
        node.removeMixin(mixReferenceable);
        testRootNode.save();

        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", node.isNodeType(mixReferenceable));
        List<NodeType> mixins = Arrays.asList(node.getMixinNodeTypes());
        assertFalse("Adding + Removing a mixin within the same batch must have not effect.", mixins.contains(ntMgr.getNodeType(mixReferenceable)));
View Full Code Here

        testRootNode.save();

        Lock l = n.lock(true, true);

        try {
            n.removeMixin(mixLockable);
            n.save();
            fail("Removing mix:lockable from a locked node must fail.");
        } catch (ConstraintViolationException e) {
            // success
        } finally {
View Full Code Here

        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

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.