Package org.apache.jackrabbit.jcr2spi.nodetype

Examples of org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeType.includesNodeType()


            return false;
        }

        // check effective node type
        EffectiveNodeType effnt = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(getNodeState().getNodeTypeNames());
        return effnt.includesNodeType(qName);
    }

    //-----------------------------------------------------------< ItemImpl >---
    /**
     * @see ItemImpl#getName()
View Full Code Here


        QNodeDefinition def = nodeState.getDefinition();

        // check if primary type satisfies the 'required node types' constraint
        Name[] requiredPrimaryTypes = def.getRequiredPrimaryTypes();
        for (int i = 0; i < requiredPrimaryTypes.length; i++) {
            if (!entPrimary.includesNodeType(requiredPrimaryTypes[i])) {
                String msg = safeGetJCRPath(nodeState)
                        + ": missing required primary type "
                        + requiredPrimaryTypes[i];
                log.debug(msg);
                throw new ConstraintViolationException(msg);
View Full Code Here

                entRemaining = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(allRemaining);
            } catch (NodeTypeConflictException e) {
                throw new ConstraintViolationException(e);
            }

            if (!entRemaining.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                PropertyIterator iter = getReferences();
                if (iter.hasNext()) {
                    throw new ConstraintViolationException("Mixin type " + mixinName + " can not be removed: the node is being referenced through at least one property of type REFERENCE");
                }
            }
View Full Code Here

        }

        // check effective node type
        try {
            EffectiveNodeType effnt = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(getNodeState().getNodeTypeNames());
            return effnt.includesNodeType(qName);
        } catch (NodeTypeConflictException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

        Name[] existingNts = getNodeState().getNodeTypeNames();
        // build effective node type representing primary type including existing mixin's
        EffectiveNodeType entExisting = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(existingNts);

        // check if adding new mixin conflicts with existing nodetypes
        if (entExisting.includesNodeType(mixinName)) {
            log.debug(mixin.getName() + ": already contained in mixin types");
            return false;
        }

        // second, build new effective node type for nts including the new mixin
View Full Code Here

               QNodeDefinition def = existing.getDefinition();
               if (!def.allowsSameNameSiblings()) {
                   // existing doesn't allow same-name siblings, check for conflicts
                   EffectiveNodeTypeProvider provider = session.getEffectiveNodeTypeProvider();
                   EffectiveNodeType entExisting = provider.getEffectiveNodeType(existing);
                   if (def.isProtected() && entExisting.includesNodeType(nodeInfo.getNodeTypeName())) {
                       // skip protected node
                       parents.push(null); // push null onto stack for skipped node
                       log.debug("skipping protected node " + LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                       return;
                   }
View Full Code Here

                       // skip protected node
                       parents.push(null); // push null onto stack for skipped node
                       log.debug("skipping protected node " + LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                       return;
                   }
                   if (def.isAutoCreated() && entExisting.includesNodeType(nodeInfo.getNodeTypeName())) {
                       // this node has already been auto-created, no need to create it
                       nodeState = existing;
                   } else {
                       throw new ItemExistsException(LogUtil.safeGetJCRPath(existing, session.getPathResolver()));
                   }
View Full Code Here

            return;
        }
        Name[] ntNames = (Name[]) l.toArray(new Name[l.size()]);
        try {
            EffectiveNodeType ent = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(ntNames);
            if (!ent.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                throw new ConstraintViolationException("XML defines jcr:uuid without defining import node to be referenceable.");
            }
        } catch (NodeTypeConflictException e) {
            throw new RepositoryException("Internal error", e);
        }
View Full Code Here

            // build effective node type of remaining mixin's & primary type
            Name[] allRemaining = (Name[]) mixinValue.toArray(new Name[mixinValue.size() + 1]);
            allRemaining[mixinValue.size()] = primaryTypeName;
            EffectiveNodeType entRemaining = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(allRemaining);

            if (!entRemaining.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                PropertyIterator iter = getReferences();
                if (iter.hasNext()) {
                    throw new ConstraintViolationException("Mixin type " + mixinName + " can not be removed: the node is being referenced through at least one property of type REFERENCE");
                }
            }
View Full Code Here

            return false;
        }

        // check effective node type
        EffectiveNodeType effnt = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(getNodeState().getNodeTypeNames());
        return effnt.includesNodeType(qName);
    }

    //-----------------------------------------------------------< ItemImpl >---
    /**
     * @see ItemImpl#getName()
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.