Implement max-connect facility which makes the server sleep if a
[yazproxy-moved-to-github.git] / doc / reference.xml
index aeeefa1..3e52ecb 100644 (file)
@@ -3,7 +3,7 @@
   <section id="proxy-operation">
    <title>Operating Environment</title>
    <para>
-    The YAZ proxy is a single program. After startup it spawns 
+    The YAZ proxy is a console program. After startup it spawns 
     a child process (except on Windows or if option -X is given). 
     The child process is the core of the proxy and it handles all
     communication with clients and servers. The parent process
@@ -12,7 +12,7 @@
     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>
     </para>
   </section>
   
+  
+  <section id="query-cache">
+   <title>Query Caching</title>
+   <para>
+    Simple stateless clients often send identical Z39.50 searches
+    in a relatively short period of time (e.g. in order to produce a
+    results-list page, the next page,
+    a single full-record, etc). And for many targets, it's
+    much more expensive to produce a new result set than to
+    reuse an existing one.
+   </para>
+   <para>
+    The proxy tries to solve that by remembering the last query for each
+    backend target, so that if an identical query is received next, it
+    is turned into Present Requests rather than new Search Requests.
+   </para>
+   <note>
+    <para>
+     In a future we release will will probably allows for
+     an arbitrary-sized cache for targets supporting named result sets.
+    </para>
+   </note>
+   <para>
+    You can enable/disable query caching using option -o.
+   </para>
+  </section>
+  
+  <section id="record-cache">
+   <title>Record Caching</title>
+   <para>
+    As an option, the proxy may also cache result set records for the
+    last search.
+    The proxy takes into account the Record Syntax and CompSpec.
+    The CompSpec includes simple element set names as well.
+    By default the cache is 200000 bytes per session.
+   </para>
+  </section>
+  
+  <section id="query-validation">
+   <title>Query Validation</title>
+   <para>
+    The Proxy may also be configured to trap particular attributes in
+    Type-1 queries and send Bib-1 diagnostics back to the client without
+    even consulting the backend target. This facility may be useful if
+    a target does not properly issue diagnostics when unsupported attributes
+    are send to it.
+   </para>
+  </section>
+  
+   <section id="record-validation">
+   <title>Record Syntax Validation</title>
+   <para>
+    The proxy may be configured to accept, reject or convert records.
+    When accepted, the target passes search/present requests to the
+    backend target under the assumption that the target can honor the
+    request (In fact it may not do that). When a record is rejected because
+    the record syntax is "unsupported" the proxy returns a diagnostic to the
+    client. Finally, the proxy may convert records.
+   </para>
+   <para>
+    The proxy can convert from MARC to MARCXML and thereby offer an
+    XML version of any MARC record as long as it is ISO2709 encoded.
+    If the proxy is compiled with libXSLT support it can also
+    perform XSLT on XML.
+   </para>
+  </section>
+  
+  <section id="other-optimizations">
+   <title>Other Optimizations</title>
+   <para>
+    We've had some plans to support global caching of result set records,
+    but this has not yet been implemented.
+   </para>
+  </section>
+   
   <section id="proxy-config-file">
    <title>Proxy Configuration File</title>
    <para>
     </para>
     <para>
      This can also be specified on the command line by using option
-     <literal>-T</literal>. Refer to OPTIONS.
+     <literal>-T</literal>. Refer to OPTIONS in <xref linkend="proxy-usage"/>.
     </para>
    </section>
 
      </para>
     <para>
      This can also be specified on the command line by using option
-     <literal>-i</literal>. Refer to OPTIONS.
+     <literal>-i</literal>.  Refer to OPTIONS in <xref linkend="proxy-usage"/>.
     </para>
    </section>
 
     </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>
-       &lt;retrieve>400&lt;/retrieve>
+       &lt;pdu>400&lt;/pdu>
       &lt;/keepalive>
      </screen>
     </para>
      A target that supports use attributes 1,4, 1000 through 1003 and
      no other use attributes, could use the following rules:
      <screen>
-      &lt;attribute type="1" value="1,4,1000-1003">
+      &lt;attribute type="1" value="1,4,1000-1003"/>
       &lt;attribute type="1" value="*" error="114"/>
      </screen>
     </para>
      If attribute <literal>marcxml</literal> is given, the proxy will
      perform MARC21 to MARCXML conversion. In this case the
      <literal>type</literal> should be XML. The proxy will use
-     preferred record syntax USMARC/MARC21 against the backend target.
+     preferred record syntax USMARC/MARC21 or <literal>backendtype</literal> 
+     (if given) against the backend target.
+    </para>
+    <para>
+     If attribute <literal>backendtype</literal> is given, that holds the
+     record syntax to be transmitted to backend.
     </para>
     <para>
      If attribute <literal>stylesheet</literal> is given, the proxy
        ..
        &lt;syntax type="usmarc"/>
        &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>
+         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>
+         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>
    <section id="proxy-config-cql2rpn">
     <title>cql2rpn</title>
     <para>
-     The CDATA of <literal>cql2rpn</literal> refers to CQL to a RPN conversion
-     file - for the server in the target section. This element
-     is required for SRW/SRU searches to operate against a Z39.50
-     server that doesn't support CQL. Most Z39.50 servers only support
+     The content of the <literal>cql2rpn</literal> element specifies
+     the path from the working directory to a CQL-to-RPN conversion
+     file for the server in the target section. This element
+     is required for SRW/SRU searches to operate against Z39.50
+     servers that don't support CQL. Most Z39.50 servers only support
      Type-1/RPN so this is usually required.
+    </para>
+    <para>
      See YAZ documentation for more information about the
      <ulink url="http://indexdata.dk/yaz/doc/tools.tkl#tools.cql.pqf">CQL
       to PQF</ulink> conversion. See also the
      <filename>pqf.properties</filename> in the <filename>etc</filename> 
      (or <replaceable>prefix/share/yazproxy</replaceable>)
-     directory of the YAZ proxy.
+     directory of the YAZ proxy distribution.
     </para>
    </section>
    
      </tip>
    </section>
 
+   <section id="proxy-config-target-authentication">
+    <title>target-authentication</title>
+    <para>
+     The element <literal>target-authentication</literal> specifies
+     fixed authentication information to be sent to the backend target.
+    </para>
+    <para>
+     This element takes a an attribute <literal>type</literal> which is
+     the authenticatin type to be used.. 
+    </para>
+    <variablelist>
+     <varlistentry><term><literal>none</literal></term>
+      <listitem>
+       <para>
+       No authentication. There is no CDATA associated with this.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry><term><literal>anonymous</literal></term>
+      <listitem>
+       <para>
+       Anonymous authentication. There is no CDATA associated with this.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry><term><literal>open</literal></term>
+      <listitem>
+       <para>
+       Open authentication. The CDATA consists of the
+       open authentication string.
+       </para>
+      </listitem>
+     </varlistentry>
+
+     <varlistentry><term><literal>idPass</literal></term>
+      <listitem>
+       <para>
+       IdPass authentication. The CDATA consists of
+       three terms: user, group and password.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+   </section>
+
    <section id="proxy-config-log">
     <title>log</title>
     <para>
     </para>
    </section>
   </section>
-  
-  <section id="query-cache">
-   <title>Query Caching</title>
-   <para>
-    Simple stateless clients often send identical Z39.50 searches
-    in a relatively short period of time (e.g. in order to produce a
-    results-list page, the next page,
-    a single full-record, etc). And for many targets, it's
-    much more expensive to produce a new result set than to
-    reuse an existing one.
-   </para>
-   <para>
-    The proxy tries to solve that by remembering the last query for each
-    backend target, so that if an identical query is received next, it
-    is turned into Present Requests rather than new Search Requests.
-   </para>
-   <note>
-    <para>
-     In a future we release will will probably allows for
-     an arbitrary-sized cache for targets supporting named result sets.
-    </para>
-   </note>
-   <para>
-    You can enable/disable query caching using option -o.
-   </para>
-  </section>
-  
-  <section id="record-cache">
-   <title>Record Caching</title>
-   <para>
-    As an option, the proxy may also cache result set records for the
-    last search.
-    The proxy takes into account the Record Syntax and CompSpec.
-    The CompSpec includes simple element set names as well.
-    By default the cache is 200000 bytes per session.
-   </para>
-  </section>
-  
-  <section id="query-validation">
-   <title>Query Validation</title>
-   <para>
-    The Proxy may also be configured to trap particular attributes in
-    Type-1 queries and send Bib-1 diagnostics back to the client without
-    even consulting the backend target. This facility may be useful if
-    a target does not properly issue diagnostics when unsupported attributes
-    are send to it.
-   </para>
-  </section>
-  
-   <section id="record-validation">
-   <title>Record Syntax Validation</title>
-   <para>
-    The proxy may be configured to accept, reject or convert records.
-    When accepted, the target passes search/present requests to the
-    backend target under the assumption that the target can honor the
-    request (In fact it may not do that). When a record is rejected because
-    the record syntax is "unsupported" the proxy returns a diagnostic to the
-    client. Finally, the proxy may convert records.
-   </para>
-   <para>
-    The proxy can convert from MARC to MARCXML and thereby offer an
-    XML version of any MARC record as long as it is ISO2709 encoded.
-    If the proxy is compiled with libXSLT support it can also
-    perform XSLT on XML.
-   </para>
-  </section>
-  
-  <section id="other-optimizations">
-   <title>Other Optimizations</title>
-   <para>
-    We've had some plans to support global caching of result set records,
-    but this has not yet been implemented.
-   </para>
-  </section>
-   
   <section id="proxy-usage">
-   <title>Proxy Usage (man page)</title>
+   <title>Proxy Manual Pages</title>
    <refentry id="yazproxy-man">
     &yaz-proxy-ref;
    </refentry>
     directory <filename>etc</filename> of the distribution.
    </para>
    <screen><![CDATA[
-    <?xml version="1.0"?>
+<?xml version="1.0"?>
 <!-- XML Schema for YAZ proxy config file.
-    $Id: reference.xml,v 1.3 2004-04-20 23:49:48 adam Exp $
+    $Id: reference.xml,v 1.14 2006-03-29 18:09:01 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/"
+  xmlns="http://indexdata.dk/yazproxy/schema/0.9/"
+  targetNamespace="http://indexdata.dk/yazproxy/schema/0.9/"
   >
  <xs:import namespace="http://explain.z3950.org/dtd/2.0/" 
       schemaLocation="zeerex-2.0.xsd"/>
     <xs:element ref="target" minOccurs="0" maxOccurs="unbounded"/>
     <xs:element ref="max-clients" minOccurs="0"/>
     <xs:element ref="log" minOccurs="0"/>
+    <xs:element ref="module" minOccurs="0"/>
    </xs:sequence>
   </xs:complexType>
  </xs:element>
      <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="exp:explain" minOccurs="0"/>
      <xs:element ref="cql2rpn" minOccurs="0"/>
+     <xs:element ref="target-authentication" minOccurs="0"/>
+     <xs:element ref="client-authentication" minOccurs="0"/>
+     <xs:element ref="negotiation-charset" minOccurs="0"/>
+     <xs:element ref="negotiation-lang" minOccurs="0"/>
    </xs:sequence>
    <xs:attribute name="default" type="xs:string" use="optional"/>
    <xs:attribute name="name" type="xs:string"/>
+   <xs:attribute name="database" type="xs:string"/>
   </xs:complexType>
  </xs:element>
 
  <xs:element name="retrieve" type="xs:integer"/>
  <xs:element name="preinit" type="xs:integer"/>
  <xs:element name="cql2rpn" type="xs:string"/>
+ <xs:element name="target-authentication">
+   <xs:complexType>
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="type" type="xs:string"/>
+      </xs:extension>
+    </xs:simpleContent>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="client-authentication">
+   <xs:complexType>
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="module" type="xs:string"/>
+        <xs:attribute name="args" type="xs:string"/>
+      </xs:extension>
+    </xs:simpleContent>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="negotiation-charset" type="xs:string"/>
+ <xs:element name="negotiation-lang" type="xs:string"/>
 
  <xs:element name="keepalive">
   <xs:complexType>
  <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:element ref="title" minOccurs="0"/>
+    <xs:element ref="name" 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:attribute name="error" type="xs:string" />
+   <xs:attribute name="type" type="xs:string" />
+   <xs:attribute name="marcxml" type="xs:string" />
+   <xs:attribute name="identifier" type="xs:string" />
+   <xs:attribute name="stylesheet" type="xs:string" />
+   <xs:attribute name="backendtype" type="xs:string" />
+   <xs:attribute name="backendcharset" type="xs:string" />
+   <xs:attribute name="usemarconstage1" type="xs:string" />
+   <xs:attribute name="usemarconstage2" type="xs:string" />
   </xs:complexType>
  </xs:element>
 
+ <xs:element name="title" type="xs:string"/>
+ <xs:element name="name" type="xs:string"/>
+
  <xs:element name="max-clients" type="xs:integer"/>
  <xs:element name="log" type="xs:string"/>
+ <xs:element name="module" type="xs:string"/>
 
 </xs:schema>
-
 ]]>
    </screen>
   </section>