Package javax.jcr.nodetype

Examples of javax.jcr.nodetype.NodeDefinition.allowsSameNameSiblings()


        if (parent.hasNode(nodeName)) {
            // a node with that name already exists...
            NodeImpl existing = parent.getNode(nodeName);
            NodeDefinition def = existing.getDefinition();
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && existing.isNodeType(ntName)) {
                    // skip protected node
                    parents.push(null); // push null onto stack for skipped node
View Full Code Here


        if (parent.hasNode(nodeName)) {
            // a node with that name already exists...
            NodeImpl existing = parent.getNode(nodeName);
            NodeDefinition def = existing.getDefinition();
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && existing.isNodeType(ntName)) {
                    /*
                     use the existing node as parent for the possible subsequent
View Full Code Here

        if (parent.hasNode(nodeName)) {
            // a node with that name already exists...
            NodeImpl existing = parent.getNode(nodeName);
            NodeDefinition def = existing.getDefinition();
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && existing.isNodeType(ntName)) {
                    /*
                     use the existing node as parent for the possible subsequent
View Full Code Here

        if (parent.hasNode(nodeName)) {
            // a node with that name already exists...
            NodeImpl existing = parent.getNode(nodeName);
            NodeDefinition def = existing.getDefinition();
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && existing.isNodeType(ntName)) {
                    // skip protected node
                    parents.push(null); // push null onto stack for skipped node
View Full Code Here

        assertThat(childDefn.getName(), is("ex:node"));
        assertThat(childDefn.getDefaultPrimaryTypeName(), is("ex:defaultType"));
        assertThat(childDefn.isMandatory(), is(true));
        assertThat(childDefn.isAutoCreated(), is(true));
        assertThat(childDefn.isProtected(), is(true));
        assertThat(childDefn.allowsSameNameSiblings(), is(true));
        assertThat(childDefn.getOnParentVersion(), is(OnParentVersionAction.VERSION));
        String[] requiredTypeNames = childDefn.getRequiredPrimaryTypeNames();
        assertThat(requiredTypeNames[0], is("ex:reqType1"));
        assertThat(requiredTypeNames[1], is("ex:reqType2"));
    }
View Full Code Here

        assertThat(childDefn.getName(), is("ex:node"));
        assertThat(childDefn.getDefaultPrimaryTypeName(), is("ex:defaultType"));
        assertThat(childDefn.isMandatory(), is(true));
        assertThat(childDefn.isAutoCreated(), is(true));
        assertThat(childDefn.isProtected(), is(true));
        assertThat(childDefn.allowsSameNameSiblings(), is(true));
        assertThat(childDefn.getOnParentVersion(), is(OnParentVersionAction.VERSION));
        String[] requiredTypeNames = childDefn.getRequiredPrimaryTypeNames();
        assertThat(requiredTypeNames[0], is("ex:reqType1"));
        assertThat(requiredTypeNames[1], is("ex:reqType2"));
    }
View Full Code Here

        assertThat(childDefn.getName(), is(childName));
        assertThat(childDefn.getDefaultPrimaryTypeName(), is(defaultPrimaryType));
        assertThat(childDefn.isMandatory(), is(options.contains(ChildOptions.Mandatory)));
        assertThat(childDefn.isAutoCreated(), is(options.contains(ChildOptions.Autocreated)));
        assertThat(childDefn.isProtected(), is(options.contains(ChildOptions.Protected)));
        assertThat(childDefn.allowsSameNameSiblings(), is(options.contains(ChildOptions.Sns)));
        assertThat(childDefn.getOnParentVersion(), is(opv(onParentVersioning)));
        assertThat(childDefn.getRequiredPrimaryTypeNames(), is(requiredTypes));
    }
}
View Full Code Here

            NodeDefinition matchingDefinition = null;
            for (int i = 0; i < childNodeDefs.length; i++) {
                NodeDefinition nd = childNodeDefs[i];

                String ntName = childNodeTemplate.getName() == null ? JcrNodeType.RESIDUAL_ITEM_NAME : childNodeTemplate.getName();
                if (nd.getName().equals(ntName) && nd.allowsSameNameSiblings() == childNodeTemplate.allowsSameNameSiblings()) {
                    boolean onlyBaseTypeRequired = nd.getRequiredPrimaryTypes().length == 0
                                                   || (nd.getRequiredPrimaryTypes().length == 1 && nd.getRequiredPrimaryTypes()[0].getName().equals("nt:base"));
                    boolean onlyHasBase = childNodeTemplate.getRequiredPrimaryTypeNames().length == 0
                                          || (childNodeTemplate.getRequiredPrimaryTypeNames().length == 1 && childNodeTemplate.getRequiredPrimaryTypeNames()[0].equals("nt:base"));
View Full Code Here

        if (parent.hasChild(nodeName)) {
            // a node with that name already exists...
            Tree existing = parent.getChild(nodeName);
            NodeDefinition def = getDefinition(existing);
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && isNodeType(existing, ntName)) {
                    /*
                     use the existing node as parent for the possible subsequent
View Full Code Here

        if (parent.hasChild(nodeName)) {
            // a node with that name already exists...
            Tree existing = parent.getChild(nodeName);
            NodeDefinition def = getDefinition(existing);
            if (!def.allowsSameNameSiblings()) {
                // existing doesn't allow same-name siblings,
                // check for potential conflicts
                if (def.isProtected() && isNodeType(existing, ntName)) {
                    /*
                     use the existing node as parent for the possible subsequent
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.