Package javax.jcr

Examples of javax.jcr.NodeIterator


        ArrayList<DavResource> memberList = new ArrayList<DavResource>();
        if (exists()) {
            try {
                Node n = (Node)item;
                // add all node members
                NodeIterator it = n.getNodes();
                while (it.hasNext()) {
                    Node node = it.nextNode();
                    DavResourceLocator loc = getLocatorFromItem(node);
                    memberList.add(createResourceFromLocator(loc));
                }
                // add all property members
                PropertyIterator propIt = n.getProperties();
View Full Code Here


                    (NodeTypeImpl) node.getPrimaryNodeType(),
                    node.getMixinTypeNames(),
                    node.getSession()
            ));
        }
        NodeIterator niter = node.getNodes();
        while (niter.hasNext()) {
            NodeImpl n = (NodeImpl) niter.nextNode();
            recursiveAdd(events, node, n);
        }
    }
View Full Code Here

                node.getPrimaryPath().getNameElement(),
                (NodeTypeImpl) parent.getPrimaryNodeType(),
                parent.getMixinTypeNames(),
                node.getSession()
        ));
        NodeIterator niter = node.getNodes();
        while (niter.hasNext()) {
            NodeImpl n = (NodeImpl) niter.nextNode();
            recursiveRemove(events, node, n);
        }
    }
View Full Code Here

    /**
     * Returns a {@link SizedIterator} of the child nodes of <code>node</code>.
     */
    @SuppressWarnings("unchecked")
    protected SizedIterator<Node> getNodes(Node node) throws RepositoryException {
        NodeIterator nodes = node.getNodes();
        return getSizedIterator(nodes, nodes.getSize());
    }
View Full Code Here

    /**
     * Returns an iterator of iterators of the child nodes of <code>node</code>.
     */
    private Iterator<Iterator<Node>> childIterators(Node node) {
        try {
            final NodeIterator childNodes = node.getNodes();
            return new Iterator<Iterator<Node>>() {
                public boolean hasNext() {
                    return childNodes.hasNext();
                }
                public Iterator<Node> next() {
                    return iterator(childNodes.nextNode());
                }
                public void remove() {
                    throw new UnsupportedOperationException();
                }
            };
View Full Code Here

     * {@inheritDoc}
     */
    public Iterator<ChildInfo> getChildInfos(SessionInfo sessionInfo, NodeId parentId)
            throws ItemNotFoundException, RepositoryException {
        SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        NodeIterator children = getNode(parentId, sInfo).getNodes();
        List<ChildInfo> childInfos = new ArrayList<ChildInfo>();
        try {
            while (children.hasNext()) {
                childInfos.add(new ChildInfoImpl(children.nextNode(),
                        sInfo.getNamePathResolver()));
            }
        } catch (NameException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

            throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        return (Iterator<NodeId>) executeWithLocalEvents(new Callable() {
            public Object run() throws RepositoryException {
                String nodePath = getNodePath(nodeId, sInfo);
                NodeIterator it = getVersionManager(sInfo).merge(nodePath, srcWorkspaceName, bestEffort);
                List<NodeId> ids = new ArrayList<NodeId>();
                while (it.hasNext()) {
                    ids.add(idFactory.createNodeId(it.nextNode()
                    ));
                }
                return ids.iterator();
            }
        }, sInfo);
View Full Code Here

            throws NoSuchWorkspaceException, AccessDeniedException, MergeException, LockException, InvalidItemStateException, RepositoryException {
        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        return (Iterator<NodeId>) executeWithLocalEvents(new Callable() {
            public Object run() throws RepositoryException {
                String nodePath = getNodePath(nodeId, sInfo);
                NodeIterator it = getVersionManager(sInfo).merge(nodePath, srcWorkspaceName, bestEffort, isShallow);
                List<NodeId> ids = new ArrayList<NodeId>();
                while (it.hasNext()) {
                    ids.add(idFactory.createNodeId(it.nextNode()
                    ));
                }
                return ids.iterator();
            }
        }, sInfo);
View Full Code Here

    public Iterator<NodeId> mergeActivity(SessionInfo sessionInfo, final NodeId activityId) throws UnsupportedRepositoryOperationException, RepositoryException {
        final SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
        return (Iterator<NodeId>) executeWithLocalEvents(new Callable() {
            public Object run() throws RepositoryException {
                Node node = getNode(activityId, sInfo);
                NodeIterator it = getVersionManager(sInfo).merge(node);
                List<NodeId> ids = new ArrayList<NodeId>();
                while (it.hasNext()) {
                    ids.add(idFactory.createNodeId(it.nextNode()
                    ));
                }
                return ids.iterator();
            }
        }, sInfo);
View Full Code Here

        } catch (SAXException e) {
            throw new RepositoryException(e);
        }

        Node n = null;
        NodeIterator it = parent.getNodes(nodeName);
        while (it.hasNext()) {
            n = it.nextNode();
        }
        if (n == null) {
            throw new RepositoryException("Internal error: No child node added.");
        }
        return n;
View Full Code Here

TOP

Related Classes of javax.jcr.NodeIterator

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.