Examples of createNodeTypeTemplate()


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

        String nt;
        do {
            nt = baseName + "_" + i++;
        } while (ntMgr.hasNodeType(nt));
        // register node type
        NodeTypeTemplate ntTemplate = ntMgr.createNodeTypeTemplate();
        ntTemplate.setName(nt);
        ntTemplate.setDeclaredSuperTypeNames(new String[]{ntUnstructured});
        ntMgr.registerNodeType(ntTemplate, false);
        // create node
        Node n = testRootNode.addNode(nodeName2, nt);
View Full Code Here

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

                    session.getWorkspace().getNamespaceRegistry();
                registry.registerNamespace("test", "http://www.example.org/");

                NodeTypeManager manager =
                    session.getWorkspace().getNodeTypeManager();
                NodeTypeTemplate template = manager.createNodeTypeTemplate();
                template.setName("test:unstructured");
                template.setDeclaredSuperTypeNames(
                        new String[] { "nt:unstructured" });
                manager.registerNodeType(template, false);
View Full Code Here

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

        String nt;
        do {
            nt = baseName + "_" + i++;
        } while (ntMgr.hasNodeType(nt));
        // register node type
        NodeTypeTemplate ntTemplate = ntMgr.createNodeTypeTemplate();
        ntTemplate.setName(nt);
        ntTemplate.setDeclaredSuperTypeNames(new String[]{ntUnstructured});
        ntMgr.registerNodeType(ntTemplate, false);
        // create node
        Node n = testRootNode.addNode(nodeName2, nt);
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()

                session.getWorkspace().getNamespaceRegistry();
            registry.registerNamespace("test", "http://www.example.org/");

            NodeTypeManager manager =
                session.getWorkspace().getNodeTypeManager();
            NodeTypeTemplate template = manager.createNodeTypeTemplate();
            template.setName("test:unstructured");
            template.setDeclaredSuperTypeNames(
                    new String[] { "nt:unstructured" });
            manager.registerNodeType(template, false);
View Full Code Here

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

        Session session = getAdminSession();

        // node type with default child-node type of to nt:base
        String ntName = "test";
        NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();
        NodeTypeTemplate ntt = ntm.createNodeTypeTemplate();
        ntt.setName(ntName);
        NodeDefinitionTemplate child = ntm.createNodeDefinitionTemplate();
        child.setName("*");
        child.setDefaultPrimaryTypeName("nt:base");
        child.setRequiredPrimaryTypeNames(new String[] {"nt:base"});
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.