Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeInfo


        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 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);
            } catch (RepositoryException e) {
                throw new IOException(e.getMessage());
            }
View Full Code Here

    }

    public void endObject() throws IOException {
        try {
            NodeInfoImpl nInfo = (NodeInfoImpl) nodeInfos.pop();
            NodeInfo parent = getCurrentNodeInfo();
            if (parent != null) {
                if (nInfo.getPath().getAncestor(1).equals(parent.getPath())) {
                    ChildInfo ci = new ChildInfoImpl(nInfo.getName(), nInfo.getUniqueID(), nInfo.getIndex());
                    ((NodeInfoImpl) parent).addChildInfo(ci);
                } else {
                    log.debug("NodeInfo '"+ nInfo.getPath() + "' out of hierarchy. Parent path = " + parent.getPath());
                }
            }
            if (!nInfo.isCompleted()) {
                log.debug("Incomplete NodeInfo '"+ nInfo.getPath() + "' -> Only present as ChildInfo with its parent.");
                itemInfos.remove(nInfo);
View Full Code Here

            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

        if (create) {
            createTestNode(path);
            testPath  = path;
        }

        NodeInfo nInfo = rs.getNodeInfo(si, getNodeId(path));
        //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
        assertEquals(testName, nInfo.getPath().getNameElement().getName());

        Iterator it = rs.getItemInfos(si, getNodeId(path));
        assertTrue(it.hasNext());
        nInfo = (NodeInfo) it.next();
        //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
        assertEquals(testName, nInfo.getPath().getNameElement().getName());
    }
View Full Code Here

         Name testName = resolver.getQName("test");
         testPath = "/test";
         createTestNode("/test");
         createTestNode("/test");

         NodeInfo nInfo = rs.getNodeInfo(si, getNodeId("/test[2]"));
         //System.out.println("NodeInfo: " + nInfo.getPath().getNameElement().getName());
         assertEquals(testName, nInfo.getPath().getNameElement().getName());

         Iterator it = rs.getItemInfos(si, getNodeId("/test[2]"));
         assertTrue(it.hasNext());
         nInfo = (NodeInfo) it.next();
         //System.out.println("ItemInfo: " + nInfo.getPath().getNameElement().getName());
         assertEquals(testName, nInfo.getPath().getNameElement().getName());

         removeTestNode("/test[2]");
     }
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<ChildInfo> getChildInfos(NodeId parentId) {
            NodeInfo nodeInfo = nodeInfos.get(parentId);
            while (nodeInfo == null && prefetch()) {
                nodeInfo = nodeInfos.get(parentId);
            }
            return nodeInfo == null? null : nodeInfo.getChildInfos();
        }
View Full Code Here

        private boolean prefetch() {
            if (infos.hasNext()) {
                ItemInfo info = 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

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.