Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.XUpdateQueryService.update()


    updateText = result.getResource(0).getContent().toString();
    result = query.query("/article/section/para[. = '" + updateText + "']");
    Assert.assertEquals(1, result.getSize());
    System.out.println(result.getResource(0).getContent().toString());
   
    mods = service.update(REMOVE);
    Assert.assertEquals(1, mods);
    return false;
  }

}
View Full Code Here


    XUpdateQueryService service = (XUpdateQueryService)
      col.getService("XUpdateQueryService", "1.0");
    int attrSize = rand.nextInt(5);
    for (int i = 0; i < 10; i++) {
      String xupdate = XUPDATE_START + xmlGenerator.generateText(attrSize) + XUPDATE_END;
      long mods = service.update(xupdate);
      System.out.println(Thread.currentThread().getName() + ": " + mods + " attributes updated ...");
    }
    return false;
  }
}
View Full Code Here

                        service.updateResource( resource, commands );
                    }

                } else {
                    log( "Updating collection: " + base.getName(), Project.MSG_INFO );
                    service.update( commands );
                }
            }

        }
        catch( final XMLDBException e ) {
View Full Code Here

            String xupdate =
                LuceneIndexTest.XUPDATE_START +
                "   <xu:remove select=\"//SPEECH[ft:query(SPEAKER, 'juliet')]\"/>" +
                LuceneIndexTest.XUPDATE_END;
            XUpdateQueryService xuqs = (XUpdateQueryService) test.getService("XUpdateQueryService", "1.0");
            xuqs.update(xupdate);

            result = xqs.query("//SPEECH[ft:query(SPEAKER, 'juliet')]");
            assertEquals(0, result.getSize());
            result = xqs.query("//SPEECH[ft:query(LINE, 'king')]");
            assertEquals(98, result.getSize());
View Full Code Here

        for (int i = 100; i > 10; i--) {
            String xu =
                "<xu:modifications xmlns:xu=\"http://www.xmldb.org/xupdate\" version=\"1.0\">" +
                "   <xu:remove select=\"/test/item[@id='" + i + "']\"/>" +
                "</xu:modifications>";
            long mods = service.update(xu);
            assertEquals(mods, 1);
           
            ResourceSet result = query.query("/test/item/e0");
            System.out.println(result.getResource(0).getContent());
        }
View Full Code Here

    br.close();
    String xUpdateModifications = new String(characters);
    System.out.println("modifications: " + xUpdateModifications);
    //

    service.update(xUpdateModifications);

    //col.setProperty("pretty", "true");
    //col.setProperty("encoding", "UTF-8");
    XMLResource ret = (XMLResource) col.getResource(XUPDATE_FILE);
    String xmlString = ((String) ret.getContent());
View Full Code Here

        if (collection == null)
            throw new EXistException("collection " + collectionPath + " not found");
        XUpdateQueryService service = (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");

        if (resource == null) {
            modifications = (int) service.update(xupdate);
        } else {
            modifications = (int) service.updateResource(resource, xupdate);
        }
    }
View Full Code Here

  }

  private static void doXUpdate(Collection collection, String xupdate) throws XMLDBException {
    XUpdateQueryService service = (XUpdateQueryService)
      collection.getService("XUpdateQueryService", "1.0");
    long mods = service.update(xupdate);
    System.out.println(mods + " modifications processed.");
  }
 
  private static void loadFile(Collection collection, String path) throws XMLDBException {
    // create new XMLResource; an id will be assigned to the new resource
View Full Code Here

    long modifications = 0;
    try {
      final XUpdateQueryService service = (XUpdateQueryService)c.getService("XUpdateQueryService", "1.0");
      logger.debug("Processing XUpdate request: " + xupdate);
      modifications = service.update(xupdate);
    } catch(final XMLDBException e) {
      throw new XPathException(this, "Exception while processing xupdate: " + e.getMessage(), e);
    }
   
    context.getRootExpression().resetState(false);
View Full Code Here

      "  </xu:append>\n" +
      "</xu:modifications>";
        log("XUpdate:\n" + xupdate);
    XUpdateQueryService service = (XUpdateQueryService)
    collection.getService("XUpdateQueryService", "1.0");
    service.update(xupdate);
  }
 
  /**
   * Parse a message. Tries to detect URLs in the message and transforms them
   * into an HTML link.
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.