Package org.apache.jackrabbit.mk.model

Examples of org.apache.jackrabbit.mk.model.ChildNodeEntry


        }
        markedNodes++;
       
        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
        while (iter.hasNext()) {
            ChildNodeEntry c = iter.next();
            markNode(getNode(c.getId()));
        }
    }
View Full Code Here


                    // optimization for large child node lists:
                    // no need to iterate over the entire child node list if the filter
                    // does not include wildcards
                    int count = maxChildNodes == -1 ? Integer.MAX_VALUE : maxChildNodes;
                    for (String name : childFilter.getInclusionPatterns()) {
                        ChildNodeEntry cne = node.getChildNodeEntry(name);
                        if (cne != null) {
                            boolean incl = true;
                            for (String exclName : childFilter.getExclusionPatterns()) {
                                if (name.equals(exclName)) {
                                    incl = false;
                                    break;
                                }
                            }
                            if (incl) {
                                if (count-- <= 0) {
                                    break;
                                }
                                builder.key(name).object();
                                if (depth > 0) {
                                    toJson(builder, rep.getRevisionStore().getNode(cne.getId()), depth - 1, 0, maxChildNodes, inclVirtualProps, filter);
                                }
                                builder.endObject();
                            }
                        }
                    }
                    return;
                }
            }

            int count = maxChildNodes;
            if (count != -1
                    && filter != null
                    && filter.getChildNodeFilter() != null) {
                // specific maxChildNodes limit and child node filter
                count = -1;
            }
            int numSiblings = 0;

            for (Iterator<ChildNodeEntry> it = node.getChildNodeEntries(offset, count); it.hasNext(); ) {
                ChildNodeEntry cne = it.next();
                if (filter == null || filter.includeNode(cne.getName())) {
                    if (maxChildNodes != -1 && ++numSiblings > maxChildNodes) {
                        break;
                    }
                    builder.key(cne.getName()).object();
                    if (depth > 0) {
                        toJson(builder, rep.getRevisionStore().getNode(cne.getId()), depth - 1, 0, maxChildNodes, inclVirtualProps, filter);
                    }
                    builder.endObject();
                }
            }
        }
View Full Code Here

            throw new IllegalArgumentException("illegal path");
        }

        StoredNode node = rs.getRootNode(revId);
        for (String name : PathUtils.elements(path)) {
            ChildNodeEntry cne = node.getChildNodeEntry(name);
            if (cne == null) {
                throw new NotFoundException();
            }
            node = rs.getNode(cne.getId()) ;
        }
        return node;
    }
View Full Code Here

            throw new IllegalArgumentException("illegal path");
        }

        StoredNode node = rs.getRootNode(revId);
        for (String name : PathUtils.elements(path)) {
            ChildNodeEntry cne = node.getChildNodeEntry(name);
            if (cne == null) {
                return false;
            }
            node = rs.getNode(cne.getId()) ;
        }
        return true;
    }
View Full Code Here

        }
        markedNodes++;
       
        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
        while (iter.hasNext()) {
            ChildNodeEntry c = iter.next();
            markNode(getNode(c.getId()));
        }
    }
View Full Code Here

                    // optimization for large child node lists:
                    // no need to iterate over the entire child node list if the filter
                    // does not include wildcards
                    int count = maxChildNodes == -1 ? Integer.MAX_VALUE : maxChildNodes;
                    for (String name : childFilter.getInclusionPatterns()) {
                        ChildNodeEntry cne = node.getChildNodeEntry(name);
                        if (cne != null) {
                            boolean incl = true;
                            for (String exclName : childFilter.getExclusionPatterns()) {
                                if (name.equals(exclName)) {
                                    incl = false;
                                    break;
                                }
                            }
                            if (incl) {
                                if (count-- <= 0) {
                                    break;
                                }
                                builder.key(name).object();
                                if (depth > 0) {
                                    toJson(builder, rep.getRevisionStore().getNode(cne.getId()), depth - 1, 0, maxChildNodes, inclVirtualProps, filter);
                                }
                                builder.endObject();
                            }
                        }
                    }
                    return;
                }
            }

            int count = maxChildNodes;
            if (count != -1
                    && filter != null
                    && filter.getChildNodeFilter() != null) {
                // specific maxChildNodes limit and child node filter
                count = -1;
            }
            int numSiblings = 0;

            for (Iterator<ChildNodeEntry> it = node.getChildNodeEntries(offset, count); it.hasNext(); ) {
                ChildNodeEntry cne = it.next();
                if (filter == null || filter.includeNode(cne.getName())) {
                    if (maxChildNodes != -1 && ++numSiblings > maxChildNodes) {
                        break;
                    }
                    builder.key(cne.getName()).object();
                    if (depth > 0) {
                        toJson(builder, rep.getRevisionStore().getNode(cne.getId()), depth - 1, 0, maxChildNodes, inclVirtualProps, filter);
                    }
                    builder.endObject();
                }
            }
        }
View Full Code Here

        };
    }

    @Override
    public NodeState getChildNode(String name) {
        ChildNodeEntry entry = node.getChildNodeEntry(name);
        if (entry != null) {
            return getChildNodeEntry(entry).getNode();
        } else {
            return null;
        }
View Full Code Here

        }
        markedNodes++;
       
        Iterator<ChildNodeEntry> iter = node.getChildNodeEntries(0, -1);
        while (iter.hasNext()) {
            ChildNodeEntry c = iter.next();
            markNode(getNode(c.getId()));
        }
    }
View Full Code Here

        }

        return new AbstractRangeIterator<String>(getEntries(offset, count), 0, -1) {
            @Override
            protected String doNext() {
                ChildNodeEntry cne = (ChildNodeEntry) it.next();
                return cne.getName();
            }
        };
    }
View Full Code Here

    @Override
    public ChildNodeEntry rename(String oldName, String newName) {
        if (oldName.equals(newName)) {
            return get(oldName);
        }
        ChildNodeEntry old = remove(oldName);
        if (old == null) {
            return null;
        }
        add(new ChildNodeEntry(newName, old.getId()));
        return old;
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.mk.model.ChildNodeEntry

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.