Package javax.jcr

Examples of javax.jcr.NodeIterator


        }
    }

    public Object jsFunction_getNodes(String namePattern) {
        try {
            NodeIterator iter = null;
            if(namePattern == null || "undefined".equals(namePattern)) {
                iter = node.getNodes();
            } else {
                iter = node.getNodes(namePattern);
            }
View Full Code Here


        final List<Scriptable> items = new ArrayList<Scriptable>();

        // Add all matching nodes to result
        try {
            NodeIterator it = node.getNodes(name);
            while (it.hasNext()) {
                items.add(ScriptRuntime.toObject(this, it.nextNode()));
            }
        } catch (RepositoryException e) {
            log.debug("RepositoryException while collecting Node children",e);
        }

        // Add all matching properties to result
        try {
            PropertyIterator it = node.getProperties(name);
            while (it.hasNext()) {
                Property prop = it.nextProperty();
                int type = prop.getType();
                if (prop.getDefinition().isMultiple()) {
                    Value[] values = prop.getValues();
                    for (int i=0;i<values.length;i++) {
                        items.add(wrap(values[i]));
View Full Code Here

                }
            } catch (RepositoryException e) {
                //do nothing, just do not list properties
            }
            try {
                NodeIterator nit = node.getNodes();
                while (nit.hasNext()) {
                    ids.add(nit.nextNode().getName());
                }
            } catch (RepositoryException e) {
                //do nothing, just do not list child nodes
            }
        }
View Full Code Here

            //         so if the user has more than one session, locks from other
            //         sessions will be delivered as well.
            Query q = qm.createQuery(
                "/jcr:root//element(*,mix:lockable)[@jcr:lockOwner='"
                    + session.getUserID() + "']", Query.XPATH);
            NodeIterator ni = q.execute().getNodes();
            while (ni.hasNext()) {
                Node node = ni.nextNode();
                String path = node.getPath();
                try {
                    final Lock lock = node.getLock();
                    if (lock.getLockToken() == null) {
                        log.debug("Ignoring lock on {} held by {}, not held by this session",
View Full Code Here

    * @throws RepositoryException {@link RepositoryException}
    * @throws IllegalResourceTypeException {@link IllegalResourceTypeException}
    */
   public List<Resource> getResources() throws RepositoryException, IllegalResourceTypeException
   {
      NodeIterator children = node.getNodes();
      List<Resource> resources = new ArrayList<Resource>();
      while (children.hasNext())
      {
         Node node = children.nextNode();

         if (ResourceUtil.isVersioned(node))
         {
            if (ResourceUtil.isFile(node))
            {
View Full Code Here

            else
            {
               // create new TraversingNodeIterator for each child
               try
               {
                  NodeIterator children = currentNode.getNodes();
                  while (children.hasNext())
                  {
                     allIterators.add(new TraversingNodeIterator(children.nextNode(), maxDepth - 1));
                  }
               }
               catch (RepositoryException e)
               {
                  if (LOG.isTraceEnabled())
View Full Code Here

    * @throws RepositoryException {@link RepositoryException}
    * @throws IllegalResourceTypeException {@link IllegalResourceTypeException}
    */
   public List<Resource> getResources() throws RepositoryException, IllegalResourceTypeException
   {
      NodeIterator children = node.getNodes();
      List<Resource> resources = new ArrayList<Resource>();
      while (children.hasNext())
      {
         Node node = children.nextNode();

         if (ResourceUtil.isVersioned(node))
         {
            if (ResourceUtil.isFile(node))
            {
View Full Code Here

    this.domainSession = domainSession;
    this.jcrQuery = jcrQuery;
  }

  public org.chromattic.api.query.ObjectQueryResult<O> iterator() {
    final NodeIterator iterator;
    try {
      QueryResult result = jcrQuery.execute();
      iterator = result.getNodes();
      return new ObjectQueryResultImpl<O>(domainSession, iterator, clazz);
    }
View Full Code Here

        assertThat(rootNode, is(notNullValue()));

        Node systemNode = rootNode.getNode(JcrLexicon.SYSTEM.getString(registry));
        assertThat(systemNode, is(notNullValue()));

        NodeIterator namespacesNodes = systemNode.getNodes(DnaLexicon.NAMESPACES.getString(registry));
        assertEquals(namespacesNodes.getSize(), 1);
    }
View Full Code Here

        assertThat(rootNode, is(notNullValue()));

        Node systemNode = rootNode.getNode(JcrLexicon.SYSTEM.getString(registry));
        assertThat(systemNode, is(notNullValue()));

        NodeIterator nodeTypesNodes = systemNode.getNodes(JcrLexicon.NODE_TYPES.getString(registry));
        assertEquals(1, nodeTypesNodes.getSize());
    }
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.