Examples of collectionIterator()


Examples of org.exist.collections.Collection.collectionIterator()

                    dd.setType(doc.getResourceType() == DocumentImpl.BINARY_FILE
                            ? DocumentType.BinaryResource
                            : DocumentType.XMLResource);
                    docs.add(dd);
                }
                for(final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext();) {
                    collections.add(i.next().toString());
                }
            }
            Permission perms = collection.getPermissionsNoLock();
            desc.setCollections(new Strings(collections.toArray(new String[collections.size()])));
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

            for (Iterator<DocumentImpl> i = root.iterator(broker); i.hasNext(); ) {
                DocumentImpl doc = i.next();
                root.removeXMLResource(transaction, broker, doc.getURI().lastSegment());
            }
            broker.saveCollection(transaction, root);
            for (Iterator<XmldbURI> i = root.collectionIterator(broker); i.hasNext(); ) {
                XmldbURI childName = i.next();
                if (childName.equals("system"))
                    continue;
                Collection childColl = broker.getOrCreateCollection(transaction, XmldbURI.ROOT_COLLECTION_URI.append(childName));
                assertNotNull(childColl);
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

          }
        }
      }
     
      subcollections = new ArrayList<>(collection.getChildCollectionCount(context.getBroker()));
      for (Iterator<XmldbURI> i = collection.collectionIterator(context.getBroker()); i.hasNext(); ) {
        subcollections.add(i.next());
      }
    } finally {
      if (collection != null)
        collection.getLock().release(Lock.READ_LOCK);
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

                    hash.put("group", perms.getGroup().getName());
                    hash.put("permissions", Integer.valueOf(perms.getMode()));
                    hash.put("type", doc.getResourceType() == DocumentImpl.BINARY_FILE ? "BinaryResource" : "XMLResource");
                    docs.addElement(hash);
                }
                for(final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); ) {
                    collections.addElement(i.next().toString());
                }
            }
           
            final Permission perms = collection.getPermissionsNoLock();
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

                throw new EXistException("collection " + collUri + " not found!");
            }
            final HashMap<String, Object> desc = new HashMap<String, Object>();
            final List<String> collections = new ArrayList<String>();
            if (collection.getPermissionsNoLock().validate(user, Permission.READ)) {
                for (final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); ) {
                    collections.add(i.next().toString());
                }
            }
            final Permission perms = collection.getPermissionsNoLock();
            desc.put("collections", collections);
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

              if (LOG.isDebugEnabled()) {
                LOG.debug("collection " + collUri + " not found.");
                }
                return vec;
            }
            for(final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); ) {
                vec.addElement(i.next().toString());
            }
            return vec;
        } finally {
            if(collection != null) {
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

            if (collection == null)
                {throw new EXistException("Collection " + collUri + " not found");}
            if (!collection.getPermissionsNoLock().validate(user, Permission.READ))
                {throw new PermissionDeniedException("not allowed to read collection " + collUri);}
            final HashMap<XmldbURI, List<Object>> result = new HashMap<XmldbURI, List<Object>>(collection.getChildCollectionCount(broker));
            for (final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); ) {
              final XmldbURI child = i.next();
              final XmldbURI path = collUri.append(child);
                final Collection childColl = broker.getCollection(path);
                final Permission perm = childColl.getPermissionsNoLock();
                final List<Object> tmp = new ArrayList<Object>(3);
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

   
  private static void wipeDatabase() throws Exception {
    Transaction tx = db.requireTransactionWithBroker();
    try {
      Collection root = tx.broker.getCollection(XmldbURI.ROOT_COLLECTION_URI);
      for (Iterator<XmldbURI> it = root.collectionIterator(tx.broker); it.hasNext(); ) {
        XmldbURI childName = it.next();
        if (!childName.getCollectionPath().equals(XmldbURI.SYSTEM_COLLECTION_NAME)) {
          tx.broker.removeCollection(tx.tx, tx.broker.getCollection(root.getURI().append(childName)));
        }
      }
View Full Code Here

Examples of org.exist.collections.Collection.collectionIterator()

        try {
            collection = getCollectionWithLock(Lock.READ_LOCK);
            broker = brokerPool.get(user);
            final String[] collections = new String[collection.getChildCollectionCount(broker)];
            int j = 0;
            for(final Iterator<XmldbURI> i = collection.collectionIterator(broker); i.hasNext(); j++) {
                collections[j] = i.next().toString();
            }
            return collections;
        } catch(final EXistException e) {
            throw new XMLDBException(ErrorCodes.UNKNOWN_ERROR, "error while retrieving resource: " + e.getMessage(), e);
View Full Code Here

Examples of org.purl.sword.base.Workspace.collectionIterator()

         workspaceNode = new DefaultMutableTreeNode(wrapper);
         treeModel.insertNodeInto(workspaceNode, serviceNode, serviceNode.getChildCount());
         services.scrollPathToVisible(new TreePath(workspaceNode.getPath()));

         DefaultMutableTreeNode collectionNode = null;
         Iterator<Collection> collections = workspace.collectionIterator();
         for (; collections.hasNext();)
         {
            Collection collection = collections.next();
            wrapper = new TreeNodeWrapper(collection.getTitle(), collection);
            collectionNode = new DefaultMutableTreeNode(wrapper);
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.