Examples of newContext()


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

        XQuery xquery = broker.getXQueryService();
        XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, GET_BASE_REV_FOR_KEY_SOURCE);
        if(compiled == null)
            context = xquery.newContext(AccessContext.VALIDATION_INTERNAL);
        else
            context = compiled.getContext();
        context.declareVariable("collection", path.toString());
        context.declareVariable("document", docName);
        context.declareVariable("base", new IntegerValue(baseRev));
View Full Code Here

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

        if (checkQueryEngine) {
          final XQuery xquery = broker.getXQueryService();
          final XQueryPool xqPool = xquery.getXQueryPool();
          CompiledXQuery compiled = xqPool.borrowCompiledXQuery(broker, TEST_XQUERY);
          if (compiled == null) {
            final XQueryContext context = xquery.newContext(AccessContext.TEST);
            compiled = xquery.compile(context, TEST_XQUERY);
          }
        try {
          xquery.execute(compiled, null);
        } finally {
View Full Code Here

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

        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, xqSource);
       
        //Create the context and set a header to indicate cache status
        if(compiled == null)
        {
          context = xquery.newContext(AccessContext.REST);
          //response.setHeader("X-XQuery-Cached", "false");
      }
        else
      {
          context = compiled.getContext();
View Full Code Here

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

        final XQuery xqueryService = evalContext.getBroker().getXQueryService();
        final XQueryContext innerContext;
        if (contextInit != null) {
            // eval-with-context: initialize a new context
            innerContext = xqueryService.newContext(evalContext.getAccessContext());
            initContextSequence = initContext(contextInit.getNode(), innerContext);
        } else {
            // use the existing outer context
            // TODO: check if copying the static context would be sufficient???
            innerContext = evalContext.copyContext();
View Full Code Here

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

            final XQueryPool pool = xquery.getXQueryPool();
            CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);

            XQueryContext context;
            if (compiled == null) {
                context = xquery.newContext(AccessContext.REST);
            } else {
                context = compiled.getContext();
            }

            context.setStaticallyKnownDocuments(new XmldbURI[]{pathUri});
View Full Code Here

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

        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
        if (compiled == null) {
            // special header to indicate that the query is not returned from
            // cache
            response.setHeader("X-XQuery-Cached", "false");
            context = xquery.newContext(AccessContext.REST);

        } else {
            response.setHeader("X-XQuery-Cached", "true");
            context = compiled.getContext();
        }
View Full Code Here

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

        final XQuery xquery = broker.getXQueryService();
        final XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
        if (compiled == null) {
            context = xquery.newContext(AccessContext.REST);
        } else {
            context = compiled.getContext();
        }

        context.declareVariable("pipeline", resource.getURI().toString());
View Full Code Here

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

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

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

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

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

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