Package org.apache.jackrabbit.jcr2spi.nodetype

Examples of org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeImpl


            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here


            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

        NodeType mixin = ntMgr.getNodeType(mixinName);
        if (!mixin.isMixin()) {
            log.error(mixin.getName() + ": not a mixin node type");
            return false;
        }
        NodeTypeImpl primaryType = ntMgr.getNodeType(getPrimaryNodeTypeName());
        if (primaryType.isNodeType(mixinName)) {
            log.debug(mixin.getName() + ": already contained in primary node type");
            return false;
        }

        // get list of existing nodetypes
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            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");
                }
            }
        }

        /*
         * mix:lockable: the mixin cannot be removed if the node is currently
         * locked even if the editing session is the lock holder.
         */
        if (mixin.isNodeType((NameConstants.MIX_LOCKABLE))) {
            EffectiveNodeType entRemaining = getRemainingENT(mixinValue);
            if (!entRemaining.includesNodeType(NameConstants.MIX_LOCKABLE) && isLocked()) {
                throw new ConstraintViolationException(mixinName + " can not be removed: the node is locked.");
            }
        }
View Full Code Here

            throw new NoSuchNodeTypeException("Cannot remove mixin '" + mixinName + "': Nodetype is not present on this node.");
        }

        // mix:referenceable needs additional assertion: the mixin cannot be
        // removed, if any references are left to this node.
        NodeTypeImpl mixin = session.getNodeTypeManager().getNodeType(ntName);
        if (mixin.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
            // build effective node type of remaining mixin's & primary type
            EffectiveNodeType entRemaining;
            Name[] allRemaining = (Name[]) mixinValue.toArray(new Name[mixinValue.size() + 1]);
            allRemaining[mixinValue.size()] = primaryTypeName;
            try {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.jcr2spi.nodetype.NodeTypeImpl

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.