eXist

Book description

Get a head start with eXist, the open source NoSQL database and application development platform built entirely around XML technologies. With this hands-on guide, you’ll learn eXist from the ground up, from using this feature-rich database to work with millions of documents to building complex web applications that take advantage of eXist’s many extensions. If you’re familiar with XML—as a student, professor, publisher, or developer—you’ll find that eXist is ideal for all kinds of documents.

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Welcome
    2. Who Is This Book For?
    3. Conventions Used in This Book
    4. XQuery Filename Conventions
    5. Using Code Examples
    6. Accompanying Source Code
      1. Getting the Source Code
      2. Building and Deploying
        1. Building everything
        2. Building the EXPath package
        3. Compiling the Java examples
    7. Safari® Books Online
    8. How to Contact Us
    9. Acknowledgments
  2. 1. Introduction
    1. What Is eXist?
    2. eXist Compared to Other Database Systems
    3. History
    4. Competitors
      1. Open Source Competitors
        1. BaseX
        2. Sedna
      2. Closed Source, Commercial Competitors
        1. 28.io
        2. MarkLogic Server
    5. Who Is Using eXist, and for What?
    6. Contributing to the Community
      1. Individuals Using eXist
      2. Organizations Using eXist
      3. Authors Using eXist
      4. Developers Using eXist
    7. Additional Resources
  3. 2. Getting Started
    1. Downloading and Installing eXist
      1. Preconditions
      2. Downloading eXist
      3. Things to Decide Before Installing
      4. Installing eXist
      5. Post-Installation Checks
    2. Starting and Stopping eXist with a GUI
    3. Starting and Stopping eXist from the Command Line
    4. A First Tour Around Town
      1. The Dashboard
      2. Playing Around
      3. What’s in Your Database
      4. What’s on Your Disk
      5. The Java Admin Client
    5. Getting Files into and out of the Database
    6. Hello eXist!
      1. Hello Data
      2. Hello XQuery
      3. Hello XSLT
      4. Hello XInclude
      5. Hello XForms
  4. 3. Using eXist 101
    1. Preparations and Basic Application Setup
      1. eXist Terminology
      2. Exporting Documents from eXist
      3. Designing an Application’s Collection Structure and Importing Data
    2. Viewing the Data
    3. Listing the Plays (XML)
      1. Listing with the collection Function
      2. Listing with the xmldb Extension Module
    4. Listing the Plays (HTML)
    5. Analyzing the Plays
    6. Linking the Analysis to the Play Overview
    7. Searching the Plays
      1. Searching Using Straight XQuery
      2. Searching Using an Index
    8. Creating a Log
    9. What’s Next?
  5. 4. Architecture
    1. Deployment Architectures
      1. Embedded Architecture
      2. Client/Server Database Architecture
      3. Web Application Platform Architecture
    2. Storage Architecture
      1. XML Document Storage and Indexing
      2. Binary Document Storage
    3. Efficient XML Processing Architecture
      1. Collections
      2. Documents
      3. Dynamic Level Numbering of Nodes
      4. Dynamic Level Numbering and Updates
      5. Paging and Caching
  6. 5. Working with the Database
    1. The Database’s Content
      1. Help: Where Is My XML?
      2. Terminology
      3. Properties of Collections and Resources
      4. System Collections
      5. Addressing Collections, Resources, and Files
        1. Use URIs
        2. Relative versus absolute paths
        3. XMLDB URIs
        4. Accessing files
    2. The XPath Collection and Doc Functions in eXist
      1. The collection Function
      2. The doc Function
    3. Querying the Database Using REST
      1. Security
      2. GET Requests
      3. PUT Requests
      4. DELETE Requests
      5. POST Requests
        1. Extended query requests XML format
      6. Ad Hoc Querying
        1. Querying using eXide
        2. Querying using the eXist client tool
    4. Updating Documents
      1. eXist’s XQuery Update Extensions
        1. update delete
        2. update insert
        3. update rename
        4. update replace
        5. update value
      2. XUpdate
        1. XUpdate XML format
        2. Executing XUpdate
    5. Controlling the Database from Code
      1. Specifying Collections and Resources for the xmldb Extension Module
        1. Accessing external databases using extended XMLDB URIs
      2. Getting Information
      3. Creating Resources and Collections
      4. Setting Permissions
      5. Moving, Removing, and Renaming
  7. 6. XQuery for eXist
    1. eXist’s XQuery Implementation
      1. XQuery 1.0 Support
      2. XQuery 3.0 Support
        1. XPath 3.0 functions
        2. try/catch
        3. switch expression
        4. Higher-order functions
        5. The simple map operator
        6. The string concatenation operator
        7. Annotations
        8. Controlling serialization
        9. The group by clause
      3. Other XQuery Extras
        1. The map data type proposed for XQuery 3.1
        2. Java binding
      4. XQuery Execution
    2. Serialization
      1. Controlling Serialization
      2. Serialization Options
        1. General serialization options
        2. Post-processing serialization options
        3. eXist-specific serialization options
        4. JSON serialization
    3. Controlling the XQuery Execution
      1. eXist XQuery Pragmas
      2. Limiting Execution Time and Output Size
      3. Other Options
    4. XQuery Documentation with xqDoc
  8. 7. Extension Modules
    1. Types of Extension Modules
      1. Extension Modules Written in Java
      2. Extension Modules Written in XQuery
    2. Enabling Extension Modules
      1. Enabling Java Extension Modules
        1. Rebuilding eXist
      2. Enabling XQuery Extension Modules
  9. 8. Security
    1. Security Basics
      1. Users
      2. Groups
      3. Permissions
      4. Default Permissions
        1. User masks
    2. Managing Users and Groups
      1. Group Managers
      2. Tools for User and Group Management
        1. Using the Java Admin Client
        2. Using the User Manager web app
        3. Executing XQuery functions
        4. Modifying the security collection
        5. Using the APIs: XML-RPC, XML:DB, and SOAP
    3. User and Group Management with the Java Admin Client
      1. Scenario
      2. User Management in the Java Admin Client
      3. Creating a Group
      4. Creating Users
      5. Setting Group Managers
    4. Managing Permissions
      1. Tools for Permission Management
        1. Using the Java Admin Client
        2. Using the Collections Browser web app
        3. Executing XQuery functions
        4. Using the XML-RPC or XML:DB API
        5. Using the eXist Ant tasks
      2. Permission Management with the Java Admin Client
    5. Access Control Lists
      1. Access Control Entries
      2. ACLs by Example
        1. Allowing additional access
        2. Restricting access
        3. Allowing and restricting access
      3. Managing ACLs
        1. ACL management with the Java Admin Client
    6. Realms
      1. LDAP Realm Module
        1. LDAP configuration options
        2. LDAP configuration for Microsoft Active Directory
      2. Other Realm Modules
    7. Hardening
      1. Reducing Collateral Damage
        1. Linux platforms
        2. Solaris platforms
        3. Windows platforms
      2. Reducing the Attack Surface
        1. Disabling extension modules
        2. Disabling Java Binding from XQuery
        3. Disabling direct access to the REST Server
        4. Disabling network services and APIs
        5. Disabling autodeployment of EXPath packages
        6. Removing preinstalled EXPath packages
        7. Securing eXist’s network services
        8. Reverse proxying
    8. User Authentication in XQuery
      1. xmldb:authenticate
      2. xmldb:login
    9. Backups
  10. 9. Building Applications
    1. Overview
      1. What Technology to Use?
      2. Application Building Aspects
      3. Quickly Getting Started?
    2. Where to Store Your Application?
    3. URL Mapping Using URL Rewriting
      1. Anatomy of a URL Rewriting−Based Application
      2. How eXist Finds the Controller
      3. The URL Rewrite Controller’s Environment
      4. The Controller’s Output XML Format
        1. Ignoring the request
        2. Redirecting the request
        3. Forwarding the request
        4. URL rewrite caching
      5. Advanced URL Control
    4. Changing the URL for URL Rewriting
      1. Changing Jetty Settings: Port Number and URL Prefix
      2. The controller-config.xml Configuration File
      3. Proxying eXist Behind a Web Server
    5. Requests, Sessions, and Responses
      1. The Request Extension Module
        1. Request parameters and attributes
        2. Uploading files
      2. The Session Extension Module
      3. The Response Extension Module
        1. Creating “download XML file” functionality
    6. Application Security
    7. Running with Extra Permissions
    8. Global Error Pages
    9. Building Applications with RESTXQ
      1. Configuring RESTXQ
      2. RESTXQ Annotations
        1. HTTP method constraint annotations
        2. URI path constraint annotation
        3. Consumes constraint annotation
        4. Produces constraint annotation
        5. Parameter annotations
      3. RESTXQ XQuery Extension Functions
    10. Packaging
      1. Examples
      2. The Packaging Format
        1. The expath-pkg.xml file
        2. The repo.xml file
      3. The Prepare and Finish Scripts
      4. Creating Packages
      5. Additional Remarks About Packages
  11. 10. Other XML Technologies
    1. XSLT
      1. Embedding Stylesheets or Not
      2. Invoking XSLT with the Transform Extension Module
      3. Passing XSLT Parameters
      4. Invoking XSLT by Processing Instruction
      5. Stylesheet Details
    2. XInclude
      1. Including Documents
      2. Including Query Results
      3. Error Handling and Fallback
    3. Validation
      1. Implicit Validation
        1. Controlling implicit validation
        2. Specifying catalogs for implicit validation
      2. Explicit Validation
        1. Performing explicit validation
        2. Grammar management in the JAXP (Xerces) parser
    4. Collations
      1. Supported Collations
      2. Specifying Collations
    5. XSL-FO
    6. XForms
      1. XForms Instances
        1. Instances and the REST Server
        2. Instances and XQuery
      2. XForms Submissions
        1. Submission to the REST Server
        2. Submission via XQuery
        3. Submission authentication
      3. betterForm
      4. XSLTForms
  12. 11. Basic Indexing
    1. Indexing Example
    2. Index Types
      1. Structural Index
      2. Range Indexes
      3. NGram Indexes
      4. Full-Text Indexes
    3. Configuring Indexes
      1. Configuring Range Indexes
      2. Configuring NGram Indexes
    4. Maintaining Indexes
    5. Using Indexes
      1. Using the Structural Index
      2. Using the Range Indexes
      3. Using the NGram Indexes
      4. General Optimization Tips
    6. Debugging Indexes
      1. Checking Index Definitions
      2. Checking Index Usage
      3. Tracing the Optimizer
  13. 12. Text Indexing and Lookup
    1. Full-Text Index and KWIC Example
    2. Configuring Full-Text Indexes
      1. Configuring the Search Context
        1. Choosing the correct context
        2. Search context and performance
      2. Handling Mixed Content
        1. Inline content and whitespace
        2. Ignoring inline content
    3. Maintaining the Full-Text Index
    4. Searching with the Full-Text Index
      1. Basic Search Operations
        1. Lucene native query syntax
        2. The full-text query XML specification
        3. Additional search parameters
      2. Scoring Searches
      3. Locating Matches
    5. Using Keywords in Context
    6. Defining and Configuring the Lucene Analyzer
    7. Manual Full-Text Indexing
  14. 13. Integration
    1. Choosing an API
    2. Remote APIs
      1. WebDAV
        1. Using WebDAV from Microsoft Windows
        2. Mapping a drive to eXist WebDAV from Windows Explorer
        3. Using WebDAV from Mac OS X
        4. Mounting eXist WebDAV from Finder
        5. Using WebDAV from Linux
          1. Using WebDAV from GNOME Nautilus
          2. Mounting eXist WebDAV from Nautilus
          3. Using WebDAV with FUSE
          4. Installing davfs2 in Debian-based distributions
          5. Installing davfs2 in distributions with RPM packages
        6. Using WebDAV from Java
          1. Examples
          2. Store example
          3. Retrieve example
      2. REST Server API
        1. Retrieving collections and documents
          1. XSL transformation
        2. Storing a document
        3. Deleting collections and documents
        4. Querying the database
          1. HTTP GET queries
          2. HTTP POST queries
          3. REST Server parameters and paging results
        5. Updating the database
        6. Executing stored queries
          1. Store a JPEG image received over HTTP into the database
          2. Retrieve a stored image from the database
          3. Retrieve a thumbnail representation of an image from the database.
        7. Using the REST Server API from Java
          1. Examples
          2. Store example
          3. Retrieve example
          4. Query example
          5. Remove example
      3. XML-RPC API
        1. Using the XML-RPC Client API from Java
          1. Examples
          2. Classic store example
          3. Proxy store example
        2. Using the XML-RPC Client API from Python
          1. Python XML-RPC proxy store example
      4. XML:DB Remote API
        1. Using the XML:DB Remote API from Java
          1. Examples
          2. Store example
          3. Retrieve example
          4. Query example
          5. Remove example
      5. RESTXQ
        1. Store a JPEG image received over HTTP into the database
        2. Retrieve a stored image from the database
        3. Retrieve a thumbnail representation of an image from the database
      6. XQJ
        1. Examples
          1. Query example
      7. Deprecated Remote APIs
        1. Atom Servlet
        2. SOAP API
        3. SOAP Server
      8. Remote API Libraries for Other Languages
        1. Community APIs for eXist by programming language
    3. Local APIs
      1. XML:DB Local API
        1. Example
          1. XML:DB local example
      2. Fluent API
        1. Example
          1. Fluent API example
  15. 14. Tools
    1. Java Admin Client
    2. eXide
    3. oXygen
      1. Connecting with oXygen Using WebDAV
      2. Natively Connecting with oXygen
    4. Ant and eXist
      1. Trying the Ant Examples
      2. Preparing an eXist Ant Build Script
      3. Using Ant with eXist
        1. Basic example: Listing the main collections
        2. Backup and shutdown
        3. Create separate backups for all subcollections
        4. Run an XQuery from Ant
  16. 15. System Administration
    1. Logging
    2. JMX
    3. Memory and Cache Tuning
      1. Understanding Memory Use
        1. Web Admin Status
        2. XQuery
        3. VisualVM
        4. Java Mission Control
      2. Cache Tuning
    4. Backup and Restore
      1. Client-Side Data Export Backup
        1. Java Admin Client backup
        2. Command-line backup
        3. Ant backup task
      2. Server-Side Data Export Backup
        1. Scheduled backups
        2. Backups from XQuery
        3. Dashboard backups app
      3. Restoring a Clean Database
      4. Emergency Export Tool
    5. Installing eXist as a Service
      1. Solaris
      2. Windows Linux and Other Unix
    6. Hosting and the Cloud
      1. Entic
      2. Amazon EC2
        1. eXist AMI
          1. Installation
          2. Service
          3. Administering
      3. Other Cloud Providers
        1. GreenQloud
        2. Digital Ocean
    7. Getting Support
      1. Community Support
      2. Commercial Support
  17. 16. Advanced Topics
    1. XQuery Testing
    2. Versioning
      1. Historical Archival
      2. Document Revisions
        1. Write conflict avoidance
    3. Scheduled Jobs
      1. Scheduling Jobs
      2. XQuery Jobs
        1. Scheduled weather retrieval (XQuery)
      3. Java Jobs
        1. Java user job
          1. Scheduled weather retrieval (Java)
        2. Java system task job
          1. Database stats scheduled system task
    4. Startup Triggers
    5. Configured Modules Example Startup Trigger
    6. Database Triggers
      1. XQuery Triggers
      2. Java Triggers
        1. Java collection triggers
        2. No delete example collection trigger
        3. Java document triggers
        4. Example Filtering Trigger
    7. Internal XQuery Library Modules
      1. Using the Hello Word Module
      2. Types and Cardinality
      3. Function Parameters and Return Types
      4. Variable Declarations
      5. Module Configuration
    8. Developing eXist
      1. Building eXist from Source
      2. Debugging eXist
        1. Remote debugging with NetBeans IDE
  18. A. XQuery Extension Modules
    1. Extension Modules by Category
      1. Additional data
      2. Core
      3. Datatype Extensions
      4. Database Functionality
      5. Indexing
      6. Protocols/Interfaces
      7. XML Technologies
      8. XQuery
    2. Extension Module Descriptions
      1. cache
      2. compression
      3. contentextraction
      4. counter
      5. datetime
      6. exi
      7. exiftool
      8. file
      9. ft
      10. ftpclient
      11. http
      12. httpclient
      13. image
      14. inspect
      15. jfreechart
      16. jndi
      17. json
      18. jsonp
      19. kwic
      20. mail
      21. map
      22. math
      23. metadata
      24. ngram
      25. repo
      26. request
      27. response
      28. restxq
      29. restxqex
      30. scheduler
      31. sequences
      32. session
      33. sm
      34. sort
      35. sql
      36. system
      37. text
      38. transform
      39. util
      40. validation
      41. versioning
      42. xmlcalabash
      43. xmldb
      44. xmldiff
      45. xmpp
      46. xqjson
      47. xqdm
      48. xslfo
      49. zip
  19. B. REST Server Processes
    1. GET Process Flow
    2. HEAD Process Flow
    3. PUT Process Flow
    4. DELETE Process Flow
    5. POST Process Flow
    6. REST Server Parameters
      1. HTTP GET Parameters
      2. HTTP POST Parameters
      3. Common XML Grammars for Parameters
        1. Wrap XML grammar
        2. Properties XML grammar
        3. Text XML grammar
        4. Variables XML grammar
  20. Index
  21. Colophon
  22. Copyright

Product information

  • Title: eXist
  • Author(s): Erik Siegel, Adam Retter
  • Release date: December 2014
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781449337100