Package org.modeshape.jcr.api

Examples of org.modeshape.jcr.api.JcrTools$BrowseContent


        // Create node structure
        Node root1 = getTestRoot(session1);
        Node folder1 = root1.addNode("folder1", "nt:folder");
        String fileName = "simple.json";
        String filePath = folder1.getPath() + "/" + fileName;
        new JcrTools().uploadFile(session1, filePath, getClass().getResourceAsStream("/data/" + fileName));
        session1.save();

        // Find the primary item ...
        Node file1 = folder1.getNode(fileName);
        Node content = file1.getNode("jcr:content");
View Full Code Here


        }
    }

    protected void printDetails( Node node ) throws RepositoryException {
        if (print) {
            new JcrTools(true).printNode(node);
        }
    }
View Full Code Here

        // Add a node under which we'll do our work ...
        Node node1 = session.getRootNode().addNode("node1");
        session.save();

        // Upload a file
        JcrTools tools = new JcrTools();
        tools.uploadFile(session, "/node1/simple.json", getResourceFile("data/simple.json"));
        Node fileNode = node1.getNode("simple.json");
        Node contentNode = fileNode.getNode("jcr:content");
        assertThat(contentNode.getPrimaryNodeType().getName(), is("nt:resource"));
        assertThat(contentNode.hasProperty("jcr:mimeType"), is(false));
        assertThat(contentNode.hasProperty("jcr:data"), is(true));
View Full Code Here

        // Add a node under which we'll do our work ...
        Node node1 = session.getRootNode().addNode("node1");
        session.save();

        // Upload a file
        JcrTools tools = new JcrTools();
        tools.uploadFile(session, "/node1/simple.json", getResourceFile("data/simple.json"));
        Node fileNode = node1.getNode("simple.json");
        Node contentNode = fileNode.getNode("jcr:content");
        contentNode.setPrimaryType(ntResourceSubtype.getName());
        assertThat(contentNode.getPrimaryNodeType().getName(), is(ntResourceSubtype.getName()));
        assertThat(contentNode.hasProperty("jcr:mimeType"), is(false));
View Full Code Here

        // Add a node under which we'll do our work ...
        Node node1 = session.getRootNode().addNode("node1");
        session.save();

        // Upload a file
        JcrTools tools = new JcrTools();
        tools.uploadFile(session, "/node1/simple.json", getResourceFile("data/simple.json"));
        Node fileNode = node1.getNode("simple.json");
        Node contentNode = fileNode.getNode("jcr:content");
        contentNode.setProperty("jcr:mimeType", "bogus");
        assertThat(contentNode.getPrimaryNodeType().getName(), is("nt:resource"));
        assertThat(contentNode.getProperty("jcr:mimeType").getString(), is("bogus"));
View Full Code Here

        // Add a node under which we'll do our work ...
        Node node1 = session.getRootNode().addNode("node1");
        session.save();

        // Upload a file
        JcrTools tools = new JcrTools();
        tools.uploadFile(session, "/node1/simple.json", getResourceFile("data/simple.json"));
        Node fileNode = node1.getNode("simple.json");
        Node contentNode = fileNode.getNode("jcr:content");
        assertThat(contentNode.getPrimaryNodeType().getName(), is("nt:resource"));
        contentNode.setPrimaryType("nt:unstructured");
        assertThat(contentNode.hasProperty("jcr:mimeType"), is(false));
View Full Code Here

        session.save();
        assertThat(node1a.getIndex(), is(2));
        assertLocalNameAndNamespace(node1a, "node1", ""); // no SNS index in local name!

        // Upload a file
        JcrTools tools = new JcrTools();
        tools.uploadFile(session, "/node1/simple.json", getResourceFile("data/simple.json"));
        Node fileNode = node1.getNode("simple.json");
        Node contentNode = fileNode.getNode("jcr:content");

        assertLocalNameAndNamespace(fileNode, "simple.json", "");
        assertLocalNameAndNamespace(contentNode, "content", "jcr");
View Full Code Here

    @Before
    @Override
    public void beforeEach() throws Exception {
        super.beforeEach();
        tools = new JcrTools();

        Node rootNode = session.getRootNode();

        personNode = rootNode.addNode("Person");
        personNode.setProperty("First Name", "Ryan");
View Full Code Here

    @Override
    @Before
    public void beforeEach() throws Exception {
        startRepositoryWithConfiguration(getClass().getClassLoader()
                                                   .getResourceAsStream("config/repo-config-concurrent-tests.json"));
        tools = new JcrTools();

        // Set the transaction timeout so that we can debug code called within the transaction ...
        repository.runningState().txnManager().setTransactionTimeout(500);
    }
View Full Code Here

TOP

Related Classes of org.modeshape.jcr.api.JcrTools$BrowseContent

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.