Database Reference
In-Depth Information
following to the triggers section of your collection's configuration document ( col‐
lection.xconf ):
<triggers>
<trigger class= "org.exist.collections.triggers.HistoryTrigger" >
<!--
Collection to store the archival copies in;
if omitted, then the collection /db/history
is used.
-->
<parameter name= "root" value= "/db/system/archival" />
</trigger>
</triggers>
Archival copies will be stored into a mirror of their original collection path within the
archival collection. In addition, a collection is created for each document using its
name, and the archival copy is stored within this collection using a timestamp for its
name that reflects the previous last-modified date of the document.
Document Revisions
The document revision versioning mechanism in eXist is much more comprehensive
than the historical archiving mechanism (described in the previous section).
However, you should note that it is not well suited to large collections of data-centric
XML or binary documents; rather, it is designed with human editors in mind and for
use with modest collections of XML documents. For example, if you are working as
part of a team with published articles or humanities texts, then the versioning mecha‐
nism may be useful for you, but if you are streaming gigabytes of server log data into
eXist it may not scale to your needs.
The versioning mechanism in eXist works well enough for many cases, but while
eXist knows the version history of your documents, there is little support from XML
editor tools that connect to eXist to expose this information to the end user. eXist
does provide some basic tools for you to visually examine the version history of docu‐
ments and also to interrogate this from XQuery, but these tools are rudimentary at
best. If you wish to use the versioning mechanism in a larger enterprise, you might
want to consider building your own tools atop the XQuery functions that eXist
exposes.
The document revision versioning mechanism has two main parts:
• The versioning actions are implemented in a document trigger written in Java
called org.exist.collections.triggers.VersioningTrigger . For more infor‐
mation on database triggers and configuring them, see “Database Triggers” on
page 449 .
Search WWH ::




Custom Search