Package javax.jcr

Examples of javax.jcr.Node.canAddMixin()


        } catch (PathNotFoundException pnfe) {
            // ok
        }
        // a referenceable node
        Node n1 = testRootNode.addNode(name, testNodeType);
        if (!n1.isNodeType(mixReferenceable) && !n1.canAddMixin(mixReferenceable)) {
            n1.remove();
            session.save();
            throw new NotExecutableException("node type " + testNodeType +
                    " does not support mix:referenceable");
        }
View Full Code Here


        } catch (PathNotFoundException pnfe) {
            // ok
        }
        // a referenceable node
        Node n1 = testRootNode.addNode(name);
        if (n1.canAddMixin(mixReferenceable)) {
            n1.addMixin(mixReferenceable);
            // make sure jcr:uuid is available
            lockingSession.save();
            return n1;
        }
View Full Code Here

        // create a node that is lockable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it lockable if it is not
        if (!node.isNodeType(mixLockable)) {
            if (node.canAddMixin(mixLockable)) {
                node.addMixin(mixLockable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not lockable and does not " +
                        "allow to add mix:lockable");
            }
View Full Code Here

        // create a node that is versionable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it versionable if it is not
        if (!node.isNodeType(mixVersionable)) {
            if (node.canAddMixin(mixVersionable)) {
                node.addMixin(mixVersionable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not versionable and does not " +
                        "allow to add mix:versionable");
            }
View Full Code Here

        node.checkin();

        assertFalse("Node.canAddMixin(String mixinName) must return false " +
                "if the node is checked-in.",
                node.canAddMixin(mixinName));
    }

    /**
     * Tests if <code>Node.canAddMixin(String mixinName)</code> throws a
     * <code>NoSuchNodeTypeException</code> if <code>mixinName</code> is not the
View Full Code Here

        String nonExistingMixinName = NodeMixinUtil.getNonExistingMixinName(session);

        Node node = testRootNode.addNode(nodeName1);

        try {
            node.canAddMixin(nonExistingMixinName);
            fail("Node.canAddMixin(String mixinName) must throw a " +
                    "NoSuchNodeTypeException if mixinName is an unknown mixin type");
        } catch (NoSuchNodeTypeException e) {
            // success
        }
View Full Code Here

     *                                the node type for the new child node.
     */
    private Property createProperty(int propertyType, boolean multiple) throws RepositoryException, NotExecutableException {
        Node n = testRootNode.addNode(nodeName1, testNodeType);
        if (propertyType == PropertyType.REFERENCE && !n.isNodeType(mixReferenceable)) {
            if (!n.canAddMixin(mixReferenceable)) {
                throw new NotExecutableException(testNodeType + " does not support adding of mix:referenceable");
            } else {
                n.addMixin(mixReferenceable);
            }
        }
View Full Code Here

     *         parent that is checked in).
     */
    protected Node initVersioningException(boolean returnParent) throws RepositoryException, NotExecutableException, IOException {
        Node vNode = testRootNode.addNode(nodeName1, testNodeType);
        if (!vNode.isNodeType(mixVersionable)) {
            if (vNode.canAddMixin(mixVersionable)) {
                vNode.addMixin(mixVersionable);
            } else {
                throw new NotExecutableException("NodeType: " + testNodeType + " is not versionable");
            }
        }
View Full Code Here

        // create a node that is lockable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it lockable if it is not
        if (!node.isNodeType(mixLockable)) {
            if (node.canAddMixin(mixLockable)) {
                node.addMixin(mixLockable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not lockable and does not " +
                        "allow to add mix:lockable");
            }
View Full Code Here

        // create a node that is lockable
        Node node = testRootNode.addNode(nodeName1, testNodeType);
        // or try to make it lockable if it is not
        if (!node.isNodeType(mixLockable)) {
            if (node.canAddMixin(mixLockable)) {
                node.addMixin(mixLockable);
            } else {
                throw new NotExecutableException("Node " + nodeName1 + " is not lockable and does not " +
                        "allow to add mix:lockable");
            }
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.