Package org.xmldb.api.modules

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


                } else if("update".equals(operation)) {
                    try {
                        XUpdateQueryService service =
                                (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                        long count = (this.key == null)?
                                service.update(document) : service.updateResource(this.key, document);
                        message = count + " entries updated.";
                        result = "success";
                    } catch (XMLDBException e) {
                        message = "Failed to update resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
View Full Code Here


                } else if("update".equals(operation)) {
                    try {
                        XUpdateQueryService service =
                                (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
                        long count = (this.key == null)?
                                service.update(document) : service.updateResource(this.key, document);
                        message = count + " entries updated.";
                        result = "success";
                    } catch (XMLDBException e) {
                        message = "Failed to update resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
View Full Code Here

        final XUpdateQueryService service = (XUpdateQueryService) current.getService("XUpdateQueryService", "1.0");
        final long modifications;
        if (resource == null) {
            modifications = service.update(commands);
        } else {
            modifications = service.updateResource(resource, commands);
        }
        messageln(modifications + " modifications processed " + "successfully.");
    }
   
    private void rmcol(final XmldbURI collection) throws XMLDBException {
View Full Code Here

  }

  private void update(Collection col, String xupdate) throws XMLDBException {
    XUpdateQueryService service = (XUpdateQueryService)
    col.getService("XUpdateQueryService", "1.0");
    long mods = service.updateResource(resourceName, xupdate);
    System.out.println("Processed " + mods + " modifications.");
  }
 
  @SuppressWarnings("unused")
  private void displayResource(Collection col) throws XMLDBException {
View Full Code Here

                            throw( new BuildException( msg ) );
                        } else {
                            log( msg, Project.MSG_ERR );
                        }
                    } else {
                        service.updateResource( resource, commands );
                    }

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

        doc.setContent(DOCUMENT_CONTENT);
        testCollection.storeResource(doc);

        //TODO : trigger UPDATE events !
        final XUpdateQueryService update = (XUpdateQueryService) testCollection.getService("XUpdateQueryService", "1.0");
        update.updateResource(DOCUMENT_NAME, DOCUMENT_UPDATE);

        idxConf.configureCollection(EMPTY_COLLECTION_CONFIG);

        final XPathQueryService service = (XPathQueryService) testCollection
            .getService("XPathQueryService", "1.0");
View Full Code Here

                  "           <price>" + (i * 2.5) + "</price>" +
                  "           <stock>" + (i * 10) + "</stock>" +
                  "       </product>" +
                  "   </xu:insert-before>" +
                  "</xu:modifications>";
              service.updateResource("test_xmldb.xml", xupdate);
          }
         
          System.out.println("Adding attributes  ...");
          // add attribute
          for (int i = 1; i <= 200; i++) {
View Full Code Here

                "<xu:modifications version=\"1.0\" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
                "   <xu:append select=\"/products/product[" + i + "]\">" +
                "         <xu:attribute name=\"id\">" + i + "</xu:attribute>" +
                " </xu:append>" +
                "</xu:modifications>";
            service.updateResource("test_xmldb.xml", xupdate);
        }
         
          System.out.println("Replacing elements  ...");
          // replace some
          for (int i = 1; i <= 100; i++) {
View Full Code Here

                "         <description>Replaced product</description>" +
                "         <price>" + (i * 0.75) + "</price>" +
                "     </product>" +
                " </xu:replace>" +
                "</xu:modifications>";
            service.updateResource("test_xmldb.xml", xupdate);
        }
             
          System.out.println("Removing some elements ...");
          // remove some
          for (int i = 1; i <= 100; i++) {
View Full Code Here

          for (int i = 1; i <= 100; i++) {
              xupdate =
                  "<xu:modifications version=\"1.0\" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
                  "   <xu:remove select=\"/products/product[last()]\"/>" +
                  "</xu:modifications>";
              service.updateResource("test_xmldb.xml", xupdate);
          }
         
          System.out.println("Appending some elements ...");
          for (int i = 1; i <= 100; i++) {
              xupdate =
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.