Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeId


        if (nodeInfo instanceof Serializable) {
            return nodeInfo;
        } else {
            List<PropertyId> serRefs = new ArrayList<PropertyId>();
            for (PropertyId ref : nodeInfo.getReferences()) {
                NodeId parentId = ref.getParentId();
                parentId = idFactory.createNodeId(
                        parentId.getUniqueID(), parentId.getPath());
                serRefs.add(idFactory.createPropertyId(parentId, ref.getName()));
            }
            NodeId nodeId = nodeInfo.getId();
            nodeId = idFactory.createNodeId(nodeId.getUniqueID(), nodeId.getPath());
            final Iterator<PropertyId> propIds = nodeInfo.getPropertyIds();
            final Iterator<ChildInfo> childInfos = nodeInfo.getChildInfos();
            return new NodeInfoImpl(nodeInfo.getPath(), nodeId,
                    nodeInfo.getIndex(), nodeInfo.getNodetype(),
                    nodeInfo.getMixins(), serRefs.iterator(),
                    new Iterator<PropertyId>() {
                        public boolean hasNext() {
                            return propIds.hasNext();
                        }
                        public PropertyId next() {
                            PropertyId propId = propIds.next();
                            NodeId parentId = propId.getParentId();
                            idFactory.createNodeId(
                                    parentId.getUniqueID(), parentId.getPath());
                            return idFactory.createPropertyId(
                                    parentId, propId.getName());
                        }
                        public void remove() {
                            throw new UnsupportedOperationException();
View Full Code Here


        checkIsVersionable();
        checkIsLocked();
        if (!isCheckedOut()) {
            if (session.isSupportedOption(Repository.OPTION_ACTIVITIES_SUPPORTED)) {
                NodeImpl activity = (NodeImpl) session.getWorkspace().getVersionManager().getActivity();
                NodeId activityId = (activity == null) ? null : activity.getNodeState().getNodeId();
                session.getVersionStateManager().checkout(getNodeState(), activityId);
            } else {
                session.getVersionStateManager().checkout(getNodeState());
            }
        } else {
View Full Code Here

            return getBaseVersion();
        } else {
            NodeEntry newVersion;
            if (session.isSupportedOption(Repository.OPTION_ACTIVITIES_SUPPORTED)) {
                NodeImpl activity = (NodeImpl) session.getWorkspace().getVersionManager().getActivity();
                NodeId activityId = (activity == null) ? null : activity.getNodeState().getNodeId();
                newVersion = session.getVersionStateManager().checkpoint(getNodeState(), activityId);
            } else {
                newVersion = session.getVersionStateManager().checkpoint(getNodeState());
            }
            return (Version) getItemManager().getItem(newVersion);
View Full Code Here

            if (stale) {
                throw new IllegalStateException("Builder is stale");
            }
            else {
                stale = true;
                NodeId id = getId();

                nodeInfo = new NodeInfoImpl(id.getPath(), id, index, primaryTypeName,
                        mixins.toArray(new Name[mixins.size()]), EmptyIterator.INSTANCE,
                        getPropertyIds(), includeChildInfos ? getChildInfos() : null);

                if (listener != null) {
                    listener.createNodeInfo(nodeInfo);
View Full Code Here

                for (int j = i; j < elems.length; j++) {
                    pb.addLast(elems[j]);
                }
                Path remainingPath = pb.getPath();

                NodeId parentId = entry.getWorkspaceId();
                IdFactory idFactory = factory.getIdFactory();

                NodeId nodeId = idFactory.createNodeId(parentId, remainingPath);
                NodeEntry ne = entry.loadNodeEntry(nodeId);
                if (ne != null) {
                    return ne;
                } else {
                    throw new PathNotFoundException(factory.saveGetJCRPath(path));
View Full Code Here

                pb.addLast(elems[j]);
            }
            Path remainingPath = pb.getPath();

            IdFactory idFactory = getIdFactory();
            NodeId parentId = entry.getWorkspaceId();
            parentId = (remainingPath.getLength() == 1) ? parentId : idFactory.createNodeId(parentId, remainingPath.getAncestor(1));
            PropertyId propId = idFactory.createPropertyId(parentId, remainingPath.getNameElement().getName());
            pe = entry.loadPropertyEntry(propId);
        }
View Full Code Here

        if (cne == null && loadIfNotFound
                && !containsAtticChild(entries, nodeName, index)
                && !childNodeEntries.isComplete()) {

            NodeId cId = getIdFactory().createNodeId(getWorkspaceId(),
                    getPathFactory().create(nodeName, index));
            cne = loadNodeEntry(cId);
        }
        return cne;
    }
View Full Code Here

        if (isComplete()) {
            // nothing to do
            return;
        }

        NodeId id = parent.getWorkspaceId();
        Iterator<ChildInfo> childNodeInfos = factory.getItemStateFactory().getChildNodeInfos(id);
        update(childNodeInfos);
    }
View Full Code Here

    public void object() throws IOException {
        if (name != null) {
            try {
                NodeInfo current = getCurrentNodeInfo();
                Path relPath = pFactory.create(name, index);
                NodeId id = idFactory.createNodeId(current.getId(), relPath);
                Path currentPath = current.getPath();
                Path p = pFactory.create(currentPath, relPath, true);
                NodeInfo nInfo = new NodeInfoImpl(id, p);
                nodeInfos.push(nInfo);
                itemInfos.add(nInfo);
View Full Code Here

        return parentUri + "/" + Text.escape(resolver.getJCRName(childName));
    }

    private NodeId getParentId(DavPropertySet propSet, SessionInfo sessionInfo)
        throws RepositoryException {
        NodeId parentId = null;
        if (propSet.contains(ItemResourceConstants.JCR_PARENT)) {
            HrefProperty parentProp = new HrefProperty(propSet.get(ItemResourceConstants.JCR_PARENT));
            String parentHref = parentProp.getHrefs().get(0);
            if (parentHref != null && parentHref.length() > 0) {
                parentId = uriResolver.getNodeId(parentHref, sessionInfo);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.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.