corrected DOCTYPE header and called emacs nxml-mode instead of sgml-mode in bottom...
[yaz-moved-to-github.git] / doc / yaz-client-commands.xml
1 <!-- 
2    $Id: yaz-client-commands.xml,v 1.13 2006-04-24 12:41:00 marc Exp $
3    Commands for YAZ client.
4    Included in both manual and man page for yaz-client.
5 -->
6 <variablelist>
7  <varlistentry id="command-open"><term>
8    <literal>open </literal><replaceable>zurl</replaceable>
9   </term>
10   <listitem>
11    <para>Opens a connection to a server. The syntax for
12     <replaceable>zurl</replaceable> is the same as described
13     above for connecting from the command line.
14    </para>
15    <para>
16     Syntax:
17    </para>
18    <para>
19     [<literal>(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable>
20     [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>]
21    </para>
22   </listitem>
23  </varlistentry>
24  <varlistentry><term>
25    <literal>quit</literal>
26   </term>
27   <listitem>
28    <para>Quits YAZ client</para>
29   </listitem>
30  </varlistentry>
31  <varlistentry id="command-find"><term>
32    <literal>find </literal><replaceable>query</replaceable></term>
33   <listitem>
34    <para>Sends a Search Request using the <replaceable>query</replaceable>
35     given. By default the query is assumed to be PQF. See command
36     <link linkend="command-querytype"><literal>querytype</literal></link>.
37    </para>
38   </listitem>
39  </varlistentry>
40  <varlistentry><term>
41    <literal>delete</literal> <replaceable>setname</replaceable></term>
42   <listitem>
43    <para>Deletes result set with name <replaceable>setname</replaceable>
44     on the server.</para>
45   </listitem>
46  </varlistentry>
47  <varlistentry><term>
48    <literal>base </literal><replaceable>base1</replaceable>
49    <replaceable>base2</replaceable> ...
50   </term>
51   <listitem>
52    <para>Sets the name(s) of the database(s) to search. One or more
53     databases may be specified separated by blanks. This commands overrides
54     the database given in <replaceable>zurl</replaceable>.
55    </para>
56   </listitem>
57  </varlistentry>
58  <varlistentry><term>
59    <literal>show </literal>
60    [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]]
61   </term>
62   <listitem>
63    <para>Fetches records by sending a Present Request from the start
64     position given by
65     <replaceable>start</replaceable>
66     a number of records given by <replaceable>number</replaceable>. If
67     <replaceable>start</replaceable> is not given, then the client
68     will fetch from position of the last retrieved record plus 1. If
69     <replaceable>number</replaceable> is not given, then one record will
70     be fetched at a time.
71    </para>
72   </listitem>
73  </varlistentry>
74  <varlistentry><term>
75    <literal>scan</literal> <replaceable>term</replaceable>
76   </term>
77   <listitem>
78    <simpara>Scans
79     database index for a term. The syntax resembles the syntax
80     for <link linkend="command-find"><literal>find</literal></link>.
81     If you want to scan for the word <literal>water</literal> you could
82     write
83    </simpara>
84    <screen>
85     scan water
86    </screen>
87    <simpara>
88     but if you want to scan only in, say the title field, you would write
89    </simpara>
90    <screen>
91     scan @attr 1=4 water
92    </screen>
93   </listitem>
94  </varlistentry>
95  <varlistentry><term>
96    <literal>scanpos</literal> <replaceable>pos</replaceable>
97   </term>
98   <listitem>
99    <simpara>
100     Sets preferred position for scan. This value
101     is used in next scan. By default position is 1.
102    </simpara>
103   </listitem>
104  </varlistentry>
105  <varlistentry><term>
106    <literal>scansize</literal> <replaceable>size</replaceable>
107   </term>
108   <listitem>
109    <simpara>
110     Sets number of entries to be returned by scan. Default
111     number of entries is 20.
112    </simpara>
113   </listitem>
114  </varlistentry>
115  <varlistentry><term>
116    <literal>scanstep</literal> <replaceable>step</replaceable>
117   </term>
118   <listitem>
119    <simpara>
120     Set step-size for scan. This value is used in next scan
121     sent to the target. By default step-size is 0.
122    </simpara>
123   </listitem>
124  </varlistentry>
125  <varlistentry id="sortspec"><term>
126    <literal>sort</literal> <replaceable>sortspecs</replaceable>
127   </term>
128   <listitem>
129    <para>Sorts a result set. The sort command takes a
130     sequence of space-separated sort specifications, with each sort
131     specification consisting of two space-separated words (so that the
132     whole specification list is made up of an even number of words).
133     The first word of each specification
134     holds a field (sort criterion) and the second holds flags.
135     If the sort criterion includes <literal>=</literal> it is assumed
136     that the <literal>SortKey</literal> is of type
137     <literal>sortAttributes</literal> using Bib-1: in this case
138     the integer before <literal>=</literal> is
139     the attribute type and the integer following <literal>=</literal>
140     is the attribute value.
141     If no <literal>=</literal> is in the criterion it is treated as a
142     sortfield of type InternationalString.
143     The flags word of each sort specification must consist of
144     <literal>s</literal> 
145     for case sensitive or <literal>i</literal> for case insensitive, and
146     <literal>&lt;</literal> for ascending order or <literal>&gt;</literal>
147     for descending order.
148    </para>
149   </listitem>
150  </varlistentry>
151  <varlistentry><term>
152    <literal>sort+</literal>
153   </term>
154   <listitem>
155    <para>Same as <literal>sort</literal> but stores the sorted
156     result set in a new result set.
157    </para>
158   </listitem>
159  </varlistentry>
160  <varlistentry><term>
161    <literal>authentication</literal> <replaceable>openauth</replaceable>
162   </term>
163   <listitem>
164    <para>Sets up a authentication string if a server requires
165     authentication (v2 OpenStyle). The authentication string is first
166     sent to the server when the 
167     <link linkend="command-open"><literal>open</literal></link> command is
168     issued and the Z39.50 Initialize Request is sent, so this command
169     must be used before <literal>open</literal> in order to be effective.
170     A common convention for the <replaceable>authopen</replaceable> string
171     is that the username - and password is separated by a slash, e.g.
172     <literal>myusername/mysecret</literal>.
173    </para>
174   </listitem>
175  </varlistentry>
176
177  <varlistentry><term>
178    <literal>list_all</literal>
179   </term>
180   <listitem>
181    <para>This command displays status and values for many settings.
182    </para>
183   </listitem>
184  </varlistentry>
185  
186  <varlistentry><term>
187    <literal>lslb</literal> <replaceable>n</replaceable>
188   </term>
189   <listitem>
190    <para>Sets the limit for when no records should be returned
191     together with the search result.
192     See the
193     <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
194      Z39.50 standard
195     </ulink>
196     for more details.
197    </para>
198   </listitem>
199  </varlistentry>
200
201  <varlistentry><term>
202    <literal>ssub</literal> <replaceable>n</replaceable>
203   </term>
204   <listitem>
205    <para>Sets the limit for when all records should be returned with
206     the search result.
207     See the
208     <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
209      Z39.50 standard
210     </ulink> for more details.
211    </para>
212   </listitem>
213  </varlistentry>
214  
215  <varlistentry><term>
216    <literal>mspn</literal> <replaceable>n</replaceable>
217   </term>
218   <listitem>
219    <para>Sets the number of records should be returned if the
220     number of records in the result set is between the values of
221     <literal>lslb</literal> and <literal>ssub</literal>.
222     See the
223     <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
224      Z39.50 standard
225     </ulink>
226     for more details.
227    </para>
228   </listitem>
229  </varlistentry>
230  <varlistentry><term>
231    <literal>status</literal>
232   </term>
233   <listitem>
234    <para>Displays the values of <literal>lslb</literal>,
235     <literal>ssub</literal> and <literal>mspn</literal>.
236    </para>
237   </listitem>
238  </varlistentry>
239  <varlistentry><term>
240    <literal>setname</literal>
241   </term>
242   <listitem>
243    <para>Switches named result sets on and off. Default is on.
244    </para>
245   </listitem>
246  </varlistentry>
247  <varlistentry><term>
248    <literal>cancel</literal>
249   </term>
250   <listitem>
251    <para>Sends a Trigger Resource Control Request to the target.
252    </para>
253   </listitem>
254  </varlistentry>
255  <varlistentry><term>
256    <literal>format</literal> <replaceable>oid</replaceable>
257   </term>
258   <listitem>
259    <para>Sets the preferred transfer syntax for retrieved records.
260     yaz-client supports all the record syntaxes that currently
261     are registered. See
262     <ulink url="http://www.loc.gov/z3950/agency/defns/oids.html#5">
263      Z39.50 Standard
264     </ulink>
265     for more details. Commonly used records syntaxes include usmarc,
266     sutrs, grs1 and xml.
267    </para>
268   </listitem>
269  </varlistentry>
270  <varlistentry><term>
271    <literal>elements</literal> <replaceable>e</replaceable>
272   </term>
273   <listitem>
274    <para>Sets the element set name for the records. Many targets support
275     element sets are B (for brief) and F (for full).
276    </para>
277   </listitem>
278  </varlistentry>
279  <varlistentry><term>
280    <literal>close</literal>
281   </term>
282   <listitem>
283    <para>Sends a Z39.50 Close APDU and closes connection with the peer
284    </para>
285   </listitem>
286  </varlistentry>
287  <varlistentry id="command-querytype"><term>
288    <literal>querytype</literal> <replaceable>type</replaceable>
289   </term>
290   <listitem>
291    <para>Sets the query type as used by command 
292    <link linkend="command-find"><literal>find</literal></link>.
293     The following is supported:
294     <literal>prefix</literal> for
295         <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
296     <literal>ccl</literal> for CCL search (Type-2 Query),
297     <literal>cql</literal> for CQL (Type-104 search with CQL OID),
298     <literal>ccl2rpn</literal> for
299         <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
300     <literal>cql2rpn</literal> for
301         CQL to RPN conversion (Type-1 Query).
302    </para>
303   </listitem>
304  </varlistentry>
305  <varlistentry><term>
306    <literal>attributeset</literal> <replaceable>set</replaceable>
307   </term>
308   <listitem>
309    <para>
310     Sets attribute set OID for prefix queries (RPN, Type-1).
311    </para>
312   </listitem>
313  </varlistentry>
314  <varlistentry><term>
315    <literal>refid</literal> <replaceable>id</replaceable>
316   </term>
317   <listitem>
318    <para>Sets reference ID for Z39.50 Request(s).
319    </para>
320   </listitem>
321  </varlistentry>
322  <varlistentry><term>
323    <literal>itemorder</literal>
324    <replaceable>type</replaceable> <replaceable>no</replaceable>
325   </term>
326   <listitem>
327    <para>Sends an Item Order Request using the ILL External. 
328     <replaceable>type</replaceable> is either 1 or 2 which corresponds to
329     ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
330     is the Result Set position of the record to be ordered.
331    </para>
332   </listitem>
333  </varlistentry>
334  <varlistentry><term>
335    <literal>update</literal>
336    <replaceable>action</replaceable>
337    <replaceable>recid</replaceable>
338    <replaceable>doc</replaceable>
339   </term>
340   <listitem>
341    <para>Sends Item Update Request. The <replaceable>action</replaceable>
342     argument must be the action type: one of <literal>insert</literal>,
343     <literal>replace</literal>, <literal>delete</literal> and
344     <literal>update</literal>. The second argument, 
345     <replaceable>recid</replaceable>, is the
346     record identifier (any string). Third argument which is optional is
347     the record document for the request. If doc is a quoted string
348     (double quotes) the string content is used verbatim. If doc is not
349     a quoted string, it is assumed to be a filename which is read, then
350     sent as the docuemnt content. If doc is omitted, the last received
351     record (as parf of present response or piggybacked search response) 
352     is used for the update.
353    </para>
354   </listitem>
355  </varlistentry>
356
357  <varlistentry><term>
358    <literal>.</literal>
359    <replaceable>filename</replaceable>
360   </term>
361   <listitem>
362    <para>Executes list of commands from
363     file <replaceable>filename</replaceable>, just like source on
364     most UNIX shells.
365    </para>
366   </listitem>
367  </varlistentry>
368
369  <varlistentry><term>
370    <literal>!</literal>
371    <replaceable>args</replaceable>
372   </term>
373   <listitem>
374    <para>Executes command <replaceable>args</replaceable> in subshell
375     using the <literal>system</literal> call.
376    </para>
377   </listitem>
378  </varlistentry>
379
380  <varlistentry><term>
381    <literal>push_command</literal>
382    <replaceable>command</replaceable>
383   </term>
384   <listitem>
385    <para>The push_command takes another command as its argument.
386     That command is then added to the history information (so
387     you can retrieve it later). The command itself is not
388     executed. This command only works if you have GNU readline/history
389     enabled.
390    </para>
391   </listitem>
392  </varlistentry>
393
394  <varlistentry><term>
395    <literal>set_apdufile</literal>
396    <replaceable>filename</replaceable>
397   </term>
398   <listitem>
399    <para>Sets that APDU should be logged to file
400     <replaceable>filename</replaceable>. Another way to achieve
401     APDU log is by using command-line option <literal>-a</literal>.
402    </para>
403   </listitem>
404  </varlistentry>
405
406  <varlistentry><term>
407    <literal>set_auto_reconnect</literal>
408    <replaceable>flag</replaceable>
409   </term>
410   <listitem>
411    <para>Specifies whether YAZ client automatically reconnect if
412     target closes connection (Z39.50 only).
413    </para>
414    <para>
415     <replaceable>flag</replaceable> must be either
416     <literal>on</literal> or <literal>off</literal>.
417    </para>
418   </listitem>
419  </varlistentry>
420
421  <varlistentry id="command-set-auto-wait"><term>
422    <literal>set_auto_wait</literal>
423    <replaceable>flag</replaceable>
424   </term>
425   <listitem>
426    <para>Specifies whether YAZ client should wait for
427    response protocol packages after a request.
428    By default YAZ client waits (on) for response packages immediately
429    after a command (find, show) has been issued. If <literal>off</literal>
430    is used, YAZ client does not attempt to receive packages automatically.
431    These will have to be manually received when command 
432    <link linkend="command-wait-response">
433     <literal>wait_response</literal>
434    </link> is used.
435    </para>
436    <para>
437    <replaceable>flag</replaceable> must be either
438    <literal>on</literal> or <literal>off</literal>.
439    </para>
440   </listitem>
441  </varlistentry>
442
443  <varlistentry><term>
444    <literal>set_marcdump</literal>
445    <replaceable>filename</replaceable>
446   </term>
447   <listitem>
448    <para>Specifies that all retrieved records should be appended to
449     file <replaceable>filename</replaceable>. This command does the
450     thing as option <literal>-m</literal>.
451    </para>
452   </listitem>
453  </varlistentry>
454
455  <varlistentry><term>
456    <literal>schema</literal>
457    <replaceable>schemaid</replaceable>
458   </term>
459   <listitem>
460    <para>Specifies schema for retrieval.
461     Schema may be specified as an OID for Z39.50.
462     For SRW, schema is a simple string URI.
463    </para>
464   </listitem>
465  </varlistentry>
466
467  <varlistentry id="command-charset"><term>
468    <literal>charset</literal>
469    <replaceable>negotiationcharset</replaceable>
470    [<replaceable>displaycharset</replaceable>]
471    [[<replaceable>marccharset</replaceable>]]
472   </term>
473   <listitem>
474    <para>Specifies character set (encoding) for Z39.50
475     negotiation / SRW encoding and/or character set for output (terminal).
476    </para>
477    <para>
478     <replaceable>negotiationcharset</replaceable> is the name
479     of the character set to be negotiated by the server. The special name
480     <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
481     specifies <emphasis>no</emphasis> character set to be negotiated.
482    </para>
483    <para>
484     If <replaceable>displaycharset</replaceable> is given, it specifies name
485     of the character set of the output (on the terminal on which
486     YAZ client is running). To disable conversion of characters
487     to the output encoding, the special name <literal>-</literal> (dash)
488     can be used.
489     If the special name <literal>auto</literal> is given, YAZ client will
490     convert strings to the encoding of the
491     terminal as returned by <function>nl_langinfo</function> call.
492    </para>
493    <para>
494     If <replaceable>marcharset</replaceable> is given, it specifies name
495     of the character set of retrieved MARC records from server. See
496     also <literal>marcharset</literal> command.
497    </para>
498    <note>
499     <para>
500      Since character set negotation takes effect in the Z39.50
501      Initialize Request you should issue this command before
502      command <link linkend="command-open"><literal>open</literal></link>
503      is used.
504     </para>
505    </note>
506    <note>
507     <para>
508      MARC records are not covered by Z39.50 character set negotiation,
509      so that's why there is a separate character that must be known
510      in order to do meaningful converson(s).
511     </para>
512    </note>
513   </listitem>
514  </varlistentry>
515
516  <varlistentry><term>
517    <literal>negcharset</literal>
518    <replaceable>charset</replaceable>
519   </term>
520   <listitem>
521    <para>Specifies character set for negotiation (Z39.50). The
522     argument is the same as second argument for command
523     <link linkend="command-charset"><literal>charset</literal></link>.
524    </para>
525   </listitem>
526  </varlistentry>
527
528  <varlistentry><term>
529    <literal>displaycharset</literal>
530    <replaceable>charset</replaceable>
531   </term>
532   <listitem>
533    <para>Specifies character set for output (display). The
534     argument is the same as second argument for command 
535     <link linkend="command-charset"><literal>charset</literal></link>.
536    </para>
537   </listitem>
538  </varlistentry>
539
540  <varlistentry><term>
541    <literal>marccharset</literal>
542    <replaceable>charset</replaceable>
543   </term>
544   <listitem>
545    <para>Specifies character set for retrieved MARC records so
546     that YAZ client can display them in a character suitable
547     for your display. See <literal>charset</literal> command.
548     If <literal>auto</literal> is given, YAZ will assume
549     that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
550     for all other MARC variants. The charset argument is the
551     same as third argument for command
552     <link linkend="command-charset"><literal>charset</literal></link>.
553    </para>
554   </listitem>
555  </varlistentry>
556
557  <varlistentry><term>
558    <literal>set_cclfile</literal>
559    <replaceable>filename</replaceable>
560   </term>
561   <listitem>
562    <para>Specifies that CCL fields should be read from file
563     file <replaceable>filename</replaceable>. This command does the
564     thing as option <literal>-c</literal>.
565    </para>
566   </listitem>
567  </varlistentry>
568
569  <varlistentry><term>
570    <literal>set_cqlfile</literal>
571    <replaceable>filename</replaceable>
572   </term>
573   <listitem>
574    <para>Specifies that CQL fields should be read from file
575     file <replaceable>filename</replaceable>. This command does the
576     thing as option <literal>-q</literal>.
577    </para>
578   </listitem>
579  </varlistentry>
580
581  <varlistentry><term>
582    <literal>register_oid</literal>
583    <replaceable>name</replaceable>
584    <replaceable>class</replaceable>
585    <replaceable>OID</replaceable>
586   </term>
587   <listitem>
588    <para>This command allows you to register your own object
589     identifier - so that instead of entering a long dot-notation
590     you can use a short name instead.
591     The <replaceable>name</replaceable> is your
592     name for the OID, <replaceable>class</replaceable> is the
593     class, and <replaceable>OID</replaceable> is the raw OID in
594     dot notation. Class is one <literal>appctx</literal>,
595     <literal>absyn</literal>, <literal>attet</literal>,
596     <literal>transyn</literal>, <literal>diagset</literal>,
597     <literal>recsyn</literal>, <literal>resform</literal>,
598     <literal>accform</literal>, <literal>extserv</literal>,
599     <literal>userinfo</literal>, <literal>elemspec</literal>,
600     <literal>varset</literal>, <literal>schema</literal>,
601     <literal>tagset</literal>, <literal>general</literal>.
602     If you're in doubt use the <literal>general</literal>
603     class.
604    </para>
605   </listitem>
606  </varlistentry>
607
608  <varlistentry><term>
609    <literal>register_tab</literal>
610    <replaceable>command</replaceable>
611    <replaceable>string</replaceable>
612   </term>
613   <listitem>
614    <para>This command registers a TAB completion string for
615     the command given.
616    </para>
617   </listitem>
618  </varlistentry>
619
620  <varlistentry><term>
621    <literal>sleep</literal>
622    <replaceable>seconds</replaceable>
623   </term>
624   <listitem>
625    <para>This command makes YAZ client sleep (be idle) for
626     the number of seconds given.
627    </para>
628   </listitem>
629  </varlistentry>
630
631  <varlistentry id="command-wait-response"><term>
632    <literal>wait_response</literal>
633    [ <replaceable>number</replaceable>]
634   </term>
635   <listitem>
636    <para>This command makes YAZ client wait for a number of
637     response packages from target. If <replaceable>number</replaceable> is
638     omitted, 1 is assumed. 
639    </para>
640    <para>This command is rarely used and is only useful if command
641     <link linkend="command-set-auto-wait">
642      <literal>set_auto_wait</literal>
643     </link> is set to off.
644    </para>
645   </listitem>
646  </varlistentry>
647
648  <varlistentry id="command-xmles"><term>
649    <literal>xmles</literal>
650    <replaceable>OID</replaceable>
651    <replaceable>doc</replaceable>
652   </term>
653   <listitem>
654    <para>Sends XML Extended Services request using the OID and doc given.
655    </para>
656   </listitem>
657  </varlistentry>
658
659  <varlistentry><term>
660    <literal>zversion</literal>
661    <replaceable>ver</replaceable>
662   </term>
663   <listitem>
664    <para>This command sets Z39.50 version for negotiation. 
665     Should be used before 
666     <link linkend="command-open"><literal>open</literal></link>.
667     By default 3 (version 3) is used.
668    </para>
669   </listitem>
670  </varlistentry>
671
672  <varlistentry><term>
673    <literal>options</literal>
674    <replaceable>op1 op2..</replaceable>
675   </term>
676   <listitem>
677    <para>This command sets Z39.50 options for negotiation. 
678     Should be used before 
679    <link linkend="command-open"><literal>open</literal></link>.
680    </para>
681    <para>
682     The following options are supported:
683     <literal>search</literal>,  
684     <literal>present</literal>,  
685     <literal>delSet</literal>,  
686     <literal>resourceReport</literal>,  
687     <literal>triggerResourceCtrl</literal>,  
688     <literal>resourceCtrl</literal>,  
689     <literal>accessCtrl</literal>,  
690     <literal>scan</literal>,  
691     <literal>sort</literal>,  
692     <literal>extendedServices</literal>,  
693     <literal>level_1Segmentation</literal>,  
694     <literal>level_2Segmentation</literal>,  
695     <literal>concurrentOperations</literal>,  
696     <literal>namedResultSets</literal>,  
697     <literal>encapsulation</literal>,  
698     <literal>resultCount</literal>,  
699     <literal>negotiationModel</literal>,  
700     <literal>duplicationDetection</literal>,  
701     <literal>queryType104</literal>,  
702     <literal>pQESCorrection</literal>,  
703     <literal>stringSchema</literal>.
704    </para>
705   </listitem>
706  </varlistentry>
707  
708 </variablelist>
709 <!-- Keep this Emacs mode comment at the end of the file
710 Local variables:
711 mode: nxml
712 End:
713 -->