Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.NodeInfo


    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


    }

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

        try {
            NodeInfoImpl nInfo = (NodeInfoImpl) nodeInfos.pop();
            List<PropertyInfoImpl> props = propInfoLists.pop();
            // all required information to create a node info should now be gathered
            nInfo.setPropertyInfos(props.toArray(new PropertyInfoImpl[props.size()]), idFactory);
            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()) {
                itemInfos.addAll(props);
                itemInfos.add(nInfo);
View Full Code Here

            NodeId srcId = getNodeId(testPath);
            NodeId destParentId = getNodeId("/");
            rs.copy(si, si.getWorkspaceName(), srcId, destParentId, resolver.getQName("destname"));

            nid = getNodeId("/destname");
            NodeInfo nInfo = rs.getNodeInfo(si, nid);
            Iterator<? extends ItemInfo> it = rs.getItemInfos(si, nid);

            assertTrue(it.hasNext());
            NodeInfo nInfo2 = (NodeInfo) it.next();
            assertEquals(nInfo.getId(), nInfo2.getId());
            assertEquals(nInfo.getNodetype(), nInfo2.getNodetype());
        } finally {
            if (nid != null) {
                Batch b = rs.createBatch(si, getNodeId("/"));
                b.remove(nid);
                rs.submit(b);
View Full Code Here

        NodeId srcId = getNodeId(testPath);
        NodeId destParentId = getNodeId("/");
        rs.copy(sInfo, si.getWorkspaceName(), srcId, destParentId, resolver.getQName("destname"));

        copiedId = getNodeId("/destname");
        NodeInfo nInfo = rs.getNodeInfo(sInfo, copiedId);
        Iterator<? extends ItemInfo> it = rs.getItemInfos(sInfo, copiedId);

        assertTrue(it.hasNext());
        NodeInfo nInfo2 = (NodeInfo) it.next();
        assertEquals(nInfo.getId(), nInfo2.getId());
        assertEquals(nInfo.getNodetype(), nInfo2.getNodetype());
    }
View Full Code Here

        NodeId srcId = getNodeId(testPath);
        NodeId destParentId = getNodeId("/");
        rs.clone(sInfo, si.getWorkspaceName(), srcId, destParentId, resolver.getQName("destname"), true);

        clonedId = getNodeId("/destname");
        NodeInfo nInfo = rs.getNodeInfo(sInfo, clonedId);
        Iterator<? extends ItemInfo> it = rs.getItemInfos(sInfo, clonedId);

        assertTrue(it.hasNext());
        NodeInfo nInfo2 = (NodeInfo) it.next();
        assertEquals(nInfo.getId(), nInfo2.getId());
        assertEquals(nInfo.getNodetype(), nInfo2.getNodetype());
    }
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

        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().getName());

        Iterator<? extends ItemInfo > 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().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().getName());

         Iterator<? extends ItemInfo> 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().getName());

         removeTestNode("/test[2]");
     }
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.