Package javax.jcr

Examples of javax.jcr.NodeIterator.nextNode()


                                       SCHEMA_AREA,
                                       "nt:folder" );
            NodeIterator workspaceNodes = addNodeIfNew(schemaNode, WORKSPACE_AREA, "nt:folder").getNodes();
       
           while (workspaceNodes.hasNext()) {
            Node workspaceNode = workspaceNodes.nextNode();
            result.add(workspaceNode.getName());
           }

        } catch ( Exception e ) {
            log.error( e.getMessage(), e );
View Full Code Here


        try {
            it = this.getAreaNode( STATE_AREA ).getNodes();

            while ( it.hasNext() ) {
                states.add( new StateItem( this,
                                           it.nextNode() ) );
            }
        } catch ( RepositoryException e ) {
            log.error( e.getMessage(), e );
            throw new RulesRepositoryException( e );
        }
View Full Code Here

            nodes = rosterNode.getNodes();
        } catch (RepositoryException e) {
            return roster; // empty roster object
        }
        while (nodes != null && nodes.hasNext()) {
            Node node = nodes.nextNode();

            String contactJidString = null;
            try {
                contactJidString = node.getName();
            } catch (RepositoryException e) {
View Full Code Here

        } catch (RepositoryException e) {
            return; // failed to find any contacts, done.
        }
        boolean foundOne = false;
        while (nodes != null && nodes.hasNext()) {
            Node node = nodes.nextNode();
            String contactJidString = readAttribute(node, "jid");
            if (contactJidString != null && contactJidString.equals(jidContact.getFullQualifiedName())) {
                foundOne = true;
                try {
                    node.remove();
View Full Code Here

            }
        }

        NodeIterator childNodes = node.getNodes();
        while (childNodes.hasNext()) {
            Node childNode = childNodes.nextNode();
            buildNode(builder.child(childNode.getName()), childNode);
        }
    }

}
View Full Code Here

            @Override
            public Void perform() throws RepositoryException {
                // TODO: avoid nested calls
                NodeIterator sharedSet = getSharedSet();
                while (sharedSet.hasNext()) {
                    sharedSet.nextNode().removeShare();
                }
                return null;
            }
        });
    }
View Full Code Here

        Version v = vMgr.getBaseVersion(n.getPath());
        Query q = qm.createQuery("//element(*, nt:version)[@jcr:uuid = '" +
                v.getIdentifier() + "']", Query.XPATH);
        NodeIterator nodes = q.execute().getNodes();
        assertTrue(nodes.hasNext());
        assertTrue(nodes.nextNode() instanceof Version);
        RowIterator rows = q.execute().getRows();
        assertTrue(rows.hasNext());
        assertTrue(rows.nextRow().getNode() instanceof Version);
    }

View Full Code Here

                    node.getSession()
            ));
        }
        NodeIterator niter = node.getNodes();
        while (niter.hasNext()) {
            NodeImpl n = (NodeImpl) niter.nextNode();
            recursiveAdd(events, node, n);
        }
    }

    /**
 
View Full Code Here

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

                Node root = getSession().getNode(sr);
                NodeIterator nodes = collectNodes(value,
                        Collections.singleton(propertyName), ntName,
                        root.getNodes(), true, 1);
                if (nodes.hasNext()) {
                    return nodes.nextNode();
                }
            } catch (PathNotFoundException e) {
                // should not get here
                log.warn("Error while retrieving node " + sr);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.