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