Replace indexdata.dk/gils with z3950.indexdata.com MP-624
[metaproxy-moved-to-github.git] / doc / virt_db.xml
index a9d7e9f..52f578e 100644 (file)
@@ -1,32 +1,81 @@
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" 
-    "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd" [
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.4//EN"
+    "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
  <!ENTITY copyright SYSTEM "copyright.xml">
- <!ENTITY % common SYSTEM "common/common.ent">
-     %common;
+ <!ENTITY % idcommon SYSTEM "common/common.ent">
+     %idcommon;
 ]>
-<!-- $Id: virt_db.xml,v 1.7 2007-05-09 21:23:08 adam Exp $ -->
 <refentry id="ref-virt_db">
+ <refentryinfo>
+  <productname>Metaproxy</productname>
+  <info><orgname>Index Data</orgname></info>
+ </refentryinfo>
+
  <refmeta>
   <refentrytitle>virt_db</refentrytitle>
   <manvolnum>3mp</manvolnum>
-   <refmiscinfo>Metaproxy Module</refmiscinfo>
-</refmeta>
+  <refmiscinfo class="manual">Metaproxy Module</refmiscinfo>
+ </refmeta>
+
  <refnamediv>
   <refname>virt_db</refname>
   <refpurpose>Metaproxy Virtual Databases Module</refpurpose>
  </refnamediv>
+
  <refsect1><title>DESCRIPTION</title>
   <para>
    This filter allows one Z39.50 database to be me mapped to
-   another target; or even multiple targets..
+   another target; or even multiple targets.
+  </para>
+  <para>
+   The configuration of virt_db consists of zero or more
+   <literal>&lt;virtual&gt;</literal> elements each describing the
+   Z39.50 virtual database recognized.
+   The name of the database is the text content of the
+   <literal>&lt;database&gt;</literal> element which should be
+   first element inside the virtual section.
+  </para>
+  <para>
+   For Metaproxy 1.0.20 and later, the database is treated as a glob pattern.
+   This allows operators * (any number of any character) and
+   ? (any single character). The virtual sections are inspected in
+   the order given. The first matching virtual database is used.
+  </para>
+  <para>
+   Following that is one or more <literal>&lt;target&gt;</literal>
+   elements with the identifier of each target that the virtual database
+   maps to. If a database is given for a target (following a slash), that
+   database name is used as Z39.50 database for this target. If the
+   database is omitted for the target, the original (virtual) database
+   is used as Z39.50 database.
+  </para>
+  <para>
+   If multiple targets are given that has special meaning depending on the
+   filter following virt_db. If the following filter is load_balance, then
+   the load_balance filter will load balance between the targets given
+   (assuming they serve same content). If the following filter is multi,
+   then results will be merged from all targets instead.
+  </para>
+  <para>
+   The z3950_filter, on the other hand, does not support multiple targets.
+  </para>
+  <para>
+   For <literal>&lt;virtual&gt;</literal> a route may be given as
+   an attribute. This will make Metaproxy route traffic to the route
+   given. Note that virtual databases may not be combined if all
+   databases do not result in the same routing.
   </para>
  </refsect1>
+
+ <refsect1><title>SCHEMA</title>
+   <literallayout><xi:include
+                    xi:href="../xml/schema/filter_virt_db.rnc" xi:parse="text"
+                    xmlns:xi="http://www.w3.org/2001/XInclude" />
+   </literallayout>
+ </refsect1>
+
  <refsect1><title>EXAMPLES</title>
   <para>
-   A typical configuration looks like this:
+   Consider this virt_db configuration:
    <screen><![CDATA[
     <filter type="virt_db">
       <virtual>
       </virtual>
       <virtual>
         <database>db2</database>
-        <target>indexdata.com/gils</target>
+        <target>z3950.indexdata.com/gils</target>
       </virtual>
       <virtual>
         <database>combined</database>
-        <target>indexdata.com/gils</target>
+        <target>z3950.indexdata.com/gils</target>
         <target>localhost:9999/Default</target>
       </virtual>
+      <virtual route="special">
+        <database>db3</database>
+        <target>z3950.indexdata.com/special</target>
+      </virtual>
+      <virtual>
+        <database>*</database><!-- default -->
+        <target>localhost:9999</target><-- database not altered -->
+      </virtual>
     </filter>
 ]]>
    </screen>
+   This will offer 4 databases, <literal>db1</literal>,
+   <literal>db2</literal>, <literal>combined</literal> and
+   <literal>db3</literal>. If a Z39.50 specifies <literal>db1</literal>
+   and <literal>db2</literal> that will have same effect as specifying
+   the single database <literal>combined</literal>.
+  </para>
+  <para>
+   Since <literal>db3</literal> routes differently from the other databases,
+   this database may not be combined with the others.
   </para>
- </refsect1> 
+ </refsect1>
+
  <refsect1><title>SEE ALSO</title>
   <para>
    <citerefentry>
     <refentrytitle>multi</refentrytitle>
     <manvolnum>3mp</manvolnum>
    </citerefentry>
+   <citerefentry>
+    <refentrytitle>load_balance</refentrytitle>
+    <manvolnum>3mp</manvolnum>
+   </citerefentry>
   </para>
  </refsect1>
+
  &copyright;
 </refentry>
 
 <!-- Keep this comment at the end of the file
 Local variables:
-mode: sgml
-sgml-omittag:t
-sgml-shorttag:t
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:1
-sgml-indent-data:t
-sgml-parent-document:nil
-sgml-local-catalogs: nil
-sgml-namecase-general:t
+mode: nxml
+nxml-child-indent: 1
 End:
 -->