Package org.xmldb.api.modules

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


                    } 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


           
            long result = 0;

            // See if we're updating one document or the whole collection.
            if (name == null) {
                result = service.update(commands.toString());
            }
            else {
                result = service.updateResource(name, commands.toString());
            }
               
View Full Code Here

                    + "       480-300-3003"
                    + "   </xu:update>"
                    + "</xu:modifications>";

            XUpdateQueryService service = (XUpdateQueryService) collection.getService("XUpdateQueryService", "1.0");
            long count = service.update(xupdate);
            System.out.println(count + " entries updated.");
        } catch (XMLDBException e) {
            System.err.println("XML:DB Exception occured " + e.errorCode + " " + e.getMessage());
        } finally {
            if (collection != null) {
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

                } 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 String xupdate = "<xu:modifications version=\"1.0\" "
                        + "xmlns:xu=\"http://www.xmldb.org/xupdate\">"
                        + command + "</xu:modifications>";
                final XUpdateQueryService service = (XUpdateQueryService) current
                        .getService("XUpdateQueryService", "1.0");
                final long mods = service.update(xupdate);
                System.out.println(mods + " modifications processed.");
               
            } else if (args[0].equalsIgnoreCase("map")) {
                final StringTokenizer tok = new StringTokenizer(args[1], "= ");
                final String prefix;
View Full Code Here

        }
        final String commands = XMLUtil.readFile(file, "UTF-8");
        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.");
    }
View Full Code Here

    Collection col = DatabaseManager.getCollection(collectionPath, "admin", null);
    XUpdateQueryService service = (XUpdateQueryService)
      col.getService("XUpdateQueryService", "1.0");
   
    // append a new section
    long mods = service.update(APPEND);
    Assert.assertEquals(1, mods);
   
    // update paragraph content
    String updateText = Integer.toString(rand.nextInt()) + " &amp; " + Integer.toString(rand.nextInt());
    String update = UPDATE_START + updateText + UPDATE_END;
View Full Code Here

    Assert.assertEquals(1, mods);
   
    // update paragraph content
    String updateText = Integer.toString(rand.nextInt()) + " &amp; " + Integer.toString(rand.nextInt());
    String update = UPDATE_START + updateText + UPDATE_END;
    mods = service.update(update);
   
    Assert.assertEquals(1, mods);
    System.out.println(mods + " nodes updated.");
   
    // query for section
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.