Package org.apache.sling.ide.eclipse.ui.nav.model

Examples of org.apache.sling.ide.eclipse.ui.nav.model.JcrNode.createChild()


        }
       
        try {
            final NewNodeDialog nnd = new NewNodeDialog(shell, node, ntManager);
            if (nnd.open() == IStatus.OK) {
                node.createChild(nnd.getValue(), nnd.getChosenNodeType());
                return;
            }
        } catch (RepositoryException e1) {
            Activator.getDefault().getPluginLogger().warn(
                    "Could not open NewNodeDialog due to "+e1, e1);
View Full Code Here


    @Test
    public void createNtFolderNode() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("folder", "nt:folder");

        assertThat(projectRule.getProject(), hasFolder("/jcr_root/content/test-root/folder"));
    }

    @Test
View Full Code Here

    @Test
    public void createNtFileNode() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("hello.txt", "nt:file");

        assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/hello.txt"));
    }

    @Test
View Full Code Here

    @Test
    public void createFullCoverageNodeUnderFolder() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("messages", "sling:OsgiConfig");

        assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/messages.xml"));
    }

    @Test
View Full Code Here

        new ProjectAdapter(project).createOrUpdateFile(Path
                .fromPortableString("jcr_root/content/test-root/holder/.content.xml"),
                getClass().getResourceAsStream("nt-unstructured-nodetype.xml"));

        JcrNode contentNode = syncDirNode.getNode("/content/test-root/holder");
        contentNode.createChild("org.apache.sling.SomeComponent", "sling:OsgiConfig");

        assertThat(project, hasFile("/jcr_root/content/test-root/holder/org.apache.sling.SomeComponent.xml"));
    }

    @Test
View Full Code Here

    @Test
    public void createUnstructuredNodeWithSpecialName() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("sling:stuff", "nt:unstructured");

        assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/_sling_stuff/.content.xml"));
    }

    @Test
View Full Code Here

    @Test
    public void createFullCoverageNodeWithSpecialName() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("sling:stuff", "sling:OsgiConfig");

        assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/_sling_stuff.xml"));
    }

    @Test
View Full Code Here

    @Test
    public void createSlingFolderNodeWithSpecialName() throws Exception {

        JcrNode contentNode = syncDirNode.getNode("/content/test-root");
        contentNode.createChild("sling:stuff", "sling:Folder");

        assertThat(projectRule.getProject(), hasFile("/jcr_root/content/test-root/_sling_stuff/.content.xml"));
    }

    @After
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.