Examples of EffectiveNodeType


Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

    public PropDef findApplicablePropertyDefinition(QName name,
                                                    int type,
                                                    boolean multiValued,
                                                    NodeState parentState)
            throws RepositoryException, ConstraintViolationException {
        EffectiveNodeType entParent = getEffectiveNodeType(parentState);
        return entParent.getApplicablePropertyDef(name, type, multiValued);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

     */
    public PropDef findApplicablePropertyDefinition(QName name,
                                                    int type,
                                                    NodeState parentState)
            throws RepositoryException, ConstraintViolationException {
        EffectiveNodeType entParent = getEffectiveNodeType(parentState);
        return entParent.getApplicablePropertyDef(name, type);
    }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

        node.setDefinitionId(def.getId());

        // now add new child node entry to parent
        parent.addChildNodeEntry(nodeName, id);

        EffectiveNodeType ent = getEffectiveNodeType(node);

        if (!node.getMixinTypeNames().isEmpty()) {
            // create jcr:mixinTypes property
            PropDef pd = ent.getApplicablePropertyDef(QName.JCR_MIXINTYPES,
                    PropertyType.NAME, true);
            createPropertyState(node, pd.getName(), pd.getRequiredType(), pd);
        }

        // add 'auto-create' properties defined in node type
        PropDef[] pda = ent.getAutoCreatePropDefs();
        for (int i = 0; i < pda.length; i++) {
            PropDef pd = pda[i];
            createPropertyState(node, pd.getName(), pd.getRequiredType(), pd);
        }

        // recursively add 'auto-create' child nodes defined in node type
        NodeDef[] nda = ent.getAutoCreateNodeDefs();
        for (int i = 0; i < nda.length; i++) {
            NodeDef nd = nda[i];
            createNodeState(node, nd.getName(), nd.getDefaultPrimaryType(),
                    null, null, nd);
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

            throws RepositoryException {

        NodeState newState;
        try {
            NodeId id;
            EffectiveNodeType ent = getEffectiveNodeType(srcState);
            boolean referenceable = ent.includesNodeType(QName.MIX_REFERENCEABLE);
            boolean versionable = ent.includesNodeType(QName.MIX_VERSIONABLE);
            switch (flag) {
                case COPY:
                    // always create new uuid
                    id = new NodeId(UUID.randomUUID());
                    if (referenceable) {
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

                    BatchedItemOperations.CHECK_ACCESS
                    | BatchedItemOperations.CHECK_CONSTRAINTS);
            node = itemOps.createNodeState(parent, nodeInfo.getName(),
                    nodeInfo.getNodeTypeName(), nodeInfo.getMixinNames(), null);
            // remember uuid mapping
            EffectiveNodeType ent = itemOps.getEffectiveNodeType(node);
            if (ent.includesNodeType(NameConstants.MIX_REFERENCEABLE)) {
                refTracker.mappedId(nodeInfo.getId(), node.getNodeId());
            }
        } else if (uuidBehavior == ImportUUIDBehavior.IMPORT_UUID_COLLISION_THROW) {
            // if existing node is shareable, then instead of failing, create
            // new node and share with existing
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

         * (e.g. those defined by mix:referenceable, mix:versionable,
         * mix:lockable, et.al.)
         *
         * todo FIXME delegate to 'node type instance handler'
         */
        EffectiveNodeType ent = itemOps.getEffectiveNodeType(node);
        if (ent.includesNodeType(NameConstants.MIX_SIMPLE_VERSIONABLE)) {
            /**
             * check if there's already a version history for that
             * node; this would e.g. be the case if a versionable node
             * had been exported, removed and re-imported with either
             * IMPORT_UUID_COLLISION_REMOVE_EXISTING or
             * IMPORT_UUID_COLLISION_REPLACE_EXISTING;
             * otherwise create a new version history
             */
            VersionHistoryInfo history =
                versionManager.getVersionHistory(session, node, null);
            InternalValue historyId = InternalValue.create(
                    history.getVersionHistoryId());
            InternalValue versionId = InternalValue.create(
                    history.getRootVersionId());

            // jcr:isCheckedOut
            conditionalAddProperty(
                    node, NameConstants.JCR_ISCHECKEDOUT,
                    PropertyType.BOOLEAN, false, InternalValue.create(true));
           
            // set extra properties only for full versionable nodes
            if (ent.includesNodeType(NameConstants.MIX_VERSIONABLE)) {
                // jcr:versionHistory
                conditionalAddProperty(
                        node, NameConstants.JCR_VERSIONHISTORY,
                        PropertyType.REFERENCE, false, historyId);

View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

                        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)) {
                        // skip protected node
                        parents.push(null); // push null onto stack for skipped node
                        succeeded = true;
                        log.debug("skipping protected node "
                                + itemOps.safeGetJCRPath(existing.getNodeId()));
                        return;
                    }
                    if (def.isAutoCreated() && entExisting.includesNodeType(ntName)) {
                        // this node has already been auto-created,
                        // no need to create it
                        node = existing;
                    } else {
                        // edge case: colliding node does have same uuid
View Full Code Here

Examples of org.apache.jackrabbit.core.nodetype.EffectiveNodeType

        if (mixins.contains(NameConstants.MIX_SHAREABLE)) {
            return true;
        }

        try {
            EffectiveNodeType type = ntReg.getEffectiveNodeType(primary, mixins);
            return type.includesNodeType(NameConstants.MIX_SHAREABLE);
        } catch (NodeTypeConflictException ntce) {
            String msg = "internal error: failed to build effective node type for node " + state.getNodeId();
            log.debug(msg);
            throw new RepositoryException(msg, ntce);
        }
View Full Code Here

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

        // 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.");
            }
        }

        // delegate to operation
View Full Code Here

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

            session.getNodeTypeManager().getNodeType(qName).isMixin()) {
            return false;
        }

        // check effective node type
        EffectiveNodeType effnt = session.getEffectiveNodeTypeProvider().getEffectiveNodeType(getNodeState().getNodeTypeNames());
        return effnt.includesNodeType(qName);
    }
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.