Package org.exist.dom

Examples of org.exist.dom.BinaryDocument


       * @param request The HttpServletRequest for which the description should be created
       */
      private void createInternalDescription(HttpServletRequest request) throws XPathException, SAXException, PermissionDeniedException, NotFoundException
      {
        // 1) Get the XQWS
        final BinaryDocument docXQWS = getXQWS(broker, XQWSPath);
   
        if(docXQWS == null)
        {
          throw new NotFoundException("Resource " + request.getRequestURL().toString() + " not found");
        }
   
        xqwsFileURI = docXQWS.getFileURI();
        xqwsCollectionURI = docXQWS.getCollection().getURI();
        final byte[] xqwsData = getXQWSData(broker, docXQWS);
           
        // 2) Store last modified date
        lastModifiedXQWS = docXQWS.getMetadata().getLastModified();
       
            // 3) Get the XQWS Namespace
            xqwsNamespace = getXQWSNamespace(xqwsData);
           
            // 4) Compile a Simple XQuery to access the module
            final CompiledXQuery compiled = XQueryIncludeXQWS(broker, docXQWS.getFileURI(), xqwsNamespace, docXQWS.getCollection().getURI());
           
            // 5) Inspect the XQWS and its function signatures and create a small XML document to represent it
            modXQWS = compiled.getContext().getModule(xqwsNamespace.getNamespaceURI());
            docXQWSDescription = describeWebService(modXQWS, xqwsFileURI, request, XQWSPath, null, null);
      }
View Full Code Here


         *
         * @return  The XQWS BinaryDocument
         */
        private BinaryDocument getXQWS(DBBroker broker, String path) throws PermissionDeniedException
        {
          BinaryDocument docXQWS = null;
            try
            {
              final XmldbURI pathUri = XmldbURI.create(path);       
              docXQWS = (BinaryDocument) broker.getXMLResource(pathUri, Lock.READ_LOCK);
              return docXQWS;
            }
            finally
            {
                //close the XQWS Document and release the read lock
              if(docXQWS != null)
              {
                docXQWS.getUpdateLock().release(Lock.READ_LOCK);
                }             
            }
        }
View Full Code Here

                    absoluteId = absoluteId.shiftRight(32);
                    final int collectionId = absoluteId.and(BigInteger.valueOf(0xFFFFFFFF)).intValue();
                   
                    doc = context.getBroker().getResourceById(collectionId, resourceType, documentId);
                    if(doc instanceof BinaryDocument) {
                        final BinaryDocument bin = (BinaryDocument) doc;
                        final InputStream is = context.getBroker().getBinaryResource(bin);
                        final Base64BinaryDocument b64doc = Base64BinaryDocument.getInstance(context, is);
                        return b64doc;
                    } else {
                        return new NodeProxy(doc);
View Full Code Here

            IndexInfo info = root.validateXMLResource(transaction, broker, doc1uri.lastSegment(), XML);
            assertNotNull(info);
            root.store(transaction, broker, info, XML, false);

            System.out.println("store "+doc2uri);
            BinaryDocument doc = root.addBinaryResource(transaction, broker, doc2uri.lastSegment(), BINARY.getBytes(), null);
            assertNotNull(doc);

            transact.commit(transaction);
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here

TOP

Related Classes of org.exist.dom.BinaryDocument

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.