Minor spell fixes
[yazproxy-moved-to-github.git] / doc / reference.xml
index 15274ea..644fe58 100644 (file)
     see <xref linkend="proxy-usage"/>.
    </para>
    <para>
-    As an option the proxy may change user identity to a less priviledged
+    As an option the proxy may change user identity to a less privileged
     user.
    </para>
   </section>
   <section id="proxy-target">
-   <title>Specifying the Backend Server</title>
+   <title>Choosing the Backend Server</title>
    <para>
     When the proxy receives a Z39.50 Initialize Request from a Z39.50
     client, it determines the backend server by the following rules:
      </listitem>
     </orderedlist>
    </para>
+   <para>
+    If the proxy receives an SRW/SRU request, the following rules are used.
+    <orderedlist>
+     <listitem>
+      <para>If default target has Explain information with a
+       <literal>database</literal> that matches the path of the
+       HTTP request of SRW/SRU that backend server is used for
+       SRW/SRU operation.
+       </para>
+     </listitem>
+     <listitem>
+      <para>
+       Otherwise the service will return HTTP 404 (Not found).
+      </para>
+     </listitem>
+    </orderedlist>
+   </para>
+   <note>
+    <para>
+     We know it is stupid to only check for explain in default target.
+     It means that it is only possible to offer one SRW/SRU server.
+     We expect to improve that in the next version of the YAZ proxy.
+    </para>
+   </note>
   </section>
   <section id="proxy-keepalive">
    <title>Keep-alive Facility</title>
     <ulink url="http://xmlsoft.org/XSLT/">libXSLT</ulink> support in
     order for the config file facility to be enabled.
    </para>
+   <para>
+    See <xref linkend="yazproxy-schema"/> for an XML schema
+    for the configuration.
+   </para>
    <tip>
     <para>To check for a config file to be well-formed, the yazproxy may
      be invoked without specifying a listening port, i.e.
     <title>Proxy Configuration Header</title>
     <para>
      The proxy config file must have a root element called
-     <literal>proxy</literal>. All information except an optional XML
-     header must be stored within the <literal>proxy</literal> element.
+     <literal>proxy</literal> and scoped within namespace
+     <literal> xmlns="http://indexdata.dk/yazproxy/schema/0.8/</literal>.
+     All information except an optional XML header must be stored
+     within the <literal>proxy</literal> element.
     </para>
     <screen>
      &lt;?xml version="1.0"?>
-      &lt;proxy>
-       &lt;!-- content here .. -->
-      &lt;/proxy>
+     &lt;proxy xmlns="http://indexdata.dk/yazproxy/schema/0.8/">
+      &lt;!-- content here .. -->
+     &lt;/proxy>
     </screen>
    </section>
    <section id="proxy-config-target">
     <para>
      <screen>
      &lt;?xml version="1.0"?>
-     &lt;proxy>
+     &lt;proxy xmlns="http://indexdata.dk/yazproxy/schema/0.8/">
       &lt;target name="server1" default="1">
        &lt;!-- description of server1 .. -->
       &lt;/target>
     </para>
     <para>
      The following sets maximum number of bytes transferred in a
-     target session to 1 MB and maxinum of requests to 400.
+     target session to 1 MB and maximum of requests to 400.
      <screen>
       &lt;keepalive>
        &lt;bandwidth>1048576&lt;/bandwidth>
      </screen>
     </para>
    </section>
-
-   <!-- TODO -->
-   <!--
-
-    <syntax type="xml" marcxml="1" stylesheet="MARC21slim2MODS.xsl"
-      identifier="http://www.loc.gov/mods"
-      >
-      <title>MODS v2</title>
-      <name>mods2</name>
-    </syntax>
-
-
--->
    <section id="proxy-config-syntax">
     <title>syntax</title>
     <para>
      <literal>type</literal> should be XML. The proxy will use
      preferred record syntax USMARC/MARC21 against the backend target.
     </para>
-    <para>To accept USMARC and offer MARCXML XML records but reject
-     all other requests the following configuration could be used:
-     <screen>
-      &lt;proxy>
+    <para>
+     If attribute <literal>stylesheet</literal> is given, the proxy
+     will convert XML record from server via XSLT. It is important
+     that the content from server is XML. If used in conjunction with
+     attribute <literal>marcxml</literal> the MARC to MARCXML conversion
+     takes place before the XSLT conversion takes place.
+    </para>
+    <para>
+     If attribute <literal>identifier</literal> is given that is the
+     SRW/SRU record schema identifier for the resulting output record (after
+     MARCXML and/or XSLT conversion). 
+    </para>
+    <para>
+     If sub element <literal>title</literal> is given (as child element
+     of <literal>syntax</literal>, then that is the official SRW/SRU
+     name of the resulting record schema.
+    </para>
+    <para>
+     If sub element <literal>name</literal> is given that is an alias
+     for the record schema identifier. Multiple <literal>name</literal>s
+     may be specified.
+    </para>
+    <example>
+     <title>MARCXML conversion</title>
+     <para>To accept USMARC and offer MARCXML XML plus Dublin Core (via
+      XSLT conversion) but the following configuration could be used:
+      <screen>
+       &lt;proxy>
        &lt;target name="mytarget">
+       ..
        &lt;syntax type="usmarc"/>
-        &lt;syntax type="xml" marcxml="1"/>
-        &lt;syntax type="*" error="238"/>
+       &lt;syntax type="xml" marcxml="1"
+        identifier="info:srw/schema/1/marcxml-v1.1"
+        &lt;title>MARCXML&lt;title>
+        &lt;name>marcxml&lt;name>
+       &lt;syntax>
+       &lt;syntax type="xml" marcxml="1" stylesheet="MARC21slim2SRWDC.xsl"
+        identifier="info:srw/schema/1/dc-v1.1">
+        &lt;title>Dublin Core&lt;title>
+        &lt;name>dc&lt;name>
+       &lt;syntax>
+       &lt;syntax type="*" error="238"/>
+       ..
        &lt;/target>
-      &lt;/proxy>
-     </screen>
+       &lt;/proxy>
+      </screen>
     </para>
+    </example>
+
    </section>
 
    <section id="proxy-config-explain">
     <literal>characterInfo</literal> of the <literal>information</literal>
      choice.
    </para>
-   </section>
+  </section>
+  <section id="yazproxy-schema">
+   <title>YAZ Proxy Configuration Schema</title>
+   <para>
+    Here an XML Schema for the YAZ proxy configuration file. 
+    The schema, <filename>yazproxy.xsd</filename> is located in sub
+    directory <filename>etc</filename> of the distribution.
+   </para>
+   <screen><![CDATA[
+    <?xml version="1.0"?>
+<!-- XML Schema for YAZ proxy config file.
+    $Id: reference.xml,v 1.4 2004-04-21 08:16:42 adam Exp $
+-->
+<xs:schema
+  xmlns:xs="http://www.w3.org/2001/XMLSchema"
+  xmlns:exp="http://explain.z3950.org/dtd/2.0/"
+  xmlns="http://indexdata.dk/yazproxy/schema/0.8/"
+  targetNamespace="http://indexdata.dk/yazproxy/schema/0.8/"
+  >
+ <xs:import namespace="http://explain.z3950.org/dtd/2.0/" 
+      schemaLocation="zeerex-2.0.xsd"/>
+ <xs:element name="proxy">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element ref="target" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:element ref="max-clients" minOccurs="0"/>
+    <xs:element ref="log" minOccurs="0"/>
+   </xs:sequence>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="target">
+  <xs:complexType>
+   <xs:sequence>
+     <xs:element ref="url" minOccurs="0" maxOccurs="unbounded"/>
+     <xs:element ref="target-timeout" minOccurs="0"/>
+     <xs:element ref="client-timeout" minOccurs="0"/>
+     <xs:element ref="keepalive" minOccurs="0"/>
+     <xs:element ref="limit" minOccurs="0"/>
+     <xs:element ref="attribute" minOccurs="0" maxOccurs="unbounded"/>
+     <xs:element ref="syntax" minOccurs="0" maxOccurs="unbounded"/>
+     <xs:element ref="preinit" minOccurs="0"/>
+     <xs:element name="exp:explain" minOccurs="0"/>
+     <xs:element ref="cql2rpn" minOccurs="0"/>
+   </xs:sequence>
+   <xs:attribute name="default" type="xs:string" use="optional"/>
+   <xs:attribute name="name" type="xs:string"/>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="url" type="xs:string"/>
+ <xs:element name="target-timeout" type="xs:integer"/>
+ <xs:element name="client-timeout" type="xs:integer"/>
+ <xs:element name="bandwidth" type="xs:integer"/>
+ <xs:element name="pdu" type="xs:integer"/>
+ <xs:element name="retrieve" type="xs:integer"/>
+ <xs:element name="preinit" type="xs:integer"/>
+ <xs:element name="cql2rpn" type="xs:string"/>
+
+ <xs:element name="keepalive">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element ref="bandwidth" minOccurs="0"/>
+    <xs:element ref="pdu" minOccurs="0"/>
+   </xs:sequence>
+  </xs:complexType>
+ </xs:element>
+ <xs:element name="limit">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element ref="bandwidth" minOccurs="0"/>
+    <xs:element ref="pdu" minOccurs="0"/>
+    <xs:element ref="retrieve" minOccurs="0"/>
+   </xs:sequence>
+  </xs:complexType>
+ </xs:element>
+ <xs:element name="attribute">
+  <xs:complexType>
+   <xs:attribute name="type" type="xs:string"/>
+   <xs:attribute name="value" type="xs:string"/>
+   <xs:attribute name="error" type="xs:integer"/>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="syntax">
+  <xs:complexType>
+   <xs:sequence>
+    <xs:element name="title" type="xs:string" minOccurs="0"/>
+    <xs:element name="name" type="xs:string" minOccurs="0"
+                                             maxOccurs="unbounded"/>
+   </xs:sequence>
+   <xs:attribute name="error" type="xs:string" minOccurs="0"/>
+   <xs:attribute name="type" type="xs:string" minOccurs="0"/>
+   <xs:attribute name="marcxml" type="xs:string" minOccurs="0"/>
+   <xs:attribute name="identifier" type="xs:string" minOccurs="0"/>
+   <xs:attribute name="stylesheet" type="xs:string" minOccurs="0"/>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="max-clients" type="xs:integer"/>
+ <xs:element name="log" type="xs:string"/>
+
+</xs:schema>
+
+]]>
+   </screen>
+  </section>
  </chapter>
 
  <!-- Keep this comment at the end of the file