Package org.exist.dom

Examples of org.exist.dom.DefaultDocumentSet


   *            Whether to use a folder hierarchy in the archive file that
   *            reflects the collection hierarchy
   */
  private void compressCollection(OutputStream os, Collection col, boolean useHierarchy, String stripOffset) throws IOException, SAXException, LockException, PermissionDeniedException {
    // iterate over child documents
    MutableDocumentSet childDocs = new DefaultDocumentSet();
    col.getDocuments(context.getBroker(), childDocs);
    for (Iterator<DocumentImpl> itChildDocs = childDocs.getDocumentIterator(); itChildDocs
        .hasNext();) {
      DocumentImpl childDoc = (DocumentImpl) itChildDocs.next();
      childDoc.getUpdateLock().acquire(Lock.READ_LOCK);
      try {
        compressResource(os, childDoc, useHierarchy, stripOffset, "", null);
View Full Code Here


        }
        return extractDocumentSet();
    }

    private DocumentSet extractDocumentSet() {
        final MutableDocumentSet docs = new DefaultDocumentSet();
        NodeValue node;
        for (int i = 0; i <= size; i++) {
            if (Type.subTypeOf(values[i].getType(), Type.NODE)) {
                node = (NodeValue) values[i];
                if (node.getImplementationType() == NodeValue.PERSISTENT_NODE)
                    {docs.add((org.exist.dom.DocumentImpl) node.getOwnerDocument());}
            }
        }
        return docs;
    }
View Full Code Here

                transact.abort(transaction);
                throw new RemoteException(
                        "collection " + collectionName + " not found");
            }
            final DocumentSet docs =
                    collection.allDocs(broker, new DefaultDocumentSet(), true);
            final XUpdateProcessor processor =
                    new XUpdateProcessor(broker, docs, AccessContext.SOAP);
            final Modification modifications[] =
                    processor.parse(new InputSource(new StringReader(xupdate)));
            long mods = 0;
View Full Code Here

            if (doc == null) {
                transact.abort(transaction);
                throw new RemoteException(
                        "document " + documentName + " not found");
            }
            final MutableDocumentSet docs = new DefaultDocumentSet();
            docs.add(doc);
            final XUpdateProcessor processor =
                    new XUpdateProcessor(broker, docs, AccessContext.SOAP);
            final Modification modifications[] =
                    processor.parse(new InputSource(new StringReader(xupdate)));
            long mods = 0;
View Full Code Here

        }
        entry.locksAcquired++;
    }

    public MutableDocumentSet toDocumentSet() {
        final MutableDocumentSet docs = new DefaultDocumentSet(size());
        LockedDocument lockedDocument;
        for(int idx = 0; idx < tabSize; idx++) {
            if(values[idx] == null || values[idx] == REMOVED)
                {continue;}
            lockedDocument = (LockedDocument) values[idx];
            docs.add(lockedDocument.document);
        }
        return docs;
    }
View Full Code Here

    }

    public DocumentSet getDocsByCollection(Collection collection,
            boolean includeSubColls, MutableDocumentSet targetSet) {
        if (targetSet == null)
            {targetSet = new DefaultDocumentSet(size());}
        LockedDocument lockedDocument;
        for(int idx = 0; idx < tabSize; idx++) {
            if(values[idx] == null || values[idx] == REMOVED)
                {continue;}
            lockedDocument = (LockedDocument) values[idx];
View Full Code Here

                  //TODO : how to enforce this ?
                  //If $node, or the context item if the second argument is omitted,
                  //is a node in a tree whose root is not a document node [err:FODC0001] is raised                    processInMem = true;
                    {processInMem = true;}
                else {
                    MutableDocumentSet ndocs = new DefaultDocumentSet();
                    ndocs.add(((NodeProxy)node).getDocument());
                    docs = ndocs;
                }
                contextSequence = node;
            } else if (contextSequence == null) {
                logger.error(ErrorCodes.XPDY0002 +  " No context item specified");
View Full Code Here

            parent.setTriggersEnabled(true);
        }
    }

  private void addRecord(DBBroker broker, String xupdate) throws TriggerException {
        MutableDocumentSet 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 (args.size() == 0) {
                //TODO : add default collection to the context
                //If the value of the default collection is undefined an error is raised [err:FODC0002].
                docs = context.getStaticallyKnownDocuments();
            } else {
                MutableDocumentSet ndocs = new DefaultDocumentSet();
                for (final String next : args) {
                    final XmldbURI uri = new AnyURIValue(next).toXmldbURI();
                    final Collection coll = context.getBroker().getCollection(uri);
                    if (coll == null) {
                        if (context.isRaiseErrorOnFailedRetrieval()) {
View Full Code Here

       
//        this.facetArrays = new FacetArrays(taxonomyReader.getSize());
        this.facetArrays = new FacetArrays(
                PartitionsUtils.partitionSize(searchParams.indexingParams, taxonomyReader));
       
        docbits = new DefaultDocumentSet(1031);//docs.getDocumentCount());
        //docbits = new FixedBitSet(docs.getDocumentCount());

    }
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.