Package org.apache.jackrabbit.core.state

Examples of org.apache.jackrabbit.core.state.NodeState.addShare()


        // uuid is special...only if 'referenceable'
        if (isReferenceable) {
            state.addPropertyName(NameConstants.JCR_UUID);
        }
        for (NodeId nodeId : sharedSet) {
            state.addShare(nodeId);
        }
        return state;
    }

    /**
 
View Full Code Here


        EffectiveNodeType ent = getEffectiveNodeType(node);

        // check shareable
        if (ent.includesNodeType(NameConstants.MIX_SHAREABLE)) {
            node.addShare(parent.getNodeId());
        }

        if (!node.getMixinTypeNames().isEmpty()) {
            // create jcr:mixinTypes property
            QPropertyDefinition pd = ent.getApplicablePropertyDef(NameConstants.JCR_MIXINTYPES,
View Full Code Here

                     * (see section 14.5 of the specification)
                     */
                    if (shareable && refTracker.getMappedId(srcState.getNodeId()) != null) {
                        NodeId newId = refTracker.getMappedId(srcState.getNodeId());
                        NodeState sharedState = (NodeState) stateMgr.getItemState(newId);
                        sharedState.addShare(destParentId);
                        return sharedState;
                    }
                    break;
                case CLONE:
                    if (!referenceable) {
View Full Code Here

                    id = srcState.getNodeId();

                    if (stateMgr.hasItemState(id)) {
                        if (shareable) {
                            NodeState sharedState = (NodeState) stateMgr.getItemState(id);
                            sharedState.addShare(destParentId);
                            return sharedState;
                        }
                        // node with this uuid already exists
                        throw new ItemExistsException(safeGetJCRPath(id));
                    }
View Full Code Here

                                String msg =
                                    "Remapped child (" + safeGetJCRPath(srcPath)
                                    + ") is not shareable.";
                                throw new ItemStateException(msg);
                            }
                            if (!destState.addShare(id)) {
                                String msg = "Unable to add share to node: " + id;
                                throw new ItemStateException(msg);
                            }
                            stateMgr.store(destState);
                            newState.addChildNodeEntry(entry.getName(), mappedId);
View Full Code Here

        // quickly verify whether the share is already contained before creating
        // a transient state in vain
        NodeState state = data.getNodeState();
        if (!state.containsShare(parentId)) {
            state = (NodeState) getOrCreateTransientItemState();
            if (state.addShare(parentId)) {
                return;
            }
        }
        String msg = "Adding a shareable node twice to the same parent is not supported.";
        log.debug(msg);
View Full Code Here

        cache = new CachingHierarchyManager(ism.getRootNodeId(), ism);
        ism.setContainer(cache);
        NodeState a1 = ism.addNode(ism.getRoot(), "a1");
        NodeState a2 = ism.addNode(ism.getRoot(), "a2");
        NodeState b1 = ism.addNode(a1, "b1");
        b1.addShare(b1.getParentId());
        ism.cloneNode(b1, a2, "b2");

        Path path1 = toPath("/a1/b1");
        Path path2 = toPath("/a2/b2");
View Full Code Here

        cache = new CachingHierarchyManager(ism.getRootNodeId(), ism);
        ism.setContainer(cache);
        NodeState a1 = ism.addNode(ism.getRoot(), "a1");
        NodeState a2 = ism.addNode(ism.getRoot(), "a2");
        NodeState b1 = ism.addNode(a1, "b1");
        b1.addShare(b1.getParentId());
        ism.cloneNode(b1, a2, "b2");
        NodeState c = ism.addNode(b1, "c");

        Path path1 = toPath("/a1/b1/c");
        Path path2 = toPath("/a2/b2/c");
View Full Code Here

        // uuid is special...only if 'referenceable'
        if (isReferenceable) {
            state.addPropertyName(NameConstants.JCR_UUID);
        }
        for (NodeId nodeId : sharedSet) {
            state.addShare(nodeId);
        }
        return state;
    }

    /**
 
View Full Code Here

        // quickly verify whether the share is already contained before creating
        // a transient state in vain
        NodeState state = data.getNodeState();
        if (!state.containsShare(parentId)) {
            state = (NodeState) getOrCreateTransientItemState();
            if (state.addShare(parentId)) {
                return;
            }
        }
        String msg = "Adding a shareable node twice to the same parent is not supported.";
        log.debug(msg);
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.