Examples of JcrNode


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

    @Override
    public void decorate(Object element, IDecoration decoration) {

        if (element instanceof JcrNode) {
            JcrNode node = (JcrNode) element;
            if (node.getPrimaryType() != null) {
                decoration.addSuffix(" [" + node.getPrimaryType() + "]");
            }

            if (node instanceof SyncDir) {
                decoration.addOverlay(SharedImages.CONTENT_OVERLAY, IDecoration.BOTTOM_RIGHT);
            }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

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

        IProject project = projectRule.getProject();
        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"));
    }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

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

    }

    @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"));
    }
View Full Code Here

Examples of org.brixcms.jcr.api.JcrNode

    @SuppressWarnings("unchecked")
    public void validate(IValidatable validatable) {
        Object o = validatable.getValue();
        if (o != null) {
            JcrNode node = nodeModel.getObject();
            Path path = null;
            if (o instanceof Path) {
                path = (Path) o;
            } else {
                path = new Path(o.toString());
            }

            if (!path.isAbsolute()) {
                Path parent = new Path(node.getPath());
                if (!((BrixNode) node).isFolder())
                    parent = parent.parent();
                path = parent.append(path);
            } else {
                path = new Path(SitePlugin.get().toRealWebNodePath(path.toString()));
            }
            if (node.getSession().itemExists(path.toString()) == false) {
                ValidationError error = new ValidationError();
                error.setMessage("Node ${path} could not be found");
                error.addMessageKey("NodePathValidator");
                error.getVariables().put("path", path.toString());
                validatable.error(error);
View Full Code Here

Examples of org.brixcms.jcr.api.JcrNode

    }

    @Override
    public boolean checkRequired() {
        if (isRequired()) {
            JcrNode node = (JcrNode) getModelObject();
            if (node == null) {
                return false;
            }
        }
        return true;
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.