Examples of updateResource()


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

        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

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

  }

  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

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

                            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

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

        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

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

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

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

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

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

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

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

          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

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

                  "           <price>" + (i * 2.5) + "</price>" +
                  "           <stock>" + (i * 10) + "</stock>" +
                  "       </product>" +
                  "   </xu:append>" +
                  "</xu:modifications>";
              service.updateResource("test_xmldb.xml", xupdate);
          }
         
          System.out.println("Renaming elements  ...");
          // rename element "description" to "descript"
          xupdate =
View Full Code Here

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

          // rename element "description" to "descript"
          xupdate =
              "<xu:modifications version=\"1.0\" xmlns:xu=\"http://www.xmldb.org/xupdate\">" +
              "   <xu:rename select=\"/products/product/description\">descript</xu:rename>" +
              "</xu:modifications>";
          service.updateResource("test_xmldb.xml", xupdate);
         
          System.out.println("Updating attribute values ...");
          // update attribute values
          for (int i = 1; i <= 200; 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.