Package org.exist.xquery

Examples of org.exist.xquery.CompiledXQuery


                return false;
            }

            XQueryContext context = xquery.newContext(AccessContext.REST);

            CompiledXQuery compiled = xquery.compile(context, source);

            Properties outputProperties = new Properties();

            Sequence result = xquery.execute(compiled, null, outputProperties);
            LOG.info("XQuery execution results: " + result.toString());
View Full Code Here


            XQuery xquery = broker.getXQueryService();
            assertNotNull(xquery);

            XQueryContext context = new XQueryContext(broker.getBrokerPool(), AccessContext.TEST);
            CompiledXQuery compiled = xquery.compile(context, "declare variable $q external; " +
                    "ft:query(//p, util:parse($q)/query)");

            context.declareVariable("q", "<query><term>heiterkeit</term></query>");
            Sequence seq = xquery.execute(compiled, null);
            assertNotNull(seq);
View Full Code Here

                log.error("Unable to load RESTXQ registry file: " + fRegistry.getAbsolutePath() + ". Expected version: " + REGISTRY_FILE_VERSION + " but saw version: " + versionStr);
            } else {
                while((line = reader.readLine()) != null) {
                    final String xqueryLocation = line.substring(0, line.indexOf(FIELD_SEP));

                    final CompiledXQuery xquery = XQueryCompiler.compile(broker, new URI(xqueryLocation));
                    final List<RestXqService> services = XQueryInspector.findServices(xquery);

                    getRegistry().register(services);
                }
            }
View Full Code Here

  protected NodeList select(DocumentSet docs)
    throws PermissionDeniedException, EXistException, XPathException {
    final XQuery xquery = broker.getXQueryService();
    final XQueryPool pool = xquery.getXQueryPool();
    final Source source = new StringSource(selectStmt);
    CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
    XQueryContext context;
    if(compiled == null)
        {context = xquery.newContext(getAccessContext());}
    else
        {context = compiled.getContext();}

    context.setStaticallyKnownDocuments(docs);
    declareNamespaces(context);
    declareVariables(context);
    if(compiled == null)
View Full Code Here

      EXistException, XPathException, TriggerException {
    LOG.debug("Processing xupdate:if ...");
    final XQuery xquery = broker.getXQueryService();
    final XQueryPool pool = xquery.getXQueryPool();
    final Source source = new StringSource(selectStmt);
    CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
    XQueryContext context;
    if(compiled == null)
        {context = xquery.newContext(getAccessContext());}
    else
        {context = compiled.getContext();}

    //context.setBackwardsCompatibility(true);
    context.setStaticallyKnownDocuments(docs);
    declareNamespaces(context);
    declareVariables(context);
View Full Code Here

        XmldbURI collectionPath = docPath.removeLastSegment();
        XmldbURI path = VersioningTrigger.VERSIONS_COLLECTION.append(collectionPath);
        XQuery xquery = broker.getXQueryService();
        XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, GET_CURRENT_REV_SOURCE);
        if(compiled == null)
                context = xquery.newContext(AccessContext.VALIDATION_INTERNAL);
            else
                context = compiled.getContext();
        context.declareVariable("collection", path.toString());
        context.declareVariable("document", docName);
        if(compiled == null)
            compiled = xquery.compile(context, GET_CURRENT_REV_SOURCE);
        try {
View Full Code Here

        XmldbURI collectionPath = docPath.removeLastSegment();
        XmldbURI path = VersioningTrigger.VERSIONS_COLLECTION.append(collectionPath);
        XQuery xquery = broker.getXQueryService();
        XQueryPool pool = xquery.getXQueryPool();
        XQueryContext context;
        CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, GET_CONFLICTING_REV_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));
        context.declareVariable("key", key);
        if(compiled == null)
View Full Code Here

        XmldbURI collectionPath = docPath.removeLastSegment();
        XmldbURI path = VersioningTrigger.VERSIONS_COLLECTION.append(collectionPath);
        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));
        context.declareVariable("key", sessionKey);
View Full Code Here

    callAndTestBorrowCompiledXQuery(localStringSource);
    callAndTestBorrowCompiledXQuery(localStringSource);
  }
 
  private void callAndTestBorrowCompiledXQuery(StringSource stringSourceArg) {
    CompiledXQuery compiledXQuery = null;
    try {
      compiledXQuery = pool.borrowCompiledXQuery(broker, stringSourceArg);
      System.out.println("compiledXQuery: " + compiledXQuery);
    } catch (PermissionDeniedException e) {
      e.printStackTrace();
View Full Code Here

        broker = pool.get(pool.getSecurityManager().getGuestSubject());
       
        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 {
View Full Code Here

TOP

Related Classes of org.exist.xquery.CompiledXQuery

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.