Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 61 additions & 31 deletions src/main/xar-resources/data/configuration/configuration.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<module uri="http://exist-db.org/xquery/file" enabled="no"/>
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<modules>
<module id="ngram-index" class="org.exist.indexing.ngram.NGramIndex" file="ngram.dbx" n="3"/>
<!-- <module id="spatial-index" class="org.exist.indexing.spatial.GMLHSQLIndex" connectionTimeout="10000" flushAfter="300" /> -->
<!-- Bundled indexes (lucene-index, ngram-index, range-index, sort-index) are auto-discovered at startup; no entry needed to activate them. -->
<!-- Optional: spatial index requires GML/HSQL JARs on the classpath. -->
<!-- <module id="spatial-index" class="org.exist.indexing.spatial.GMLHSQLIndex" connectionTimeout="10000" flushAfter="300"/> -->
<!-- To suppress a bundled index without removing this file, add enabled="no": -->
<!-- <module id="ngram-index" class="org.exist.indexing.ngram.NGramIndex" file="ngram.dbx" n="3" enabled="no"/> -->
</modules>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>Developer's Guide to Modularized Indexes</title>
<date>2Q19</date>
<date>3Q26</date>
<keywordset>
<keyword>java-development</keyword>
<keyword>indexes</keyword>
Expand Down Expand Up @@ -359,6 +359,54 @@

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<sect2 xml:id="spi-registration">
<title>Registering an Index via ServiceLoader (SPI)</title>

<para>Since eXist-db 7.0, index modules can be auto-discovered at startup through the
Java <literal>ServiceLoader</literal> mechanism without requiring an explicit
<tag>module</tag> entry in <literal>conf.xml</literal>. This is the recommended
registration mechanism for bundled and reusable third-party indexes.</para>

<para>To register an index via SPI:</para>

<orderedlist>
<listitem>
<para>Implement the <literal>org.exist.indexing.IndexFactory</literal>
interface. It has a single method:</para>
<programlisting>public interface IndexFactory {
AbstractIndex create(BrokerPool pool, Path dataDir, Element config)
throws DatabaseConfigurationException;
String getId();
}</programlisting>
<para><literal>getId()</literal> must return the same stable identifier as
<literal>AbstractIndex.getIndexId()</literal> in the index it creates.
<literal>create()</literal> constructs and configures the index.</para>
</listitem>
<listitem>
<para>Register the factory in the JAR's service descriptor. Create the file
<literal>META-INF/services/org.exist.indexing.IndexFactory</literal>
containing the fully-qualified class name of your factory, one per line:</para>
<programlisting>com.example.myindex.MyIndexFactory</programlisting>
</listitem>
<listitem>
<para>At startup, <literal>IndexManager</literal> scans all JARs on the
classpath for <literal>IndexFactory</literal> providers and calls
<literal>create()</literal> for each one whose
<literal>id</literal> has not been mentioned in <literal>conf.xml</literal>
(either as an active entry or as <code>enabled="no"</code>). The scan
runs once inside the <literal>Configuration</literal> constructor —
there is no per-query overhead.</para>
</listitem>
</orderedlist>

<para>An explicit <tag>module</tag> entry in <literal>conf.xml</literal> for the same
<literal>id</literal> always takes precedence over SPI discovery. To suppress a
SPI-registered index without removing its JAR, add a
<tag>module</tag> entry with <code>enabled="no"</code>.</para>
</sect2>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<sect2 xml:id="index-worker">
<title> org.exist.indexing.IndexWorker </title>

Expand Down
23 changes: 14 additions & 9 deletions src/main/xar-resources/data/extensions/extensions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>Extension Modules</title>
<date>2Q21</date>
<date>3Q26</date>
<keywordset>
<keyword>java-development</keyword>
</keywordset>
Expand Down Expand Up @@ -36,15 +36,20 @@
may then be added to <literal>$EXIST_HOME/extensions/indexes/pom.xml</literal>. They
will be compiled automatically by the standard build targets or as indicated
above.</para>
<para>eXist-db must also be told which modules to load at startup, this is done in
<literal>conf.xml</literal> and the Class name and Namespace for each module is
listed below. </para>
<para>Since eXist-db 7.0, bundled extension modules are auto-discovered at startup via
the Java <literal>ServiceLoader</literal> mechanism — no <literal>conf.xml</literal>
entry is needed to activate them. Third-party modules (not bundled with eXist-db)
still require an explicit <tag>module</tag> entry in the
<tag>builtin-modules</tag> section of <literal>conf.xml</literal>. An explicit entry
always takes precedence over SPI auto-discovery for the same namespace URI; set
<code>enabled="no"</code> on an entry to suppress a bundled module. The class name
and namespace for each module are listed below.</para>
<note>
<para>eXist-db will require a restart to load any new modules added. </para>
</note>
<para>Once a Module is configured and loaded eXist-db will display the module and its
<para>Once a module is configured and loaded, eXist-db will display the module and its
function definitions as part of the <link xlink:href="{${fundocs.pkg.abbrev}}">function
library</link> page or through <literal>util:decribe-function()</literal>.</para>
library</link> page or through <literal>util:describe-function()</literal>.</para>
</sect1>

<!-- ================================================================== -->
Expand Down Expand Up @@ -80,12 +85,12 @@
</listitem>
</itemizedlist>
<para>
The Cache module can be configured for with a bounded size, or time, or both. eXist-db cannot
The Cache module can be configured with a bounded size, or time, or both. eXist-db cannot
know how much memory the data you will put in the cache will take, so it is up to you to
manage your own memory needs here.
</para>
<para>A named cache can either be explicitly created by calling the <code>cache:create</code> XQuery
function, or it can be implicitly created lazing on the first operation performed on the cache.
function, or it can be implicitly created lazily on the first operation performed on the cache.
Configuration of the Cache module is specified within the module definition of eXist-db's
<code>conf.xml</code> file:</para>
<programlisting language="xml" xlink:href="listings/listing-2.xml"/>
Expand Down Expand Up @@ -116,7 +121,7 @@
</listitem>
</itemizedlist>
<para>
The SQL Module can be configured with additional which allow Connection Pooling of the SQL connections to be utilised.
The SQL Module can be configured with additional options that enable connection pooling for SQL connections.
For this purpose the <link xlink:href="https://github.com/brettwooldridge/HikariCP">HikariCP</link> connection pool implementation is used.
</para>
<para>Multiple connection pools can be configured and used from XQuery via the <code>sql:get-connection-from-pool</code> function.</para>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<article version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>Known Issues when upgrading</title>
<date>1Q20</date>
<date>3Q26</date>
<keywordset>
<keyword>operations</keyword>
</keywordset>
Expand All @@ -12,6 +12,36 @@
<!-- ================================================================== -->

<para>This article lists known incompatibilities when upgrading from an older version of eXist-db.</para>
<!-- ================================================================== -->
<sect1 xml:id="v7.0.0">
<title>Upgrading to 7.0.0</title>

<itemizedlist>
<listitem>
<para><emphasis role="bold">conf.xml template trimmed — SPI auto-discovery for bundled
modules and indexes.</emphasis> Built-in XQuery modules and index modules are now
auto-discovered at startup via the Java <literal>ServiceLoader</literal> mechanism.
The default <literal>conf.xml</literal> template no longer lists them explicitly.
Installations upgrading with a hand-maintained <literal>conf.xml</literal> are
unaffected — explicit <tag>module</tag> entries are still honoured and take
precedence over SPI discovery for the same namespace URI or index
<literal>id</literal>. To suppress a bundled module or index without removing its
JAR, add <code>enabled="no"</code> to its entry.</para>
</listitem>
<listitem>
<para><emphasis role="bold">New <code>enabled</code> attribute on
<code>conf.xml</code> elements.</emphasis> The <tag>trigger</tag>,
<tag>job</tag>, <tag>module</tag>, <tag>feature</tag>, <tag>parameter</tag>, and
<tag>property</tag> elements in <literal>conf.xml</literal> now accept an
<code>enabled="yes|no"</code> attribute (default <code>yes</code>). Setting
<code>enabled="no"</code> disables the entry at startup without removing it from
the file. Existing configuration files without the attribute continue to work
unchanged.</para>
</listitem>
</itemizedlist>

</sect1>

<!-- ================================================================== -->
<sect1 xml:id="v5.0.0">
<title>Upgrading to 5.0.0</title>
Expand Down
17 changes: 12 additions & 5 deletions src/main/xar-resources/data/indexing/indexing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
schematypens="http://purl.oclc.org/dsdl/schematron"?><article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info>
<title>Configuring Database Indexes</title>
<date>2Q21</date>
<date>3Q26</date>
<keywordset>
<keyword>application-development</keyword>
</keywordset>
Expand Down Expand Up @@ -284,13 +284,20 @@

<sect1 xml:id="moduleconf">
<title>Enabling Index Modules</title>
<para> To activate an index plug-in, it needs to be added to the <tag>modules</tag> section
within the global configuration file <literal>conf.xml</literal>:</para>
<para>Since eXist-db 7.0, bundled index modules (Lucene, ngram, range, sort) are
auto-discovered at startup via the Java <literal>ServiceLoader</literal> mechanism. No
<tag>module</tag> entry in <literal>conf.xml</literal> is required to activate them.
Third-party index modules (not bundled with eXist-db) still require an explicit
<tag>module</tag> entry in the <tag>modules</tag> section of
<literal>conf.xml</literal>:</para>

<programlisting language="xml" xlink:href="listings/listing-8.xml"/>

<para>Every <tag>module</tag> element needs at least an <literal>id</literal> and
<literal>class</literal> attribute. The class attribute contains the name of the plug-in
<para>An explicit <tag>module</tag> entry always takes precedence over SPI
auto-discovery for the same <code>id</code>. To suppress a bundled index without
removing its JAR from the classpath, add <code>enabled="no"</code> to the entry.</para>
<para>Every <tag>module</tag> element needs at least an <code>id</code> and
<code>class</code> attribute. The class attribute contains the name of the plug-in
class, which has to be an implementation of
<literal>org.exist.indexing.Index</literal>.</para>
<para>All other attributes or nested configuration elements below the <tag>module</tag>
Expand Down
4 changes: 4 additions & 0 deletions src/main/xar-resources/data/scheduler/listings/listing-4.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<job type="system" enabled="no" name="check1" class="org.exist.storage.ConsistencyCheckTask" cron-trigger="0 0 * * * ?">
<parameter name="output" value="export"/>
<parameter name="backup" value="yes"/>
</job>
19 changes: 12 additions & 7 deletions src/main/xar-resources/data/scheduler/scheduler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>Scheduler Module</title>
<date>2Q19</date>
<date>3Q26</date>
<keywordset>
<keyword>operations</keyword>
<keyword>application-development</keyword>
Expand All @@ -28,11 +28,16 @@
<para>Jobs may be statically scheduled by configuring them in the
<tag>scheduler</tag> element of eXist-db's <code>conf.xml</code>
configuration file. When eXist-db starts-up this configuration is read and
the jobs will be scheduled with the scheduler. The configuration file
contains (commented out) example jobs. An example of a scheduler
the jobs will be scheduled with the scheduler. An example of a scheduler
entry:</para>

<programlisting language="xml" xlink:href="listings/listing-3.xml"/>

<para>Add <code>enabled="no"</code> to a <tag>job</tag> element to keep the
entry in <code>conf.xml</code> without activating it at startup. This is
useful for preparing a job configuration in advance or disabling a job
temporarily without losing its parameters:</para>
<programlisting language="xml" xlink:href="listings/listing-4.xml"/>
</listitem>
</varlistentry>
<varlistentry>
Expand Down Expand Up @@ -119,8 +124,8 @@
<para>An XQuery job is a standard XQuery Main Module which is stored in the
database. You configure the scheduling of the job by providing the database
path to the XQuery, for example: <code>/db/my-collection/my-job.xq</code>. </para>
<para>XQuery job's are launched under the <emphasis>guest</emphasis> account. If
you wish to perform tasks as another user , either switch permissions by
<para>XQuery jobs are launched under the <emphasis>guest</emphasis> account. If
you wish to perform tasks as another user, either switch permissions by
calling <code>xmldb:login()</code> from within your job, or set the
<code>SetUid</code>/<code>SetGid</code> bits on the XQuery file's
permissions (see <link xlink:href="security">Security</link> for more
Expand All @@ -145,13 +150,13 @@

<sect1 xml:id="schedule">
<title>Job Schedule</title>
<para>Job's may be scheduled using one of two mechanisms, a simple mechanism for periodic
<para>Jobs may be scheduled using one of two mechanisms: a simple mechanism for periodic
execution, or a more complex mechanism which uses the Cron syntax to offer greater
flexibility.</para>
<sect2 xml:id="period">
<title>Periodic Scheduling</title>

<para>For period scheduling enables you can specify for the job to run every
<para>Periodic scheduling lets you specify that the job runs every
<code>n</code> milliseconds. There are additional options to specify a delay before
the first execution of the job, and to only repeat the execution of the job schedule
a fixed number of times.</para>
Expand Down
12 changes: 8 additions & 4 deletions src/main/xar-resources/data/xquery/xquery.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
xmlns:xlink="http://www.w3.org/1999/xlink">
<info>
<title>XQuery in eXist-db</title>
<date>1Q26</date>
<date>3Q26</date>
<keywordset>
<keyword>xquery</keyword>
</keywordset>
Expand Down Expand Up @@ -270,9 +270,13 @@
<title>Preloaded Modules</title>

<para>Preloaded modules do not need to be explicitly imported or declared in the prolog
of queries. The <tag>builtin-modules</tag> element in <literal>conf.xml</literal>
lists the namespaces and the corresponding Java class that implements all modules to
be preloaded:</para>
of queries. Since eXist-db 7.0, bundled modules are auto-discovered at startup via
the Java <literal>ServiceLoader</literal> mechanism — no <tag>builtin-modules</tag>
entry in <literal>conf.xml</literal> is required to activate them.</para>
<para>An explicit <tag>module</tag> entry in <tag>builtin-modules</tag> always takes
precedence over SPI auto-discovery for the same namespace URI. Third-party modules
still require an explicit entry. To suppress a bundled module without removing its
JAR, set <code>enabled="no"</code> on its <tag>module</tag> entry:</para>
<programlisting language="xml" xlink:href="listings/listing-17.xml" />
</sect2>

Expand Down