Package javax.jcr

Examples of javax.jcr.Node.canAddMixin()


    protected void setUp() throws Exception {
        super.setUp();

        Node child = testRootNode.addNode(nodeName2);
        if (child.isNodeType(mixReferenceable) || !child.canAddMixin(mixReferenceable)) {
            throw new NotExecutableException();
        }
        superuser.save();
       
        mixinName = getTestSession().getNamespacePrefix(NS_MIX_URI) + ":referenceable";
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, testNodeType);

        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

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

        assertTrue(node.canAddMixin(mixinName));
        node.addMixin(mixinName);
        // adding again must be possible (though it has no effect)
        assertTrue(node.canAddMixin(mixinName));

        session.save();
View Full Code Here

        }

        assertTrue(node.canAddMixin(mixinName));
        node.addMixin(mixinName);
        // adding again must be possible (though it has no effect)
        assertTrue(node.canAddMixin(mixinName));

        session.save();

        // adding again must be possible (though it has no effect)
        assertTrue(node.canAddMixin(mixinName));
View Full Code Here

        assertTrue(node.canAddMixin(mixinName));

        session.save();

        // adding again must be possible (though it has no effect)
        assertTrue(node.canAddMixin(mixinName));
    }

    /**
     * Test if an inherited mixin could be added.
     *
 
View Full Code Here

        NodeType[] superTypes = nt.getSupertypes();
        for (int i = 0; i < superTypes.length; i++) {
            if (superTypes[i].isMixin()) {
                String mixinName = superTypes[i].getName();
                // adding again must be possible (though it has no effect)
                assertTrue(node.canAddMixin(mixinName));
            }
        }
    }

}
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.