Package javax.jcr

Examples of javax.jcr.Node.removeMixin()


        Node node = testRootNode.addNode(nodeName1);
        node.addMixin(mixVersionable);
        superuser.save();
        String vhId = node.getVersionHistory().getUUID();

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

        assertFalse(vhId.equals(node.getVersionHistory().getUUID()));
    }
View Full Code Here


        node.addMixin(mixReferenceable);
        node.addMixin(mixVersionable);
        superuser.save();
        String vhId = node.getVersionHistory().getUUID();

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

        assertEquals(vhId, node.getVersionHistory().getUUID());
    }
View Full Code Here

                    }
                }
            }
            // remove mix referenceable if it was temporarily added
            if (addMixRef) {
                node.removeMixin(JcrConstants.MIX_REFERENCEABLE);
            }
            return node;

        } catch (SAXException e) {
            Exception root = e.getException();
View Full Code Here

            try {
                for (Iterator it = added.iterator(); it.hasNext();) {
                    node.addMixin((String) it.next());
                }
                for (Iterator it = rems.iterator(); it.hasNext();) {
                    node.removeMixin((String) it.next());
                }
                String delim = "Mixins: ";
                for (NodeType nt: node.getMixinNodeTypes()) {
                    System.out.print(delim);
                    System.out.print(nt.getName());
View Full Code Here

                            dst.addMixin(nt.getName());
                        }
                    }
                    // handle removed mixins
                    for (String mix: names) {
                        dst.removeMixin(mix);
                    }
                } else {
                    // add mixins
                    for (NodeType nt: src.getMixinNodeTypes()) {
                        dst.addMixin(checkNameSpace(nt.getName()));
View Full Code Here

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

        try {
            node.removeMixin(mixinName);
        } catch (ConstraintViolationException e) {
            /**
             * In some implementations it may not be possible to remove mixin node
             * types (short of removing the node itself). In these cases this
             * method will throw a ConstraintViolationException.
View Full Code Here

        if (notAssignedMixin == null) {
            throw new NotExecutableException("No testable mixin node type found");
        }

        try {
            node.removeMixin(notAssignedMixin);
            fail("Node.removeMixin(String mixinName) must throw a " +
                    "NoSuchNodeTypeException if Node does not have the " +
                    "specified mixin.");
        } catch (NoSuchNodeTypeException e) {
            // success
View Full Code Here

        node.addMixin(mixinName);
        testRootNode.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

        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.