Package org.exist.source

Examples of org.exist.source.Source


    if (pattern.equals("/")) {
      content.add(new LocationStep(context, Constants.SELF_AXIS, new AnyNodeTest()));
      return;
    }
   
    Source source = new StringSource(pattern);
        Reader reader;
    try {
      reader = source.getReader();
    } catch (IOException e1) {
      return;//TODO: report error???
    }
   
      long start = System.currentTimeMillis();
View Full Code Here


                root = mkcol(root, baseURI, XmldbURI.ROOT_COLLECTION, path);
            } else
                root = DatabaseManager.getCollection(uri, user, password);

            XQueryService service = (XQueryService) root.getService("XQueryService", "1.0");
            Source source = new StringSource(XQUERY);
            service.declareVariable("collection", root.getName());
            service.declareVariable("uri", "");
            if (moduleURI != null) {
                service.declareVariable("uri", moduleURI);
                service.declareVariable("data", "");
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
View Full Code Here

  public long process(Txn transaction) throws PermissionDeniedException, LockException,
      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
View Full Code Here

  @Test
  public void run() {
    try {
      XQueryService xqs = (XQueryService) testCollection.getService("XQueryService", "1.0");
      Source query = new FileSource(new File(TEST_QUERY), "UTF-8", false);
      for (File file : files) {
        xqs.declareVariable("doc", file.getName());
        ResourceSet result = xqs.execute(query);
        XMLResource resource = (XMLResource) result.getResource(0);
                System.out.println(resource.getContent());
View Full Code Here

        try {
            Process p = Runtime.getRuntime().exec(module.getExiftoolPath()+" -fast -X -");
            stdIn = p.getInputStream();

            OutputStream stdOut = p.getOutputStream();
            Source src = SourceFactory.getSource(context.getBroker(), null, uri.toString(), false);
            InputStream isSrc = src.getInputStream();

            //write the remote data to stdOut
            int read = -1;
            byte buf[] = new byte[4096];
            while((read = isSrc.read(buf))> -1) {
View Full Code Here

    @Override
    public String printDiagnostics(String query, HashMap<String, Object> parameters) throws EXistException, PermissionDeniedException {
        DBBroker broker = null;
        try {
            broker = factory.getBrokerPool().get(user);
            final Source source = new StringSource(query);
            final XQuery xquery = broker.getXQueryService();
            final XQueryPool pool = xquery.getXQueryPool();
            CompiledXQuery compiled = pool.borrowCompiledXQuery(broker, source);
            if(compiled == null)
                {compiled = compile(broker, source, parameters);}
View Full Code Here

     */
    @Override
    public int executeQuery(String xpath, HashMap<String, Object> parameters) throws EXistException, PermissionDeniedException {
        final long startTime = System.currentTimeMillis();
        DBBroker broker = null;
        Source source = null;
        CompiledXQuery compiled = null;
        try {
            source = new StringSource(xpath);
            broker = factory.getBrokerPool().get(user);
            compiled = compile(broker, source, parameters);
View Full Code Here

    public HashMap<String, Object> compile(String query, HashMap<String, Object> parameters) throws EXistException, PermissionDeniedException {
        final HashMap<String, Object> ret = new HashMap<String, Object>();
        DBBroker broker = null;
        XQueryPool pool = null;
        CompiledXQuery compiled = null;
        final Source source = new StringSource(query);
        try {
            broker = factory.getBrokerPool().get(user);
            final XQuery xquery = broker.getXQueryService();
            pool = xquery.getXQueryPool();
            compiled = compile(broker, source, parameters);
View Full Code Here

    public String query(String xpath, int howmany, int start,
            HashMap<String, Object> parameters) throws EXistException, PermissionDeniedException {
        final long startTime = System.currentTimeMillis();
        String result = null;
        DBBroker broker = null;
        Source source = null;
        CompiledXQuery compiled = null;
        try {
            broker = factory.getBrokerPool().get(user);
            source = new StringSource(xpath);
            compiled = compile(broker, source, parameters);
View Full Code Here

TOP

Related Classes of org.exist.source.Source

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.