Package javax.jcr.nodetype

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


        // node type with default child-node type of to nt:base
        String ntName = "binaryCoercionTest";
        NodeTypeManager ntm = session.getWorkspace().getNodeTypeManager();

        NodeTypeTemplate ntt = ntm.createNodeTypeTemplate();
        ntt.setName(ntName);

        PropertyDefinitionTemplate propertyWithType = ntm.createPropertyDefinitionTemplate();
        propertyWithType.setName("javaObject");
        propertyWithType.setRequiredType(PropertyType.STRING);
View Full Code Here


    @Test
    public void nodeTypeRegistry() throws RepositoryException {
        NodeTypeManager ntMgr = getAdminSession().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

    }

    @Test
    public void mixin() throws RepositoryException {
        NodeTypeManager ntMgr = getAdminSession().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

  }

  void createDataSources() throws RepositoryException {

    NodeTypeManager manager = session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName("nt:olapdatasource");

    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
View Full Code Here

  void createSchemas() throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName("nt:mondrianschema");
    //ntt.setPrimaryItemName("nt:file");
    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
View Full Code Here

  void createFiles() throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName("nt:saikufiles");
    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
    PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();
View Full Code Here

  public void createFileMixin(String type) throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName(type);
    String[] str = new String[] { "nt:file" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
    PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();
View Full Code Here

  void createFolders() throws RepositoryException {

    NodeTypeManager manager =
        session.getWorkspace().getNodeTypeManager();
    NodeTypeTemplate ntt = manager.createNodeTypeTemplate();
    ntt.setName("nt:saikufolders");
    String[] str = new String[] { "nt:folder" };
    ntt.setDeclaredSuperTypeNames(str);
    ntt.setMixin(true);
    PropertyDefinitionTemplate pdt = manager.createPropertyDefinitionTemplate();
View Full Code Here

                    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

    @Test
    public void nodeTypeRegistry() throws RepositoryException {
        NodeTypeManager ntMgr = getAdminSession().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

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.