All elements for YAZ GFS XML config described
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Mar 2005 11:12:16 +0000 (11:12 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 14 Mar 2005 11:12:16 +0000 (11:12 +0000)
doc/frontend.xml
doc/gfs-options.xml
doc/gfs-virtual.xml
doc/tools.xml
doc/yaz-ztest-man.xml
doc/yaz.xml.in

index 7ab9e83..2247a5f 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: frontend.xml,v 1.24 2005-03-13 21:43:00 adam Exp $ -->
+<!-- $Id: frontend.xml,v 1.25 2005-03-14 11:12:16 adam Exp $ -->
  <chapter id="server"><title>Generic server</title>
   <sect1><title>Introduction</title>
    
       Result-Set Sort (optional).
      </para></listitem>
     
+    <listitem><para>
+      Return Explain for SRW/SRU (optional).
+     </para></listitem>
+    
    </itemizedlist>
 
    <para>
@@ -372,6 +376,8 @@ typedef struct bend_initrequest
     /* character set and language negotiation - see include/yaz/z-charneg.h */
     Z_CharSetandLanguageNegotiation *charneg_request;
     Z_External *charneg_response;
+    int (*bend_srw_explain)(void *handle, bend_explain_rr *rr);
+    int (*bend_srw_scan)(void *handle, bend_scan_rr *rr);
 } bend_initrequest;
 
 typedef struct bend_initresult
@@ -458,6 +464,7 @@ typedef struct {
     int hits;                  /* number of hits */
     int errcode;               /* 0==OK */
     char *errstring;           /* system error string or NULL */
+    Z_OtherInformation *search_info;
 } bend_search_rr;
     </synopsis>
 
@@ -715,8 +722,22 @@ typedef struct bend_scan_rr {
     bend_scan_status status;
     int errcode;
     char *errstring;
+    char *scanClause;   /* CQL scan clause */
 } bend_scan_rr;
     </synopsis>
+   <para>
+    This backend server handles both Z39.50 scan 
+    and SRW/SRU scan. In order for a
+    handler to distinguish between SRW/SRU (CQL) scan 
+    Z39.50 Scan , it must check for a non-NULL value of 
+    <literal>scanClause</literal>.
+   </para>
+   <note>
+    <para>
+     if designed today, it would be a choice using a union or similar,
+     but that would break binary compatibility with existing servers.
+    </para>
+    </note>
    </sect2>
   </sect1>
 
@@ -814,7 +835,7 @@ typedef struct bend_scan_rr {
     </para>
    </example>
   </sect1>
-  <sect1 id="server.vhosts"><title>Virtual hosts</title>
+  <sect1 id="server.vhosts"><title>Virtual Hosts</title>
      &gfs-virtual;
   </sect1>
  </chapter>
index 6d56637..7091155 100644 (file)
@@ -1,5 +1,5 @@
 <!-- 
-   $Id: gfs-options.xml,v 1.1 2005-03-13 21:43:00 adam Exp $
+   $Id: gfs-options.xml,v 1.2 2005-03-14 11:12:16 adam Exp $
    Options for generic frontend server and yaz-ztest.
    Included in both manual and man page for yaz-ztest
 -->
@@ -61,7 +61,7 @@
   <listitem><para>A user option that serves as a specifier for some
     sort of configuration, usually a filename.
     The argument to this option is transferred to member
-    <literal>configname</literal>of the
+    <literal>configname</literal> of the
     <literal>statserv_options_block</literal>.
    </para></listitem></varlistentry>
 
index d307f62..8766992 100644 (file)
@@ -1,6 +1,6 @@
 <!-- 
-   $Id: gfs-virtual.xml,v 1.1 2005-03-13 21:43:00 adam Exp $
-   Description of the virtual hosts mechanism in YAZ GFS
+   $Id: gfs-virtual.xml,v 1.2 2005-03-14 11:12:16 adam Exp $
+   Description of the virtual host mechanism in YAZ GFS
    Included in both manual and man page for yaz-ztest
 -->
 
  the TCP/IP binding (port+listening adddress) and/or the virtual host.
 </para>
 <para>
+ A backend can be configured to execute in a particular working
+ directory. Or the YAZ frontend may perform CQL to RPN conversion, thus
+ allowing traditional Z39.50 backends to be offered as a SRW/SRU
+ service. SRW/SRU Explain information for a particular backend may also
+ be specified.
+</para>
+<para>
  For the HTTP protocol, the virtual host is specified in the Host header.
  For the Z39.50 protocol, the virtual host is specified as in the
  Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1.
 </para>
 <para>
  The <literal>listen</literal> describes listener (transport end point),
- such as TCP/IP, Unix file socket or SSL server.
+ such as TCP/IP, Unix file socket or SSL server. Content for 
+ a listener:
+ <variablelist>
+  <varlistentry><term>CDATA (required)</term>
+   <listitem>
+    <para>
+     The CDATA for the <literal>listen</literal> element holds the
+     listener string, such as <literal>tcp:@:210</literal>, 
+     <literal>tcp:server1:2100</literal>,
+     etc.
+    </para>
+   </listitem>
+  </varlistentry>
+  <varlistentry><term>attribute <literal>id</literal> (optional)</term>
+    <listitem>
+     <para>
+      identifier for this listener. This may be referred to from
+      server sections.
+     </para>
+    </listitem>
+   </varlistentry>
+ </variablelist>
+ <note>
+  <para>
+   We expect more information to be added for the listen section in
+   a future version, such as CERT file for SSL servers.
+  </para>
+ </note>
 </para>
 <para>
- The <literal>server</literal> describes a server and includes sub
- elements which servers as parameters for this server.
+ The <literal>server</literal> describes a server and the parameters
+ for this server type. Content for a server:
+ <variablelist>
+  <varlistentry><term>attribute <literal>id</literal> (optional)</term>
+   <listitem>
+    <para>
+     Identifier for this server. Currently not used for anything,
+     but it might be for logging purposes.
+   </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry><term>attribute <literal>listenref</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies listener for this server. If this attribute is not
+     given, the server is accessible from all listener. In order
+     for the server to be used for real, howeever, the virtual host
+     must match (if specified in the configuration).
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry><term>element <literal>config</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies the server configuration. This is equivalent
+     to the config specified using command line option
+     <literal>-c</literal>.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry><term>element <literal>directory</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies a working directory for this backend server. If
+     specifid, the YAZ fronend changes current working directory
+     to this directory whenever a backend of this type is
+     started (backend handler bend_start), stopped (backend handler hand_stop)
+     and initialized (bend_init).
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry><term>element <literal>host</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies the virtual host for this server. If this is specified
+     a client <emphasis>must</emphasis> specify this host string in
+     order to use this backend.
+    </para>
+   </listitem>
+  </varlistentry>
+
+  <varlistentry><term>element <literal>cql2rpn</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies a filename that includes CQL to RPN conversion for this
+     backend server. See &reference-tools-cql-map;
+     If given, the backend server will only "see" a Type-1/RPN query. 
+    </para>
+   </listitem>
+  </varlistentry>
+   
+  <varlistentry><term>element <literal>explain</literal> (optional)</term>
+   <listitem>
+    <para>
+     Specifies SRW/SRU ZeeRex content for this server. Copied verbatim
+     to the client. As things are now, some of the Explain content
+     seeem redundant because host information, etc. is also stored
+     elsewhere.
+    </para>
+   </listitem>
+  </varlistentry>
+ </variablelist>
 </para>
 <para>
- The XML below configures a server with 2 listeners and 3 backend
- servers. The server listens on port 9900 and 9901 identified 
- with references "public9900" and "public9901".
-
- [More to be written]
+ The XML below configures a server that accepts connections from
+ two ports, TCP/IP port 9900 and a local UNIX file socket.
+ We name the TCP/IP server <literal>public</literal> and the
+ other server <literal>internal</literal>.
+ </para>
  <screen>
   <![CDATA[
-<yazgfs>
-  <listen id="public9900">tcp:@:9900</listen>
-  <listen id="public9901">tcp:@:9901</listen>
-  <server>
-    <host>host1</host>
+
+  <listen id="public">tcp:@:9900</listen>
+  <listen id="internal">unix:/var/tmp/socket</listen>
+  <server id="server1">
+    <host>server1.mydomain</host>
     <directory>/var/www/s1</directory>
-    <config>zebra1.cfg</config>
+    <config>config.cfg</config>
   </server>
-  <server>
-    <host>host2</host>
+  <server id="server2">
+    <host>server2.mydomain</host>
     <directory>/var/www/s2</directory>
-    <config>zebra2.cfg</config>
-  </server>
-  <server listenref="public9901">
-    <directory>/var/www/s3</directory>
-    <config>zebra3.cfg</config>
+    <config>config.cfg</config>
     <cql2rpn>../etc/pqf.properties</cql2rpn>
-    <explain>
-      <my>explain</my>
+    <explain xmlns="http://explain.z3950.org/dtd/2.0/">
+      <serverInfo>
+        <host>server2.mydomain</host>
+        <port>9900</port>
+        <database>a</database>
+      </serverInfo>
     </explain>
   </server>
+  <server id="server3" listenref="internal">
+    <directory>/var/www/s3</directory>
+    <config>config.cfg</config>
+  </server>
  </yazgfs>
 ]]>
  </screen>
+<para>
+ There are three configured backend servers. The first two
+ servers, <literal>"server1"</literal> and <literal>"server2"</literal>,
+ can be reached by both listener addresses - since
+ no <literal>listenref</literal> attribute is specified.
+ In order to distinguish between the two a virtual host has
+ been specified for each of server in the <literal>host</literal>
+ elements.
+</para>
+<para>
+ For <literal>"server2"</literal> elements for CQL to RPN conversion
+ is supported and explain information has been added (a short one here
+ to keep the example small).
+</para>
+<para>
+ The third server, <literal>"server3"</literal> can only be reached
+ via listener <literal>"internal"</literal>.
 </para>
 
 <!-- Keep this comment at the end of the file
index d9a57b7..f10bdc0 100644 (file)
@@ -1,4 +1,4 @@
-<!-- $Id: tools.xml,v 1.44 2005-02-08 13:51:30 adam Exp $ -->
+<!-- $Id: tools.xml,v 1.45 2005-03-14 11:12:16 adam Exp $ -->
  <chapter id="tools"><title>Supporting Tools</title>
   
   <para>
@@ -1214,7 +1214,7 @@ int cql_transform_FILE(cql_transform_t ct,
      </para>
     </sect3>
     <sect3 id="tools.cql.map">
-     <title>Specification of CQL to RPN mapping</title>
+     <title>Specification of CQL to RPN mappings</title>
      <para>
       The file supplied to functions 
       <function>cql_transform_open_FILE</function>,
index 094a588..0007b2b 100644 (file)
@@ -3,8 +3,9 @@
      <!ENTITY gfs-virtual SYSTEM "gfs-virtual.xml">
      <!ENTITY gfs-synopsis SYSTEM "gfs-synopsis.xml">
      <!ENTITY gfs-synopsis-app "yaz-ztest">
+     <!ENTITY reference-tools-cql-map 'section "Specifiction of CQL to RPN mappings"'>
 ]>
-<!-- $Id: yaz-ztest-man.xml,v 1.6 2005-03-13 21:43:00 adam Exp $ -->
+<!-- $Id: yaz-ztest-man.xml,v 1.7 2005-03-14 11:12:16 adam Exp $ -->
 <refentry id="yaz-ztest">
  
  <refmeta>
@@ -23,7 +24,7 @@
  <refsect1><title>DESCRIPTION</title>
   <para>
    <command>yaz-ztest</command> is a Z39.50 test server that uses
-   the YAZ frontend server API.
+   the YAZ generic frontend server API.
    The server acts as a real Z39.50 server but does not use a database.
    It returns a random hit count and returns a subset of a few built-in
    records.
@@ -48,6 +49,9 @@
   <title>OPTIONS</title>
   &gfs-options;
  </refsect1>
+ <refsect1><title>VIRTUAL HOSTS</title>
+  &gfs-virtual;
+ </refsect1>
  <refsect1><title>FILES</title>
   <para>
    <filename>yaz-&lt;version&gt;/ztest/yaz-ztest.c</filename>
    <filename>yaz-&lt;version&gt;/include/yaz/backend.h</filename>
   </para>
  </refsect1>
- <refsect1><title>VIRTUAL HOSTS</title>
-  &gfs-virtual;
- </refsect1>
- <refsect1><title>SEE ALSO</title>
+ <refsect1 id="tools.cql.map"><title>SEE ALSO</title>
   <para>
    <citerefentry>
     <refentrytitle>yaz</refentrytitle>
index ba3712a..d5c1081 100644 (file)
@@ -27,8 +27,9 @@
      <!ENTITY comstack "<acronym>COMSTACK</acronym>">
      <!ENTITY zoom "<acronym>ZOOM</acronym>">
      <!ENTITY gfs-synopsis-app "application">
+     <!ENTITY reference-tools-cql-map "<xref linkend='tools.cql.map'/>">
 ]>
-<!-- $Id: yaz.xml.in,v 1.16 2005-03-13 21:43:00 adam Exp $ -->
+<!-- $Id: yaz.xml.in,v 1.17 2005-03-14 11:12:16 adam Exp $ -->
 <book id="yaz">
  <bookinfo>
   <title>YAZ User&apos;s Guide and Reference</title>