Package org.exist.collections

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


                }
                if (uri != null || res.inputSource!=null) {
                    setupParser(collection, res);
                    info = collection.validateXMLResource(txn, broker, resURI, (uri != null) ? new InputSource(uri) : res.inputSource);
                } else if (res.root != null) {
                    info = collection.validateXMLResource(txn, broker, resURI, res.root);
                } else {
                    info = collection.validateXMLResource(txn, broker, resURI, res.content);
                }
                //Notice : the document should now have a Lock.WRITE_LOCK update lock
                //TODO : check that no exception occurs in order to allow it to be released
View Full Code Here


                    setupParser(collection, res);
                    info = collection.validateXMLResource(txn, broker, resURI, (uri != null) ? new InputSource(uri) : res.inputSource);
                } else if (res.root != null) {
                    info = collection.validateXMLResource(txn, broker, resURI, res.root);
                } else {
                    info = collection.validateXMLResource(txn, broker, resURI, res.content);
                }
                //Notice : the document should now have a Lock.WRITE_LOCK update lock
                //TODO : check that no exception occurs in order to allow it to be released
                info.getDocument().getMetadata().setMimeType(res.getMimeType());
                if (res.datecreated  != null) {
View Full Code Here

          final DocumentImpl entryDoc = collection.getDocument(broker, entryURI);
          if (entryDoc != null) {
            throw new PermissionDeniedException("Entry with " + id
                + " already exists.");
          }
          final IndexInfo info = collection.validateXMLResource(transaction, broker, entryURI, doc);
          setPermissions(broker, root, info.getDocument());
          // TODO : We should probably unlock the collection here
          collection.store(transaction, broker, info, doc, false);

          // Update the updated element
View Full Code Here

        final File tempFile = storeInTemporaryFile(request.getInputStream(), request.getContentLength());

        if (mime.isXMLType()) {
          InputStream is = new FileInputStream(tempFile);
         
          final IndexInfo info = collection.validateXMLResource(
              transaction, broker, docUri,
              new InputSource(new InputStreamReader(is, charset)));
         
          is.close();
          info.getDocument().getMetadata().setMimeType(contentType);
View Full Code Here

          final DocumentImpl entryDoc = collection.getDocument(broker, entryURI);
          if (entryDoc != null)
            {throw new PermissionDeniedException("Entry with " + id + " already exists.");}

          final IndexInfo info = collection.validateXMLResource(transaction, broker, entryURI, mediaEntry);
          // TODO : We should probably unlock the collection here
          collection.store(transaction, broker, info, mediaEntry, false);
          // Update the updated element
          DOMDB.replaceTextElement(
              transaction, feedRoot, Atom.NAMESPACE_STRING, "updated",
View Full Code Here

            request.getContentLength());

        if (mime.isXMLType()) {
          InputStream is = new FileInputStream(tempFile);
         
          final IndexInfo info = collection.validateXMLResource(
              transaction, broker, docUri,
              new InputSource(new InputStreamReader(is, charset)));
         
          is.close();
         
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.