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

Examples of org.apache.sling.ide.eclipse.ui.nav.JcrContentContentProvider


        // create .content.xml structure
        InputStream contentXml = getClass().getResourceAsStream("content-nested-structure.xml");
        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/test-root/en.xml"), contentXml);

        // instantiate the content provider
        JcrContentContentProvider contentProvider = new JcrContentContentProvider();

        // directly create the root node
        SyncDir syncDirNode = new SyncDir((IFolder) contentProject.findMember("jcr_root"));

        // test children of '/'
        Object[] children = contentProvider.getChildren(syncDirNode);
        assertChildrenHavePaths(children, "/content");

        // test children of '/content'
        JcrNode contentNode = (JcrNode) children[0];
        Object[] children2 = contentProvider.getChildren(contentNode);
        assertChildrenHavePaths(children2, "/content/test-root");

        // test children of '/content/test-root'
        JcrNode testRootNode = (JcrNode) children2[0];
        Object[] children3 = contentProvider.getChildren(testRootNode);
        assertChildrenHavePaths(children3, "/content/test-root/en");

        // test children of '/content/test-root/en'
        JcrNode enNode = (JcrNode) children3[0];
        Object[] children4 = contentProvider.getChildren(enNode);
        assertChildrenHavePaths(children4, "/content/test-root/en/message", "/content/test-root/en/error",
                "/content/test-root/en/warning");

        // test children of '/content/test-root/en/message'
        JcrNode messageNode = (JcrNode) children4[0];
        Object[] children5 = contentProvider.getChildren(messageNode);
        assertChildrenHavePaths(children5); // no children
    }
View Full Code Here


        project.createOrUpdateFile(Path.fromPortableString("jcr_root/content/_sling_stuff/.content.xml"), getClass()
                .getResourceAsStream("nt-unstructured-nodetype.xml"));

        // instantiate the content provider
        JcrContentContentProvider contentProvider = new JcrContentContentProvider();

        // directly create the root node
        SyncDir syncDirNode = new SyncDir((IFolder) contentProject.findMember("jcr_root"));

        // test children of '/'
        Object[] children = contentProvider.getChildren(syncDirNode);
        assertChildrenHavePaths(children, "/content");

        // test children of '/content'
        JcrNode contentNode = (JcrNode) children[0];
        Object[] children2 = contentProvider.getChildren(contentNode);
        assertChildrenHavePaths(children2, "/content/sling:stuff");

        // test children of '/content/sling:stuff
        JcrNode slingStuffNode = (JcrNode) children2[0];
        Object[] children3 = contentProvider.getChildren(slingStuffNode);
        assertChildrenHavePaths(children3); // no children

    }
View Full Code Here

TOP

Related Classes of org.apache.sling.ide.eclipse.ui.nav.JcrContentContentProvider

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.