Examples of XUpdateQueryService


Examples of org.xmldb.api.modules.XUpdateQueryService

                        message = "Failed to delete resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
                    }
                } 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

Examples of org.xmldb.api.modules.XUpdateQueryService

                                getLogger().debug(message, e);
                            }
                        }
                    } 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

Examples of org.xmldb.api.modules.XUpdateQueryService

                                getLogger().debug(message, e);
                            }
                        }
                    } 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

Examples of org.xmldb.api.modules.XUpdateQueryService

                "<last>Smith</last>" +
                "<phone type=\"work\">480-300-3003</phone>" +
                "</person>";

        Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
        XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");

        long count = service.updateResource("doc1", query);
        assertEquals(1, count);

        String doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc1");
        assertNotNull(doc);
        assertEquals(updatedDocument, doc);
View Full Code Here

Examples of org.xmldb.api.modules.XUpdateQueryService

                "<last>Benton</last>" +
                "<phone type=\"work\">480-300-3003</phone>" +
                "</person>";

        Collection col = this.client.getCollection(TEST_COLLECTION_PATH);
        XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");

        long count = service.update(query);
        assertEquals(6, count);

        String doc = this.client.getDocument(TEST_COLLECTION_PATH, "doc1");
        assertNotNull(doc);
        assertEquals(updatedDocument1, doc);
View Full Code Here

Examples of org.xmldb.api.modules.XUpdateQueryService

                        message = "Failed to delete resource " + key + ": " + e.errorCode;
                        getLogger().debug(message, e);
                    }
                } 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

Examples of org.xmldb.api.modules.XUpdateQueryService

                System.out.println("ERROR : Collection not found!");
                return false;
            }

            // To run XUpdate commands we use the XUpdateQueryService
            XUpdateQueryService service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");
           
            long result;
            // 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());
            }
               
            System.out.println(result + " documents updated");
        } finally {
            if (col != null) {
View Full Code Here

Examples of org.xmldb.api.modules.XUpdateQueryService

                    + "   <xu:update select=\"/person/phone[@type = 'work']\">"
                    + "       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

Examples of org.xmldb.api.modules.XUpdateQueryService

                System.out.println("ERROR : Collection not found!");
                return false;
            }

            // To run XUpdate commands we use the XUpdateQueryService
            XUpdateQueryService service = null;           
            service = (XUpdateQueryService) col.getService("XUpdateQueryService", "1.0");

           
            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());
            }
               

            System.out.println(result + " documents updated");
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.