Fix description of update command
[yaz-moved-to-github.git] / doc / yaz-client-commands.xml
index aef3fc1..09f7dfc 100644 (file)
@@ -1,10 +1,9 @@
 <!-- 
-   $Id: yaz-client-commands.xml,v 1.2 2003-02-27 19:55:37 adam Exp $
    Commands for YAZ client.
    Included in both manual and man page for yaz-client.
 -->
 <variablelist>
- <varlistentry><term>
+ <varlistentry id="command-open"><term>
    <literal>open </literal><replaceable>zurl</replaceable>
   </term>
   <listitem>
@@ -16,8 +15,8 @@
     Syntax:
    </para>
    <para>
-    [<literal>(tcp|ssl|unix)':'</literal>]<replaceable>host</replaceable>
-    [:<replaceable>port</replaceable>][/<replaceable>base&gt;</replaceable>]
+    [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
+    [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
    </para>
   </listitem>
  </varlistentry>
    <literal>quit</literal>
   </term>
   <listitem>
-   <para>Ends YAZ client</para>
+   <para>Quits YAZ client</para>
   </listitem>
  </varlistentry>
- <varlistentry><term>
-   <literal>f </literal><replaceable>query</replaceable></term>
+ <varlistentry id="command-find"><term>
+   <literal>find </literal><replaceable>query</replaceable></term>
   <listitem>
    <para>Sends a Search Request using the <replaceable>query</replaceable>
-    given.
+    given. By default the query is assumed to be PQF. See command
+    <link linkend="command-querytype">querytype</link> for more information.
    </para>
   </listitem>
  </varlistentry>
@@ -76,7 +76,7 @@
   <listitem>
    <simpara>Scans
     database index for a term. The syntax resembles the syntax
-    for <literal>find</literal>.
+    for <link linkend="command-find"><literal>find</literal></link>.
     If you want to scan for the word <literal>water</literal> you could
     write
    </simpara>
    </screen>
   </listitem>
  </varlistentry>
+ <varlistentry><term>
+   <literal>setscan</literal> <replaceable>set</replaceable> <replaceable>term</replaceable>
+  </term>
+  <listitem>
+   <simpara>Scans database index for a term within a result set. This
+    is similar to the scan command but has a result set as its first argument.
+   </simpara>
+  </listitem>
+ </varlistentry>
+ <varlistentry><term>
+   <literal>scanpos</literal> <replaceable>pos</replaceable>
+  </term>
+  <listitem>
+   <simpara>
+    Sets preferred position for scan. This value
+    is used in next scan. By default position is 1.
+   </simpara>
+  </listitem>
+ </varlistentry>
+ <varlistentry><term>
+   <literal>scansize</literal> <replaceable>size</replaceable>
+  </term>
+  <listitem>
+   <simpara>
+    Sets number of entries to be returned by scan. Default
+    number of entries is 20.
+   </simpara>
+  </listitem>
+ </varlistentry>
+ <varlistentry><term>
+   <literal>scanstep</literal> <replaceable>step</replaceable>
+  </term>
+  <listitem>
+   <simpara>
+    Set step-size for scan. This value is used in next scan
+    sent to the target. By default step-size is 0.
+   </simpara>
+  </listitem>
+ </varlistentry>
  <varlistentry id="sortspec"><term>
    <literal>sort</literal> <replaceable>sortspecs</replaceable>
   </term>
   <listitem>
    <para>Sorts a result set. The sort command takes a
-    sequence of sort specifications. A sort
-    specification holds a field (sort criteria) and is followed by flags.
-    If the sort criteria includes <literal>=</literal> it is assumed
-    that the sort SortKey is of type sortAttributes using Bib-1.
-    The integer before <literal>=</literal> is
+    sequence of space-separated sort specifications, with each sort
+    specification consisting of two space-separated words (so that the
+    whole specification list is made up of an even number of words).
+    The first word of each specification
+    holds a field (sort criterion) and the second holds flags.
+    If the sort criterion includes <literal>=</literal> it is assumed
+    that the <literal>SortKey</literal> is of type
+    <literal>sortAttributes</literal> using Bib-1: in this case
+    the integer before <literal>=</literal> is
     the attribute type and the integer following <literal>=</literal>
     is the attribute value.
-    If no <literal>=</literal> is in the SortKey it is treated as a
-    sortfield-type of type InternationalString.
-    Flags observed are: <literal>s</literal>
-    for case sensitive, <literal>i</literal> for case insensitive,
-    <literal>&lt;</literal> for sort ascending and <literal>&gt;</literal>
-    for sort descending.
+    If no <literal>=</literal> is in the criterion it is treated as a
+    sortfield of type InternationalString.
+    The flags word of each sort specification must consist of
+    <literal>s</literal> 
+    for case sensitive or <literal>i</literal> for case insensitive, and
+    <literal>&lt;</literal> for ascending order or <literal>&gt;</literal>
+    for descending order.
    </para>
   </listitem>
  </varlistentry>
   <listitem>
    <para>Sets up a authentication string if a server requires
     authentication (v2 OpenStyle). The authentication string is first
-    sent to the server when the <literal>open</literal> command is
+    sent to the server when the 
+    <link linkend="command-open"><literal>open</literal></link> command is
     issued and the Z39.50 Initialize Request is sent, so this command
     must be used before <literal>open</literal> in order to be effective.
     A common convention for the <replaceable>authopen</replaceable> string
    </para>
   </listitem>
  </varlistentry>
+
+ <varlistentry><term>
+   <literal>sru</literal> <replaceable>method</replaceable> <replaceable>version</replaceable>
+  </term>
+  <listitem>
+   <para>Selects SRU method and version.
+    Must be one of <literal>POST</literal>,
+    <literal>GET</literal>, <literal>SOAP</literal> (default). Version
+    should be either 1.1 or 1.2. Other versions are allowed - for testing
+    purposes (version negotiation with SRU server).
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>list_all</literal>
+  </term>
+  <listitem>
+   <para>This command displays status and values for many settings.
+   </para>
+  </listitem>
+ </varlistentry>
  <varlistentry><term>
    <literal>lslb</literal> <replaceable>n</replaceable>
   </term>
     together with the search result.
     See the
     <ulink
-           url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+     url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
      Z39.50 standard
     </ulink>
     for more details.
     the search result.
     See the
     <ulink
-           url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+     url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
      Z39.50 standard
     </ulink> for more details.
    </para>
     <literal>lslb</literal> and <literal>ssub</literal>.
     See the
     <ulink
-           url="http://lcweb.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
+     url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
      Z39.50 standard
     </ulink>
     for more details.
     yaz-client supports all the record syntaxes that currently
     are registered. See
     <ulink
-           url="http://lcweb.loc.gov/z3950/agency/defns/oids.html#5">
+     url="http://www.loc.gov/z3950/agency/defns/oids.html#5">
      Z39.50 Standard
     </ulink>
     for more details. Commonly used records syntaxes include usmarc,
    </para>
   </listitem>
  </varlistentry>
- <varlistentry><term>
+ <varlistentry id="command-querytype"><term>
    <literal>querytype</literal> <replaceable>type</replaceable>
   </term>
   <listitem>
-   <para>Sets the query type as used by command <literal>find</literal>.
-    The following is supported: <literal>prefix</literal> for 
-    <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
-    <literal>ccl</literal> for CCL search (Type-2
-    Query), <literal>cql</literal> for CQL or <literal>ccl2rpn</literal> for
-    <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
+   <para>Sets the query type as used by command 
+   <link linkend="command-find"><literal>find</literal></link>.
+    The following is supported:
+    <literal>prefix</literal> for
+       <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
+    <literal>ccl</literal> for CCL search (Type-2 Query),
+    <literal>cql</literal> for CQL (Type-104 search with CQL OID),
+    <literal>ccl2rpn</literal> for
+       <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
+    <literal>cql2rpn</literal> for
+       CQL to RPN conversion (Type-1 Query).
    </para>
   </listitem>
  </varlistentry>
  </varlistentry>
  <varlistentry><term>
    <literal>update</literal>
+   <replaceable>action</replaceable>
+   <replaceable>recid</replaceable>
+   <replaceable>doc</replaceable>
   </term>
   <listitem>
-   <para>Sends Item Update Request. This command sends a "minimal"
-    PDU Update to the target supplying the last received record from
-    the target.
-    If no record has been received from the target this command is ignored
-    and nothing is sent to the target.
+   <para>Sends Item Update Request. The <replaceable>action</replaceable>
+    argument must be the action type: one of <literal>insert</literal>,
+    <literal>replace</literal>, <literal>delete</literal> and
+    <literal>update</literal>. The second argument, 
+    <replaceable>recid</replaceable>, is the
+    record identifier (any string). Third argument which is optional is
+    the record document for the request. If doc is preceded with 
+    "&lt;", then the following characters are treated as a filename
+    with the records to be updated. Otherwise doc is treated as
+    a document itself. The doc may also be quited in double quotes.
+    If doc is omitted, the last received record (as part of present
+    response or piggybacked search response) is used for the update.
    </para>
   </listitem>
  </varlistentry>
 
  <varlistentry><term>
-   <literal>.</literal>
+   <literal>source</literal>
    <replaceable>filename</replaceable>
   </term>
   <listitem>
    <para>Executes list of commands from
     file <replaceable>filename</replaceable>, just like source on
-    most UNIX shells.
+    most UNIX shells. A single dot (<literal>.</literal>) can be used
+    as an alternative.
    </para>
   </listitem>
  </varlistentry>
  </varlistentry>
 
  <varlistentry><term>
-   <literal>push_commande</literal>
+   <literal>push_command</literal>
    <replaceable>command</replaceable>
   </term>
   <listitem>
   </term>
   <listitem>
    <para>Sets that APDU should be logged to file
-    <replaceable>filename</replaceable>. This command does the
-    thing as option <literal>-a</literal>.
+    <replaceable>filename</replaceable>. Another way to achieve
+    APDU log is by using command-line option <literal>-a</literal>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>set_auto_reconnect</literal>
+   <replaceable>flag</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies whether YAZ client automatically reconnect if
+    target closes connection (Z39.50 only).
+   </para>
+   <para>
+    <replaceable>flag</replaceable> must be either
+    <literal>on</literal> or <literal>off</literal>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry id="command-set-auto-wait"><term>
+   <literal>set_auto_wait</literal>
+   <replaceable>flag</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies whether YAZ client should wait for
+   response protocol packages after a request.
+   By default YAZ client waits (on) for response packages immediately
+   after a command (find, show) has been issued. If <literal>off</literal>
+   is used, YAZ client does not attempt to receive packages automatically.
+   These will have to be manually received when command 
+   <link linkend="command-wait-response">
+    <literal>wait_response</literal>
+   </link> is used.
+   </para>
+   <para>
+   <replaceable>flag</replaceable> must be either
+   <literal>on</literal> or <literal>off</literal>.
    </para>
   </listitem>
  </varlistentry>
    <replaceable>filename</replaceable>
   </term>
   <listitem>
-   <para>Specifies that all retrieved records should be appended ot
+   <para>Specifies that all retrieved records should be appended to
     file <replaceable>filename</replaceable>. This command does the
     thing as option <literal>-m</literal>.
    </para>
  </varlistentry>
 
  <varlistentry><term>
-   <literal>set_cclfields</literal>
+   <literal>schema</literal>
+   <replaceable>schemaid</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies schema for retrieval.
+    Schema may be specified as an OID for Z39.50.
+    For SRU, schema is a simple string URI.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry id="command-charset"><term>
+   <literal>charset</literal>
+   <replaceable>negotiationcharset</replaceable>
+   [<replaceable>displaycharset</replaceable>]
+   [[<replaceable>marccharset</replaceable>]]
+  </term>
+  <listitem>
+   <para>Specifies character set (encoding) for Z39.50
+    negotiation / SRU encoding and/or character set for output (terminal).
+   </para>
+   <para>
+    <replaceable>negotiationcharset</replaceable> is the name
+    of the character set to be negotiated by the server. The special name
+    <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
+    specifies <emphasis>no</emphasis> character set to be negotiated.
+   </para>
+   <para>
+    If <replaceable>displaycharset</replaceable> is given, it specifies name
+    of the character set of the output (on the terminal on which
+    YAZ client is running). To disable conversion of characters
+    to the output encoding, the special name <literal>-</literal> (dash)
+    can be used.
+    If the special name <literal>auto</literal> is given, YAZ client will
+    convert strings to the encoding of the
+    terminal as returned by <function>nl_langinfo</function> call.
+   </para>
+   <para>
+    If <replaceable>marcharset</replaceable> is given, it specifies name
+    of the character set of retrieved MARC records from server. See
+    also <literal>marcharset</literal> command.
+   </para>
+   <note>
+    <para>
+     Since character set negotation takes effect in the Z39.50
+     Initialize Request you should issue this command before
+     command <link linkend="command-open"><literal>open</literal></link>
+     is used.
+    </para>
+   </note>
+   <note>
+    <para>
+     MARC records are not covered by Z39.50 character set negotiation,
+     so that's why there is a separate character that must be known
+     in order to do meaningful conversion(s).
+    </para>
+   </note>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>negcharset</literal>
+   <replaceable>charset</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies character set for negotiation (Z39.50). The
+    argument is the same as second argument for command
+    <link linkend="command-charset"><literal>charset</literal></link>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>displaycharset</literal>
+   <replaceable>charset</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies character set for output (display). The
+    argument is the same as second argument for command 
+    <link linkend="command-charset"><literal>charset</literal></link>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>marccharset</literal>
+   <replaceable>charset</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies character set for retrieved MARC records so
+    that YAZ client can display them in a character suitable
+    for your display. See <literal>charset</literal> command.
+    If <literal>auto</literal> is given, YAZ will assume
+    that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
+    for all other MARC variants. The charset argument is the
+    same as third argument for command
+    <link linkend="command-charset"><literal>charset</literal></link>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>querycharset</literal>
+   <replaceable>charset</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies character set for query terms for Z39.50 RPN
+    queries and Z39.50 Scan Requests (termListAndStartPoint).
+    This is a pure client-side conversion which converts from
+    displayCharset to queryCharset.
+   </para>
+  </listitem>
+ </varlistentry>
+ <varlistentry><term>
+   <literal>set_cclfile</literal>
    <replaceable>filename</replaceable>
   </term>
   <listitem>
  </varlistentry>
 
  <varlistentry><term>
+   <literal>set_cqlfile</literal>
+   <replaceable>filename</replaceable>
+  </term>
+  <listitem>
+   <para>Specifies that CQL fields should be read from file
+    file <replaceable>filename</replaceable>. This command does the
+    thing as option <literal>-q</literal>.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
    <literal>register_oid</literal>
    <replaceable>name</replaceable>
    <replaceable>class</replaceable>
    </para>
   </listitem>
  </varlistentry>
+
+ <varlistentry><term>
+   <literal>register_tab</literal>
+   <replaceable>command</replaceable>
+   <replaceable>string</replaceable>
+  </term>
+  <listitem>
+   <para>This command registers a TAB completion string for
+    the command given.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>sleep</literal>
+   <replaceable>seconds</replaceable>
+  </term>
+  <listitem>
+   <para>This command makes YAZ client sleep (be idle) for
+    the number of seconds given.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry id="command-wait-response"><term>
+   <literal>wait_response</literal>
+   [ <replaceable>number</replaceable>]
+  </term>
+  <listitem>
+   <para>This command makes YAZ client wait for a number of
+    response packages from target. If <replaceable>number</replaceable> is
+    omitted, 1 is assumed. 
+   </para>
+   <para>This command is rarely used and is only useful if command
+    <link linkend="command-set-auto-wait">
+     <literal>set_auto_wait</literal>
+    </link> is set to off.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry id="command-xmles"><term>
+   <literal>xmles</literal>
+   <replaceable>OID</replaceable>
+   <replaceable>doc</replaceable>
+  </term>
+  <listitem>
+   <para>Sends XML Extended Services request using the OID and doc given.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>zversion</literal>
+   <replaceable>ver</replaceable>
+  </term>
+  <listitem>
+   <para>This command sets Z39.50 version for negotiation. 
+    Should be used before 
+    <link linkend="command-open"><literal>open</literal></link>.
+    By default 3 (version 3) is used.
+   </para>
+  </listitem>
+ </varlistentry>
+
+ <varlistentry><term>
+   <literal>options</literal>
+   <replaceable>op1 op2..</replaceable>
+  </term>
+  <listitem>
+   <para>This command sets Z39.50 options for negotiation. 
+    Should be used before 
+   <link linkend="command-open"><literal>open</literal></link>.
+   </para>
+   <para>
+    The following options are supported:
+    <literal>search</literal>,  
+    <literal>present</literal>,  
+    <literal>delSet</literal>,  
+    <literal>resourceReport</literal>,  
+    <literal>triggerResourceCtrl</literal>,  
+    <literal>resourceCtrl</literal>,  
+    <literal>accessCtrl</literal>,  
+    <literal>scan</literal>,  
+    <literal>sort</literal>,  
+    <literal>extendedServices</literal>,  
+    <literal>level_1Segmentation</literal>,  
+    <literal>level_2Segmentation</literal>,  
+    <literal>concurrentOperations</literal>,  
+    <literal>namedResultSets</literal>,  
+    <literal>encapsulation</literal>,  
+    <literal>resultCount</literal>,  
+    <literal>negotiationModel</literal>,  
+    <literal>duplicationDetection</literal>,  
+    <literal>queryType104</literal>,  
+    <literal>pQESCorrection</literal>,  
+    <literal>stringSchema</literal>.
+   </para>
+  </listitem>
+ </varlistentry>
  
 </variablelist>
 <!-- Keep this comment at the end of the file