Package org.modeshape.jcr.api.nodetype

Examples of org.modeshape.jcr.api.nodetype.NodeTypeManager


        return type;
    }

    @Test
    public void shouldAccessCustomNodeTypeManagerViaCasting() throws Exception {
        NodeTypeManager nodeTypeMgr = session.getWorkspace().getNodeTypeManager();
        assertThat(nodeTypeMgr, is(notNullValue()));
    }
View Full Code Here


        assertThat(nodeTypeMgr, is(notNullValue()));
    }

    @Test
    public void shouldAccessCustomNodeTypeManagerViaProtectedMethods() throws Exception {
        NodeTypeManager nodeTypeMgr = session.workspace().nodeTypeManager();
        assertThat(nodeTypeMgr, is(notNullValue()));
    }
View Full Code Here

            System.err.println(msg);
            throw new IllegalArgumentException(msg);
        }
        assert stream != null;
        try {
            NodeTypeManager nodeTypeMgr = (NodeTypeManager)session.getWorkspace().getNodeTypeManager();
            nodeTypeMgr.registerNodeTypes(stream, true);
        } catch (RepositoryException re) {
            throw new IllegalStateException("Could not load node type definition files", re);
        } catch (IOException ioe) {
            throw new IllegalStateException("Could not access node type definition files", ioe);
        } catch (ClassCastException e) {
View Full Code Here

    private boolean outputIsSystemNodeTypes( Node outputNode,
                                             Binary binaryValue ) throws RepositoryException, IOException {
        String systemNodesPath = JcrLexicon.SYSTEM.getString() + "/" + JcrLexicon.NODE_TYPES.getString();
        if (outputNode.getPath().contains(systemNodesPath)) {
            NodeTypeManager nodeTypeManager = (NodeTypeManager)outputNode.getSession().getWorkspace().getNodeTypeManager();
            nodeTypeManager.registerNodeTypes(binaryValue.getStream(), true);
            return true;
        }
        return false;
    }
View Full Code Here

                registry.registerNamespace(TestLexicon.Namespace.PREFIX, TestLexicon.Namespace.URI);

                // Register the node types needed in our tests ...
                String cndFileName = "/tck/tck_test_types.cnd";
                URL cndUrl = getClass().getResource(cndFileName);
                NodeTypeManager nodeTypeManager = (NodeTypeManager)session.getWorkspace().getNodeTypeManager();
                nodeTypeManager.registerNodeTypes(cndUrl, true);

                // This needs to check configProps directly to avoid an infinite loop
                String skipImport = (String)configProps.get(MODE_SHAPE_SKIP_IMPORT);
                if (!Boolean.valueOf(skipImport)) {
View Full Code Here

        }
    }

    private void registerNodeTypes( Session session,
                                    String resourcePathToCnd ) throws Exception {
        NodeTypeManager nodeTypes = (NodeTypeManager)session.getWorkspace().getNodeTypeManager();
        URL url = getClass().getClassLoader().getResource(resourcePathToCnd);
        assertThat(url, is(notNullValue()));
        nodeTypes.registerNodeTypes(url, true);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.api.nodetype.NodeTypeManager

Copyright © 2018 www.massapicom. 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.