Package org.exist.dom

Examples of org.exist.dom.DocumentSet


            } else {
                return( nodeSetCompare( nodes, contextSequence ) );
            }

            //Get the documents from the node set
            final DocumentSet docs   = nodes.getDocumentSet();

            //Holds the result
            NodeSet           result = null;

            //Iterate through the right hand sequence
View Full Code Here


            if (collection == null) {
                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)));
View Full Code Here

   
    if(idval.isEmpty() || (getArgumentCount() == 1 && contextSequence != null && contextSequence.isEmpty()))
            {result = Sequence.EMPTY_SEQUENCE;}
        else {
        String nextId;
        DocumentSet docs = null;
            if (getArgumentCount() == 2) {
                // second argument should be a node, whose owner document will be
                // searched for the id
                final Sequence nodes = getArgument(1).eval(contextSequence);
                if (nodes.isEmpty()) {
View Full Code Here

             //if (context.getProfiler().isEnabled())
                 //context.getProfiler().end(this, "fn:collection: loading documents", cached);
             //return cached;
        // }
        //Build the document set
        DocumentSet docs = null;
        try {
            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()) {
                            throw new XPathException("FODC0002: can not access collection '" + uri + "'");
                        }
                    } else {
                        if (context.inProtectedMode())
                            {context.getProtectedDocs().getDocsByCollection(coll, includeSubCollections, ndocs);}
                        else
                            {coll.allDocs(context.getBroker(), ndocs,
                                includeSubCollections, context.getProtectedDocs());}
                    }
                }
                docs = ndocs;
            }
        } catch (final XPathException e) { //From AnyURIValue constructor
            e.setLocation(line, column);
            throw new XPathException("FODC0002: " + e.getMessage());
        } catch(final PermissionDeniedException pde) {
            throw new XPathException("FODC0002: can not access collection '" + pde.getMessage() + "'");
           
        }
        // iterate through all docs and create the node set
        final NodeSet result = new NewArrayNodeSet(docs.getDocumentCount(), 1);
        Lock dlock;
        DocumentImpl doc;
        for (final Iterator<DocumentImpl> i = docs.getDocumentIterator(); i.hasNext();) {
            doc = i.next();
            dlock = doc.getUpdateLock();
            boolean lockAcquired = false;
            try {
                if (!context.inProtectedMode() && !dlock.hasLock()) {
View Full Code Here

    private Boolean savedConfig;

    @Test
    public void simpleQueries() {
        System.out.println("Test simple queries ...");
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, XML1, "test.xml");
        DBBroker broker = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
View Full Code Here

        }
    }

    @Test
    public void configuration() {
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG4, XML4, "test.xml");
        DBBroker broker = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
View Full Code Here

    }

    @Test
    public void inlineAndIgnore() {
        System.out.println("Test simple queries ...");
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG5, XML5, "test.xml");
        DBBroker broker = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
View Full Code Here

        }
    }

    @Test
    public void analyzers() {
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG3, XML3, "test.xml");
        DBBroker broker = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
View Full Code Here

    }

    @Test
    public void dropSingleDoc() {
        System.out.println("Test removal of single document ...");
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, XML1, "dropDocument.xml");
        DBBroker broker = null;
        TransactionManager transact = null;
        Txn transaction = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
View Full Code Here

    }

    @Test
    public void removeCollection() {
        System.out.println("Test removal of collection ...");
        DocumentSet docs = configureAndStore(COLLECTION_CONFIG1, "samples/shakespeare");
        DBBroker broker = null;
        TransactionManager transact = null;
        Txn transaction = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
View Full Code Here

TOP

Related Classes of org.exist.dom.DocumentSet

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.