Package org.exist.dom

Examples of org.exist.dom.DefaultDocumentSet


        return new StringValue(text.toString());
    }

    private void generateWordList() throws XPathException {
    try {
      MutableDocumentSet docs = new DefaultDocumentSet();
            docs = context.getBroker().getAllXMLResources(docs);
            final IndexWorker indexWorker = context.getBroker().getIndexController().getWorkerByIndexName("lucene-index");

            final Map options = new HashMap();
            options.put(OrderedValuesIndex.START_VALUE, "");
View Full Code Here


    }

  private void addRecord(DBBroker broker, String xupdate) throws TriggerException {
    LOG.debug(xupdate);
    // create a document set containing "contents.xml"
    DefaultDocumentSet docs = new DefaultDocumentSet();
    docs.add(doc);
    try {
      // IMPORTANT: temporarily disable triggers on the collection.
      // We would end up in infinite recursion if we don't do that
      getCollection().setTriggersEnabled(false);
      // create the XUpdate processor
View Full Code Here

            if (childColl != null) {
                checkSub(broker, childColl);
            }
        }
   
    MutableDocumentSet childDocs = new DefaultDocumentSet();
    LockedDocumentMap lockedDocuments = new LockedDocumentMap();
    col.getDocuments(broker, childDocs, lockedDocuments, Lock.WRITE_LOCK);
   
    for (Iterator<DocumentImpl> itChildDocs = childDocs.getDocumentIterator(); itChildDocs.hasNext();) {
      DocumentImpl childDoc = itChildDocs.next();
     
      MetaData.get().addMetas(childDoc);
    }
  }
View Full Code Here

    if(policyCollection == null)
      {return null;}
    final int documentCount = policyCollection.getDocumentCount(broker);
    if(documentCount == 0)
      {return null;}
    final MutableDocumentSet documentSet = new DefaultDocumentSet(documentCount);
    return policyCollection.allDocs(broker, documentSet, recursive);
  }
View Full Code Here

   * @see org.xmldb.api.modules.XUpdateQueryService#updateResource(java.lang.String, java.lang.String)
   */
  public long updateResource(String resource, String xupdate)
    throws XMLDBException {
    final long start = System.currentTimeMillis();
    MutableDocumentSet docs = new DefaultDocumentSet();
        final TransactionManager transact = pool.getTransactionManager();
        final Txn transaction = transact.beginTransaction();
      final Subject preserveSubject = pool.getSubject();
    DBBroker broker = null;
    final org.exist.collections.Collection c = parent.getCollection();
    try {
      broker = pool.get(user);
      if (resource == null) {
        docs = c.allDocs(broker, docs, true);
      } else {
        final XmldbURI resourceURI = XmldbURI.xmldbUriFor(resource);
        final DocumentImpl doc = c.getDocument(broker, resourceURI);
        if(doc == null) {
                    transact.abort(transaction);
          throw new XMLDBException(ErrorCodes.INVALID_RESOURCE, "Resource not found: " + resource);
                }
        docs.add(doc);
      }
      if(processor == null)
        {processor = new XUpdateProcessor(broker, docs, parent.getAccessContext());}
      else {
        processor.setBroker(broker);
View Full Code Here

            Collection childColl = broker.getOrCreateCollection(null, XmldbURI.ROOT_COLLECTION_URI.append(childName));
           
            checkSub(broker, md, childColl);
        }
   
    MutableDocumentSet childDocs = new DefaultDocumentSet();
    LockedDocumentMap lockedDocuments = new LockedDocumentMap();
    col.getDocuments(broker, childDocs, lockedDocuments, Lock.WRITE_LOCK);
   
    for (Iterator<DocumentImpl> itChildDocs = childDocs.getDocumentIterator(); itChildDocs.hasNext();) {
      DocumentImpl childDoc = itChildDocs.next();
     
      Metas metas = md.addMetas(childDoc);
     
      if (metas != null) {
View Full Code Here

                deadlockCaught = false;
            MutableDocumentSet docs = null;
              try {
                  final org.exist.collections.Collection coll = collection.getCollection();
                  lockedDocuments = new LockedDocumentMap();
                  docs = new DefaultDocumentSet();
                  coll.allDocs(reservedBroker, docs, true, lockedDocuments, Lock.WRITE_LOCK);
              } catch (final LockException e) {
                  LOG.debug("Deadlock detected. Starting over again. Docs: " + docs.getDocumentCount() + "; locked: " +
                    lockedDocuments.size());
          lockedDocuments.unlock();
View Full Code Here

TOP

Related Classes of org.exist.dom.DefaultDocumentSet

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.