Package org.apache.jackrabbit.core.id

Examples of org.apache.jackrabbit.core.id.NodeId


            InternalVersionHistoryImpl vh;
            InternalVersion version;
            if (node.getEffectiveNodeType().includesNodeType(NameConstants.MIX_VERSIONABLE)) {
                // in full versioning, the history id can be retrieved via
                // the property
                NodeId histId = node.getPropertyValue(NameConstants.JCR_VERSIONHISTORY).getNodeId();
                vh = (InternalVersionHistoryImpl) getVersionHistory(histId);
                version = internalCheckin(vh, node, false, created);
            } else {
                // in simple versioning the history id needs to be calculated
                vh = (InternalVersionHistoryImpl) getVersionHistoryOfNode(node.getNodeId());
View Full Code Here


            history = makeLocalCopy(history);
            xaItems.put(history.getId(), history);
        }
        InternalVersion version =
            super.internalCheckin(history, node, simple, created);
        NodeId frozenNodeId = version.getFrozenNodeId();
        InternalVersionItem frozenNode = createInternalVersionItem(frozenNodeId);
        if (frozenNode != null) {
            xaItems.put(frozenNodeId, frozenNode);
        }
        return version;
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Node getNodeByUUID(String uuid) throws ItemNotFoundException, RepositoryException {
        try {
            NodeImpl node = getNodeById(new NodeId(uuid));
            if (node.isNodeType(NameConstants.MIX_REFERENCEABLE)) {
                return node;
            } else {
                // there is a node with that uuid but the node does not expose it
                throw new ItemNotFoundException(uuid);
View Full Code Here

        // /JCR-2425: check whether session is allowed to read root node
        if (hasPermission("/", ACTION_READ)) {
            getItemManager().getRootNode().save();
        } else {
            NodeId id = getItemStateManager().getIdOfRootTransientNodeState();
            getItemManager().getItem(id).save();
        }
    }
View Full Code Here

        if (existing != null && !newTargetDef.allowsSameNameSiblings()) {
            throw new ItemExistsException(
                    "Same name siblings not allowed: " + existing);
        }

        NodeId targetId = targetNode.getNodeId();
        int index = srcName.getIndex();
        if (index == 0) {
            index = 1;
        }
View Full Code Here

     * this method currently does no modifications to the persistence and just
     * checks if the checkout is valid in respect to a possible activity set on
     * the session
     */
    public NodeId canCheckout(NodeStateEx state, NodeId activityId) throws RepositoryException {
        NodeId baseId = state.getPropertyValue(NameConstants.JCR_BASEVERSION).getNodeId();
        if (activityId != null) {
            // If there exists another workspace with node N' where N' also has version
            // history H, N' is checked out and the jcr:activity property of N'
            // references A, then the checkout fails with an
            // ActivityViolationException indicating which workspace currently has
            // the checkout.

            // we're currently leverage the fact, that only references to "real"
            // workspaces are recorded. so check all references if their sources
            // exist in 'this' workspace
            if (stateMgr.hasNodeReferences(activityId)) {
                try {
                    NodeReferences refs = stateMgr.getNodeReferences(activityId);
                    for (PropertyId id: refs.getReferences()) {
                        if (!state.hasNode(id.getParentId())) {
                            throw new ActivityViolationException("Unable to checkout. " +
                                    "Activity is already used for the same node in " +
                                    "another workspace.");
                        }
                    }
                } catch (ItemStateException e) {
                    throw new RepositoryException("Error during checkout.", e);
                }
            }

            // If there is a version in H that is not an eventual predecessor of N but
            // whose jcr:activity references A, then the checkout fails with an
            // ActivityViolationException
            InternalActivityImpl a = (InternalActivityImpl) getItem(activityId);
            NodeId historyId = state.getPropertyValue(NameConstants.JCR_VERSIONHISTORY).getNodeId();
            InternalVersionHistory history = (InternalVersionHistory) getItem(historyId);
            InternalVersion version = a.getLatestVersion(history);
            if (version != null) {
                InternalVersion baseVersion = (InternalVersion) getItem(baseId);
                while (baseVersion != null && !baseVersion.getId().equals(version.getId())) {
View Full Code Here

     * @see javax.jcr.Session#getNodeByIdentifier(String)
     * @since JCR 2.0
     */
    public Node getNodeByIdentifier(String id)
            throws ItemNotFoundException, RepositoryException {
        NodeId nodeId;
        try {
            nodeId = NodeId.valueOf(id);
        } catch (IllegalArgumentException iae) {
            throw new RepositoryException("invalid identifier: " + id);
        }
View Full Code Here

            public Object run() throws RepositoryException {
                InternalVersionHistoryImpl vh;
                if (node.getEffectiveNodeType().includesNodeType(NameConstants.MIX_VERSIONABLE)) {
                    // in full versioning, the history id can be retrieved via
                    // the property
                    NodeId histId = node.getPropertyValue(NameConstants.JCR_VERSIONHISTORY).getNodeId();
                    vh = (InternalVersionHistoryImpl) getVersionHistory(histId);
                    return internalCheckin(vh, node, false, created);
                } else {
                    // in simple versioning the history id needs to be calculated
                    vh = (InternalVersionHistoryImpl) getVersionHistoryOfNode(node.getNodeId());
View Full Code Here

                }
            }
            checkin = false;
        }

        NodeId baseId = isFull && checkout
                ? vMgr.canCheckout(state, currentActivity)
                : null;

        // perform operation
        WriteOperation ops = startWriteOperation();
View Full Code Here

        public void run() {
            lockMap.traverse(new PathMap.ElementVisitor<LockInfo>() {
                public void elementVisited(PathMap.Element<LockInfo> element) {
                    LockInfo info = element.get();
                    if (info != null && info.isLive() && info.isExpired()) {
                        NodeId id = info.getId();
                        SessionImpl holder = info.getLockHolder();
                        if (holder == null) {
                            info.setLockHolder(sysSession);
                            holder = sysSession;
                        }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.core.id.NodeId

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.