Examples of createNodeTypeTemplate()


Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

    }

    public void testAddItemsDefinedByMixin() throws NotExecutableException, RepositoryException {
        // register mixin
        NodeTypeManager ntm = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
        ntd.setName("testMixin");
        ntd.setMixin(true);
        NodeDefinitionTemplate nodeDef = ntm.createNodeDefinitionTemplate();
        nodeDef.setName("child");
        nodeDef.setRequiredPrimaryTypeNames(new String[] {"nt:folder"});
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()


    public void testAddItemsDefinedByMixin2() throws NotExecutableException, RepositoryException {
        // register mixin
        NodeTypeManager ntm = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
        ntd.setName("testMixin");
        ntd.setMixin(true);
        NodeDefinitionTemplate nodeDef = ntm.createNodeDefinitionTemplate();
        nodeDef.setName("child");
        nodeDef.setRequiredPrimaryTypeNames(new String[] {"nt:folder"});
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

    }

    public void testAddItemsDefinedByMixin3() throws NotExecutableException, RepositoryException {
        // register mixin
        NodeTypeManager ntm = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
        ntd.setName("testMixin");
        ntd.setMixin(true);
        NodeDefinitionTemplate nodeDef = ntm.createNodeDefinitionTemplate();
        nodeDef.setName("child");
        nodeDef.setRequiredPrimaryTypeNames(new String[] {"nt:folder"});
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

        assertDefaultPrivileges(NameConstants.JCR_NODE_TYPE_DEFINITION_MANAGEMENT);
        assertPermission(Permission.NODE_TYPE_DEF_MNGMT, false);

        Workspace testWsp = getTestWorkspace();
        NodeTypeManager ntm = testWsp.getNodeTypeManager();
        NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
        ntd.setName("testNodeType");
        ntd.setMixin(true);

        try {
            ntm.registerNodeType(ntd, true);
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

            // success
        }

        NodeTypeTemplate[] ntds = new NodeTypeTemplate[2];
        ntds[0] = ntd;
        ntds[1] = ntm.createNodeTypeTemplate();
        ntds[1].setName("anotherNodeType");
        ntds[1].setDeclaredSuperTypeNames(new String[] {"nt:file"});
        try {
            ntm.registerNodeTypes(ntds, true);
            fail("Node type registration should be denied.");
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

        assertPermission(Permission.NODE_TYPE_DEF_MNGMT, true);

        try {
            Workspace testWsp = getTestWorkspace();
            NodeTypeManager ntm = testWsp.getNodeTypeManager();
            NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
            ntd.setName("testNodeType");
            ntd.setMixin(true);
            ntm.registerNodeType(ntd, true);

            NodeTypeTemplate[] ntds = new NodeTypeTemplate[2];
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

            ntd.setMixin(true);
            ntm.registerNodeType(ntd, true);

            NodeTypeTemplate[] ntds = new NodeTypeTemplate[2];
            ntds[0] = ntd;
            ntds[1] = ntm.createNodeTypeTemplate();
            ntds[1].setName("anotherNodeType");
            ntds[1].setDeclaredSuperTypeNames(new String[] {"nt:file"});
            ntm.registerNodeTypes(ntds, true);
        } finally {
            modifyPrivileges(null, NameConstants.JCR_NODE_TYPE_DEFINITION_MANAGEMENT.toString(), false);
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

    public void testUnRegisterNodeType() throws Exception {
        assertDefaultPrivileges(NameConstants.JCR_NODE_TYPE_DEFINITION_MANAGEMENT);
        assertPermission(Permission.NODE_TYPE_DEF_MNGMT, false);

        NodeTypeManager ntm = superuser.getWorkspace().getNodeTypeManager();
        NodeTypeTemplate ntd = ntm.createNodeTypeTemplate();
        ntd.setName("testNodeType");
        ntd.setMixin(true);
        ntm.registerNodeType(ntd, true);

        Workspace testWsp = getTestWorkspace();
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

    @Test
    public void nodeTypeRegistry() throws RepositoryException {
        NodeTypeManager ntMgr = getSession().getWorkspace().getNodeTypeManager();
        assertFalse(ntMgr.hasNodeType("foo"));

        NodeTypeTemplate ntd = ntMgr.createNodeTypeTemplate();
        ntd.setName("foo");
        ntMgr.registerNodeType(ntd, false);
        assertTrue(ntMgr.hasNodeType("foo"));

        ntMgr.unregisterNodeType("foo");
View Full Code Here

Examples of javax.jcr.nodetype.NodeTypeManager.createNodeTypeTemplate()

    }

    @Test
    public void mixin() throws RepositoryException {
        NodeTypeManager ntMgr = getSession().getWorkspace().getNodeTypeManager();
        NodeTypeTemplate mixTest = ntMgr.createNodeTypeTemplate();
        mixTest.setName("mix:test");
        mixTest.setMixin(true);
        ntMgr.registerNodeType(mixTest, false);

        Node testNode = getNode(TEST_PATH);
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.