Package org.exist.xquery

Examples of org.exist.xquery.XQuery.newContext()


    CompiledXQuery feedQuery = xquery.getXQueryPool().borrowCompiledXQuery(
        broker, getFeedSource);

    XQueryContext context;
    if (feedQuery == null) {
      context = xquery.newContext(AccessContext.REST);
      try {
        feedQuery = xquery.compile(context, getFeedSource);
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery "
            + getFeedSource.getURL(), ex);
View Full Code Here


                LOG.info(String.format("No Xquery found at '%s'", path));

            } else {
                // Setup xquery service
                XQuery service = broker.getXQueryService();
                context = service.newContext(AccessContext.TRIGGER);

                // Allow use of modules with relative paths
                String moduleLoadPath = StringUtils.substringBeforeLast(path, "/");
                context.setModuleLoadPath(moduleLoadPath);
View Full Code Here

                final XQueryPool xqpool = xquery.getXQueryPool();
                CompiledXQuery compiled = xqpool.borrowCompiledXQuery(broker, source);
                XQueryContext context;
                if (compiled == null)
                    {context = xquery.newContext(AccessContext.REST);}
                else
                    {context = compiled.getContext();}
                context.setStaticallyKnownDocuments(new XmldbURI[] { pathUri });
                context.setBaseURI(new AnyURIValue(pathUri.toString()));
View Full Code Here

 
          if (source == null) return null;
 
          XQuery xquery = broker.getXQueryService();
     
          XQueryContext queryContext = xquery.newContext(AccessContext.REST);
 
      // Find correct script load path
      queryContext.setModuleLoadPath(XmldbURI.create(uri).removeLastSegment().toString());
 
      CompiledXQuery compiled;
View Full Code Here

                XQueryContext context;
                CompiledXQuery compiled = pool.borrowCompiledXQuery(serializer.broker, source);
                if (compiled != null)
                    {context = compiled.getContext();}
                else
                    {context = xquery.newContext(AccessContext.XINCLUDE);}
                context.declareNamespaces(namespaces);
                context.declareNamespace("xinclude", XINCLUDE_NS);
               
                //setup the http context if known
                if(serializer.httpContext != null)
View Full Code Here

        try {
            broker = brokerPool.get(user);
           
            CompiledXQuery compiled =null;
            final XQuery xquery = broker.getXQueryService();
            final XQueryContext context = xquery.newContext(AccessContext.INTERNAL_PREFIX_LOOKUP);
           
            if(collection!=null){
                context.declareVariable(COLLECTION, collection);
            }
           
View Full Code Here

      if (collection == null)
        {throw new BadRequestException("Collection " + request.getPath() + " does not exist.");}

      final XQuery xquery = broker.getXQueryService();

      final XQueryContext context = xquery.newContext(AccessContext.REST);
      context.setModuleLoadPath(getContext().getModuleLoadPath());

      String contentType = request.getHeader("Content-Type");
      String charset = getContext().getDefaultCharset();
View Full Code Here

    final XQuery xquery = broker.getXQueryService();
    CompiledXQuery feedQuery = xquery.getXQueryPool().borrowCompiledXQuery(broker, config.querySource);

    XQueryContext context;
    if (feedQuery == null) {
      context = xquery.newContext(AccessContext.REST);
      context.setModuleLoadPath(getContext().getModuleLoadPath());
      try {
        feedQuery = xquery.compile(context, config.querySource);
      } catch (final XPathException ex) {
        throw new EXistException("Cannot compile xquery "
View Full Code Here

        DBBroker broker = null;
        try {
            final long start = System.currentTimeMillis();
            broker = brokerPool.get(user);
            final XQuery xquery = broker.getXQueryService();
            final XQueryContext context = xquery.newContext(accessCtx);
            setupContext(null, context);
            final CompiledXQuery expr = xquery.compile(context, query);
//            checkPragmas(context);
            LOG.debug("compilation took "  (System.currentTimeMillis() - start));
            return expr;
View Full Code Here

        final XQuery xquery = broker.getXQueryService();
        final XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
        if(compiled == null)
            {context = xquery.newContext(accessCtx);}
        else
            {context = compiled.getContext();}
        //context.setBackwardsCompatibility(xpathCompatible);
        context.setStaticallyKnownDocuments(docs);
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.