Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QNodeDefinition.allowsSameNameSiblings()


                NodeState conflictingState = parentState.getChildNodeState(nodeName, Path.INDEX_DEFAULT);
                QNodeDefinition conflictDef = conflictingState.getDefinition();
                QNodeDefinition newDef = mgrProvider.getItemDefinitionProvider().getQNodeDefinition(parentState, nodeName, nodeTypeName);

                // check same-name sibling setting of both target and existing node
                if (!(conflictDef.allowsSameNameSiblings() && newDef.allowsSameNameSiblings())) {
                    throw new ItemExistsException("Cannot add child node '"
                        + nodeName.getLocalName() + "' to "
                        + safeGetJCRPath(parentState)
                        + ": colliding with same-named existing node.");
                }
View Full Code Here


                    && requiredPrimaryTypes.equals(new HashSet<Name>(
                            Arrays.asList(other.getRequiredPrimaryTypes())))
                    && (defaultPrimaryType == null
                            ? other.getDefaultPrimaryType() == null
                            : defaultPrimaryType.equals(other.getDefaultPrimaryType()))
                    && allowsSameNameSiblings == other.allowsSameNameSiblings();
        }
        return false;
    }

    /**
 
View Full Code Here

                NodeId idExisting = entry.getId();
                NodeState existing = (NodeState) itemOps.getItemState(idExisting);
                QNodeDefinition def = itemOps.findApplicableNodeDefinition(
                        nodeName, existing.getNodeTypeName(), parent);

                if (!def.allowsSameNameSiblings()) {
                    // existing doesn't allow same-name siblings,
                    // check for potential conflicts
                    EffectiveNodeType entExisting =
                            itemOps.getEffectiveNodeType(existing);
                    if (def.isProtected() && entExisting.includesNodeType(ntName)) {
View Full Code Here

                                        Name name = parent.getChildNodeEntry(id).getName();
                                        EffectiveNodeType ent = ntReg.getEffectiveNodeType(
                                                parent.getNodeTypeName(),
                                                parent.getMixinTypeNames());
                                        QNodeDefinition def = ent.getApplicableChildNodeDef(name, ns.getNodeTypeName(), ntReg);
                                        return def != null ? def.allowsSameNameSiblings() : false;
                                    } catch (Exception e) {
                                        log.warn("Unable to get node definition", e);
                                        return false;
                                    }
                                }
View Full Code Here

            return super.equals(obj)
                    && Arrays.equals(requiredPrimaryTypes, other.getRequiredPrimaryTypes())
                    && (defaultPrimaryType == null
                            ? other.getDefaultPrimaryType() == null
                            : defaultPrimaryType.equals(other.getDefaultPrimaryType()))
                    && allowsSameNameSiblings == other.allowsSameNameSiblings();
        }
        return false;
    }

    /**
 
View Full Code Here

                                                Name name = parent.getChildNodeEntry(id).getName();
                                                EffectiveNodeType ent = ntReg.getEffectiveNodeType(
                                                        parent.getNodeTypeName(),
                                                        parent.getMixinTypeNames());
                                                QNodeDefinition def = ent.getApplicableChildNodeDef(name, ns.getNodeTypeName(), ntReg);
                                                return def != null ? def.allowsSameNameSiblings() : false;
                                            } catch (Exception e) {
                                                log.warn("Unable to get node definition", e);
                                                return false;
                                            }
                                        }
View Full Code Here

        }
        ChildNodeEntry cne = nodeState.getChildNodeEntry(name, 1);
        if (cne != null) {
            // there's already a child node entry with that name;
            // check same-name sibling setting of new node
            if (!def.allowsSameNameSiblings()) {
                throw new ItemExistsException(getNodeId() + "/" + name);
            }
            NodeState existingChild;
            try {
                // check same-name sibling setting of existing node
View Full Code Here

            } catch (ItemStateException e) {
                throw new RepositoryException(e);
            }
            QNodeDefinition existingChildDef = ent.getApplicableChildNodeDef(
                    cne.getName(), existingChild.getNodeTypeName(), ntReg);
            if (!existingChildDef.allowsSameNameSiblings()) {
                throw new ItemExistsException(existingChild.toString());
            }
        } else {
            // check if 'add' is allowed
            if (getDefinition().isProtected()) {
View Full Code Here

                                                Name name = parent.getChildNodeEntry(id).getName();
                                                EffectiveNodeType ent = ntReg.getEffectiveNodeType(
                                                        parent.getNodeTypeName(),
                                                        parent.getMixinTypeNames());
                                                QNodeDefinition def = ent.getApplicableChildNodeDef(name, ns.getNodeTypeName(), ntReg);
                                                return def != null ? def.allowsSameNameSiblings() : false;
                                            } catch (Exception e) {
                                                log.warn("Unable to get node definition", e);
                                                return false;
                                            }
                                        }
View Full Code Here

                                                Name name = parent.getChildNodeEntry(id).getName();
                                                EffectiveNodeType ent = ntReg.getEffectiveNodeType(
                                                        parent.getNodeTypeName(),
                                                        parent.getMixinTypeNames());
                                                QNodeDefinition def = ent.getApplicableChildNodeDef(name, ns.getNodeTypeName(), ntReg);
                                                return def != null ? def.allowsSameNameSiblings() : false;
                                            } catch (Exception e) {
                                                log.warn("Unable to get node definition", e);
                                                return false;
                                            }
                                        }
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.