Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.ItemInfo


        assertEquals(Arrays.asList(new QValue[0]), Arrays.asList(pi.getValues()));
        assertFalse(pi.getType() == PropertyType.UNDEFINED);

        Iterator it = rs.getItemInfos(si, nid);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    assertTrue(pi.isMultiValued());
                    assertEquals(Arrays.asList(new QValue[0]), Arrays.asList(pi.getValues()));
                    assertFalse(pi.getType() == PropertyType.UNDEFINED);
View Full Code Here


    }

    private PropertyInfo getPropertyInfo(NodeId parentId, Name propName) throws RepositoryException {
        Iterator it = rs.getItemInfos(si, parentId);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    return pInfo;
                }
            }
View Full Code Here

    }

    private PropertyInfo getPropertyInfo(NodeId parentId, Name propName) throws RepositoryException {
        Iterator it = rs.getItemInfos(si, parentId);
        while (it.hasNext()) {
            ItemInfo info = (ItemInfo) it.next();
            if (!info.denotesNode()) {
                PropertyInfo pInfo = (PropertyInfo) info;
                if (propName.equals((pInfo.getId().getName()))) {
                    return pInfo;
                }
            }
View Full Code Here

        }

        // deal with all additional ItemInfos that may be present.
        NodeEntry parentEntry = nodeState.getNodeEntry();
        while (infos.hasNext()) {
            ItemInfo info = (ItemInfo) infos.next();
            if (info.denotesNode()) {
                createDeepNodeState((NodeInfo) info, parentEntry, infos);
            } else {
                createDeepPropertyState((PropertyInfo) info, parentEntry, infos);
            }
        }
View Full Code Here

        /**
         * @return <code>true</code> if the next info could be retrieved.
         */
        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 {
View Full Code Here

     */
    public void testGetItemInfosRootFirst() throws RepositoryException {
        itemInfosProvider = new Iterable() {
            Predicate isRoot = new Predicate() {
                public boolean evaluate(Object object) {
                    ItemInfo itemInfo = (ItemInfo) object;
                    return itemInfo.getPath().denotesRoot();
                }
            };

            @SuppressWarnings("unchecked")
            public Iterator<ItemInfo> iterator() {
View Full Code Here

        final String targetPath = "/node2/node21/node211/node2111/node21111/node211111/node2111111";

        itemInfosProvider = new Iterable() {
            Predicate isTarget = new Predicate() {
                public boolean evaluate(Object object) {
                    ItemInfo itemInfo = (ItemInfo) object;
                    return targetPath.equals(toJCRPath(itemInfo.getPath()));
                }
            };

            @SuppressWarnings("unchecked")
            public Iterator<ItemInfo> iterator() {
View Full Code Here

    }

    private void checkHierarchy() throws PathNotFoundException, RepositoryException, ItemNotFoundException,
            AccessDeniedException {
        for (Iterator<ItemInfo> itemInfos = itemInfosProvider.iterator(); itemInfos.hasNext();) {
            ItemInfo itemInfo = itemInfos.next();
            String jcrPath = toJCRPath(itemInfo.getPath());
            Item item = session.getItem(jcrPath);
            assertEquals(jcrPath, item.getPath());

            if (item.getDepth() > 0) {
                Node parent = item.getParent();
View Full Code Here

                                return info.getId();
                            }});

                Iterator<ItemInfo> childInfos = new TransformIterator(itemInfos.iterator(), new Transformer(){
                    public Object transform(Object input) {
                        ItemInfo info = (ItemInfo) input;
                        Name name = info.getPath().getNameElement().getName();
                        return new ChildInfoImpl(name, null, Path.INDEX_DEFAULT);
                    }});

                nodeInfo = new NodeInfoImpl(path, id, Path.INDEX_DEFAULT, NameConstants.NT_UNSTRUCTURED,
                        Name.EMPTY_ARRAY, EmptyIterator.INSTANCE, propertyIds, childInfos);
View Full Code Here

        // Assuming locality of the itemInfos, we keep an estimate of a parent entry.
        // This reduces the part of the hierarchy to traverse. For large batches this
        // optimization results in about 25% speed up.
        NodeEntry approxParentEntry = nodeState.getNodeEntry();
        while (infos.hasNext()) {
            ItemInfo info = (ItemInfo) infos.next();
            if (info.denotesNode()) {
                approxParentEntry = createDeepNodeState((NodeInfo) info, approxParentEntry, infos).getNodeEntry();
            } else {
                createDeepPropertyState((PropertyInfo) info, approxParentEntry, infos);
            }
        }
View Full Code Here

TOP

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

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.