Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeInfo


            throws ItemNotFoundException, RepositoryException {
        NodeState nodeState;
        ItemInfos infos = new ItemInfos(itemInfos);
        // first entry in the iterator is the originally requested Node.
        if (infos.hasNext()) {
            NodeInfo first = (NodeInfo) infos.next();
            if (isDeep) {
                // for a deep state, the hierarchy entry does not correspond to
                // the given NodeEntry -> retrieve NodeState before executing
                // validation check.
                nodeState = createDeepNodeState(first, entry, infos);
View Full Code Here


         * by the given <code>parentId</code> or <code>null</code> if the parent
         * has not been read yet, has already been processed (childInfo is up
         * to date) or does not provide child infos.
         */
        private Iterator getChildInfos(NodeId parentId) {
            NodeInfo nodeInfo = (NodeInfo) nodeInfos.get(parentId);
            while (nodeInfo == null && prefetch()) {
                nodeInfo = (NodeInfo) nodeInfos.get(parentId);
            }
            return nodeInfo == null? null : nodeInfo.getChildInfos();
        }
View Full Code Here

        private boolean prefetch() {
            if (infos.hasNext()) {
                ItemInfo info = (ItemInfo) infos.next();
                prefetchQueue.add(info);
                if (info.denotesNode()) {
                    NodeInfo nodeInfo = (NodeInfo) info;
                    nodeInfos.put(nodeInfo.getId(), nodeInfo);
                }
                return true;
            } else {
                return false;
            }
View Full Code Here

        NodeId id = rs.getIdFactory().createNodeId(nid, resolver.getQPath("aNode"));
        Iterator it = rs.getItemInfos(si, id);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (info.denotesNode()) {
                NodeInfo nInfo = (NodeInfo) info;
                assertEquals(NameConstants.NT_UNSTRUCTURED, nInfo.getNodetype());
                Iterator childIt = nInfo.getChildInfos();
                assertTrue(childIt == null || !childIt.hasNext());
                assertEquals(id, nInfo.getId());
            }
        }

        b = rs.createBatch(si, nid);
        b.remove(id);
View Full Code Here

        NodeId id = getNodeId(testPath + "/testUUIDNode");
        b.setMixins(id, new Name[] {NameConstants.MIX_REFERENCEABLE});

        rs.submit(b);

        NodeInfo nInfo = rs.getNodeInfo(si, id);
        assertEquals(uuid, nInfo.getId().getUniqueID());
        Name[] mixins = nInfo.getMixins();
        assertEquals(1, mixins.length);
        assertEquals(NameConstants.MIX_REFERENCEABLE, mixins[0]);

        b = rs.createBatch(si, nid);
        b.remove(rs.getIdFactory().createNodeId(uuid));
View Full Code Here

        b = rs.createBatch(si, id);
        b.setMixins(id, new Name[0]);
        rs.submit(b);

        NodeInfo nInfo = rs.getNodeInfo(si, id);
        assertEquals(0, nInfo.getMixins().length);
    }
View Full Code Here

        assertEquals(PropertyType.BOOLEAN, pi.getType());
    }

    public void testSetReferenceValue() throws RepositoryException {
        NodeId nid = getNodeId(testPath);
        NodeInfo nInfo = rs.getNodeInfo(si, nid);
        if (!Arrays.asList(nInfo.getMixins()).contains(NameConstants.MIX_REFERENCEABLE)) {
            Batch b = rs.createBatch(si, nid);
            b.setMixins(nid, new Name[] {NameConstants.MIX_REFERENCEABLE});
            rs.submit(b);
        }
View Full Code Here

    public Iterator getItemInfos(SessionInfo sessionInfo, NodeId nodeId) throws RepositoryException {
        // TODO: implement batch read properly:
        // currently: missing 'value/values' property PropertyInfo cannot be built
        // currently: missing prop-names with child-NodeInfo
        List l = new ArrayList();
        NodeInfo nInfo = getNodeInfo(sessionInfo, nodeId);
        l.add(nInfo);
        // at least add propertyInfos for the meta-props already known from the
        // nodeInfo.
        l.addAll(buildPropertyInfos(nInfo));
        return l.iterator();
View Full Code Here

        } catch (NameException e) {
            // ignore. should never occur
        }
        int depth = batchReadConfig.getDepth(ntName);
        if (depth == BatchReadConfig.DEPTH_DEFAULT) {
            NodeInfo info;
            try {
                info = new NodeInfoImpl(node, idFactory, sInfo.getNamePathResolver());
            } catch (NameException e) {
                throw new RepositoryException(e);
            }
View Full Code Here

        // TODO: implement batch read properly:
        // currently: missing 'value/values' property PropertyInfo cannot be built
        // currently: missing prop-names with child-NodeInfo
        if (itemId.denotesNode()) {
            List<ItemInfo> l = new ArrayList<ItemInfo>();
            NodeInfo nInfo = getNodeInfo(sessionInfo, (NodeId) itemId);
            l.add(nInfo);
            // at least add propertyInfos for the meta-props already known from the
            // nodeInfo.
            l.addAll(buildPropertyInfos(nInfo));
            return l.iterator();
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.NodeInfo

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.