Bug #600: SRU GET, POST support for yaz-client. Introduced
[yaz-moved-to-github.git] / doc / yaz-client-commands.xml
1 <!-- 
2    $Id: yaz-client-commands.xml,v 1.15 2006-06-02 13:12:54 adam 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>sru</literal> <replaceable>method</replaceable>
179   </term>
180   <listitem>
181    <para>Selects SRU method. Must be one of <literal>POST</literal>,
182     <literal>GET</literal>, <literal>SOAP</literal> (default).
183    </para>
184   </listitem>
185  </varlistentry>
186
187  <varlistentry><term>
188    <literal>list_all</literal>
189   </term>
190   <listitem>
191    <para>This command displays status and values for many settings.
192    </para>
193   </listitem>
194  </varlistentry>
195  
196  <varlistentry><term>
197    <literal>lslb</literal> <replaceable>n</replaceable>
198   </term>
199   <listitem>
200    <para>Sets the limit for when no records should be returned
201     together with the search result.
202     See the
203     <ulink
204      url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
205      Z39.50 standard
206     </ulink>
207     for more details.
208    </para>
209   </listitem>
210  </varlistentry>
211
212  <varlistentry><term>
213    <literal>ssub</literal> <replaceable>n</replaceable>
214   </term>
215   <listitem>
216    <para>Sets the limit for when all records should be returned with
217     the search result.
218     See the
219     <ulink
220      url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
221      Z39.50 standard
222     </ulink> for more details.
223    </para>
224   </listitem>
225  </varlistentry>
226  
227  <varlistentry><term>
228    <literal>mspn</literal> <replaceable>n</replaceable>
229   </term>
230   <listitem>
231    <para>Sets the number of records should be returned if the
232     number of records in the result set is between the values of
233     <literal>lslb</literal> and <literal>ssub</literal>.
234     See the
235     <ulink
236      url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6">
237      Z39.50 standard
238     </ulink>
239     for more details.
240    </para>
241   </listitem>
242  </varlistentry>
243  <varlistentry><term>
244    <literal>status</literal>
245   </term>
246   <listitem>
247    <para>Displays the values of <literal>lslb</literal>,
248     <literal>ssub</literal> and <literal>mspn</literal>.
249    </para>
250   </listitem>
251  </varlistentry>
252  <varlistentry><term>
253    <literal>setname</literal>
254   </term>
255   <listitem>
256    <para>Switches named result sets on and off. Default is on.
257    </para>
258   </listitem>
259  </varlistentry>
260  <varlistentry><term>
261    <literal>cancel</literal>
262   </term>
263   <listitem>
264    <para>Sends a Trigger Resource Control Request to the target.
265    </para>
266   </listitem>
267  </varlistentry>
268  <varlistentry><term>
269    <literal>format</literal> <replaceable>oid</replaceable>
270   </term>
271   <listitem>
272    <para>Sets the preferred transfer syntax for retrieved records.
273     yaz-client supports all the record syntaxes that currently
274     are registered. See
275     <ulink
276      url="http://www.loc.gov/z3950/agency/defns/oids.html#5">
277      Z39.50 Standard
278     </ulink>
279     for more details. Commonly used records syntaxes include usmarc,
280     sutrs, grs1 and xml.
281    </para>
282   </listitem>
283  </varlistentry>
284  <varlistentry><term>
285    <literal>elements</literal> <replaceable>e</replaceable>
286   </term>
287   <listitem>
288    <para>Sets the element set name for the records. Many targets support
289     element sets are B (for brief) and F (for full).
290    </para>
291   </listitem>
292  </varlistentry>
293  <varlistentry><term>
294    <literal>close</literal>
295   </term>
296   <listitem>
297    <para>Sends a Z39.50 Close APDU and closes connection with the peer
298    </para>
299   </listitem>
300  </varlistentry>
301  <varlistentry id="command-querytype"><term>
302    <literal>querytype</literal> <replaceable>type</replaceable>
303   </term>
304   <listitem>
305    <para>Sets the query type as used by command 
306    <link linkend="command-find"><literal>find</literal></link>.
307     The following is supported:
308     <literal>prefix</literal> for
309         <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query);
310     <literal>ccl</literal> for CCL search (Type-2 Query),
311     <literal>cql</literal> for CQL (Type-104 search with CQL OID),
312     <literal>ccl2rpn</literal> for
313         <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query).
314     <literal>cql2rpn</literal> for
315         CQL to RPN conversion (Type-1 Query).
316    </para>
317   </listitem>
318  </varlistentry>
319  <varlistentry><term>
320    <literal>attributeset</literal> <replaceable>set</replaceable>
321   </term>
322   <listitem>
323    <para>
324     Sets attribute set OID for prefix queries (RPN, Type-1).
325    </para>
326   </listitem>
327  </varlistentry>
328  <varlistentry><term>
329    <literal>refid</literal> <replaceable>id</replaceable>
330   </term>
331   <listitem>
332    <para>Sets reference ID for Z39.50 Request(s).
333    </para>
334   </listitem>
335  </varlistentry>
336  <varlistentry><term>
337    <literal>itemorder</literal>
338    <replaceable>type</replaceable> <replaceable>no</replaceable>
339   </term>
340   <listitem>
341    <para>Sends an Item Order Request using the ILL External. 
342     <replaceable>type</replaceable> is either 1 or 2 which corresponds to
343     ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable>
344     is the Result Set position of the record to be ordered.
345    </para>
346   </listitem>
347  </varlistentry>
348  <varlistentry><term>
349    <literal>update</literal>
350    <replaceable>action</replaceable>
351    <replaceable>recid</replaceable>
352    <replaceable>doc</replaceable>
353   </term>
354   <listitem>
355    <para>Sends Item Update Request. The <replaceable>action</replaceable>
356     argument must be the action type: one of <literal>insert</literal>,
357     <literal>replace</literal>, <literal>delete</literal> and
358     <literal>update</literal>. The second argument, 
359     <replaceable>recid</replaceable>, is the
360     record identifier (any string). Third argument which is optional is
361     the record document for the request. If doc is a quoted string
362     (double quotes) the string content is used verbatim. If doc is not
363     a quoted string, it is assumed to be a filename which is read, then
364     sent as the docuemnt content. If doc is omitted, the last received
365     record (as parf of present response or piggybacked search response) 
366     is used for the update.
367    </para>
368   </listitem>
369  </varlistentry>
370
371  <varlistentry><term>
372    <literal>.</literal>
373    <replaceable>filename</replaceable>
374   </term>
375   <listitem>
376    <para>Executes list of commands from
377     file <replaceable>filename</replaceable>, just like source on
378     most UNIX shells.
379    </para>
380   </listitem>
381  </varlistentry>
382
383  <varlistentry><term>
384    <literal>!</literal>
385    <replaceable>args</replaceable>
386   </term>
387   <listitem>
388    <para>Executes command <replaceable>args</replaceable> in subshell
389     using the <literal>system</literal> call.
390    </para>
391   </listitem>
392  </varlistentry>
393
394  <varlistentry><term>
395    <literal>push_command</literal>
396    <replaceable>command</replaceable>
397   </term>
398   <listitem>
399    <para>The push_command takes another command as its argument.
400     That command is then added to the history information (so
401     you can retrieve it later). The command itself is not
402     executed. This command only works if you have GNU readline/history
403     enabled.
404    </para>
405   </listitem>
406  </varlistentry>
407
408  <varlistentry><term>
409    <literal>set_apdufile</literal>
410    <replaceable>filename</replaceable>
411   </term>
412   <listitem>
413    <para>Sets that APDU should be logged to file
414     <replaceable>filename</replaceable>. Another way to achieve
415     APDU log is by using command-line option <literal>-a</literal>.
416    </para>
417   </listitem>
418  </varlistentry>
419
420  <varlistentry><term>
421    <literal>set_auto_reconnect</literal>
422    <replaceable>flag</replaceable>
423   </term>
424   <listitem>
425    <para>Specifies whether YAZ client automatically reconnect if
426     target closes connection (Z39.50 only).
427    </para>
428    <para>
429     <replaceable>flag</replaceable> must be either
430     <literal>on</literal> or <literal>off</literal>.
431    </para>
432   </listitem>
433  </varlistentry>
434
435  <varlistentry id="command-set-auto-wait"><term>
436    <literal>set_auto_wait</literal>
437    <replaceable>flag</replaceable>
438   </term>
439   <listitem>
440    <para>Specifies whether YAZ client should wait for
441    response protocol packages after a request.
442    By default YAZ client waits (on) for response packages immediately
443    after a command (find, show) has been issued. If <literal>off</literal>
444    is used, YAZ client does not attempt to receive packages automatically.
445    These will have to be manually received when command 
446    <link linkend="command-wait-response">
447     <literal>wait_response</literal>
448    </link> is used.
449    </para>
450    <para>
451    <replaceable>flag</replaceable> must be either
452    <literal>on</literal> or <literal>off</literal>.
453    </para>
454   </listitem>
455  </varlistentry>
456
457  <varlistentry><term>
458    <literal>set_marcdump</literal>
459    <replaceable>filename</replaceable>
460   </term>
461   <listitem>
462    <para>Specifies that all retrieved records should be appended to
463     file <replaceable>filename</replaceable>. This command does the
464     thing as option <literal>-m</literal>.
465    </para>
466   </listitem>
467  </varlistentry>
468
469  <varlistentry><term>
470    <literal>schema</literal>
471    <replaceable>schemaid</replaceable>
472   </term>
473   <listitem>
474    <para>Specifies schema for retrieval.
475     Schema may be specified as an OID for Z39.50.
476     For SRW, schema is a simple string URI.
477    </para>
478   </listitem>
479  </varlistentry>
480
481  <varlistentry id="command-charset"><term>
482    <literal>charset</literal>
483    <replaceable>negotiationcharset</replaceable>
484    [<replaceable>displaycharset</replaceable>]
485    [[<replaceable>marccharset</replaceable>]]
486   </term>
487   <listitem>
488    <para>Specifies character set (encoding) for Z39.50
489     negotiation / SRW encoding and/or character set for output (terminal).
490    </para>
491    <para>
492     <replaceable>negotiationcharset</replaceable> is the name
493     of the character set to be negotiated by the server. The special name
494     <literal>-</literal> for <replaceable>negotiationcharset</replaceable>
495     specifies <emphasis>no</emphasis> character set to be negotiated.
496    </para>
497    <para>
498     If <replaceable>displaycharset</replaceable> is given, it specifies name
499     of the character set of the output (on the terminal on which
500     YAZ client is running). To disable conversion of characters
501     to the output encoding, the special name <literal>-</literal> (dash)
502     can be used.
503     If the special name <literal>auto</literal> is given, YAZ client will
504     convert strings to the encoding of the
505     terminal as returned by <function>nl_langinfo</function> call.
506    </para>
507    <para>
508     If <replaceable>marcharset</replaceable> is given, it specifies name
509     of the character set of retrieved MARC records from server. See
510     also <literal>marcharset</literal> command.
511    </para>
512    <note>
513     <para>
514      Since character set negotation takes effect in the Z39.50
515      Initialize Request you should issue this command before
516      command <link linkend="command-open"><literal>open</literal></link>
517      is used.
518     </para>
519    </note>
520    <note>
521     <para>
522      MARC records are not covered by Z39.50 character set negotiation,
523      so that's why there is a separate character that must be known
524      in order to do meaningful converson(s).
525     </para>
526    </note>
527   </listitem>
528  </varlistentry>
529
530  <varlistentry><term>
531    <literal>negcharset</literal>
532    <replaceable>charset</replaceable>
533   </term>
534   <listitem>
535    <para>Specifies character set for negotiation (Z39.50). The
536     argument is the same as second argument for command
537     <link linkend="command-charset"><literal>charset</literal></link>.
538    </para>
539   </listitem>
540  </varlistentry>
541
542  <varlistentry><term>
543    <literal>displaycharset</literal>
544    <replaceable>charset</replaceable>
545   </term>
546   <listitem>
547    <para>Specifies character set for output (display). The
548     argument is the same as second argument for command 
549     <link linkend="command-charset"><literal>charset</literal></link>.
550    </para>
551   </listitem>
552  </varlistentry>
553
554  <varlistentry><term>
555    <literal>marccharset</literal>
556    <replaceable>charset</replaceable>
557   </term>
558   <listitem>
559    <para>Specifies character set for retrieved MARC records so
560     that YAZ client can display them in a character suitable
561     for your display. See <literal>charset</literal> command.
562     If <literal>auto</literal> is given, YAZ will assume
563     that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1
564     for all other MARC variants. The charset argument is the
565     same as third argument for command
566     <link linkend="command-charset"><literal>charset</literal></link>.
567    </para>
568   </listitem>
569  </varlistentry>
570
571  <varlistentry><term>
572    <literal>set_cclfile</literal>
573    <replaceable>filename</replaceable>
574   </term>
575   <listitem>
576    <para>Specifies that CCL fields should be read from file
577     file <replaceable>filename</replaceable>. This command does the
578     thing as option <literal>-c</literal>.
579    </para>
580   </listitem>
581  </varlistentry>
582
583  <varlistentry><term>
584    <literal>set_cqlfile</literal>
585    <replaceable>filename</replaceable>
586   </term>
587   <listitem>
588    <para>Specifies that CQL fields should be read from file
589     file <replaceable>filename</replaceable>. This command does the
590     thing as option <literal>-q</literal>.
591    </para>
592   </listitem>
593  </varlistentry>
594
595  <varlistentry><term>
596    <literal>register_oid</literal>
597    <replaceable>name</replaceable>
598    <replaceable>class</replaceable>
599    <replaceable>OID</replaceable>
600   </term>
601   <listitem>
602    <para>This command allows you to register your own object
603     identifier - so that instead of entering a long dot-notation
604     you can use a short name instead.
605     The <replaceable>name</replaceable> is your
606     name for the OID, <replaceable>class</replaceable> is the
607     class, and <replaceable>OID</replaceable> is the raw OID in
608     dot notation. Class is one <literal>appctx</literal>,
609     <literal>absyn</literal>, <literal>attet</literal>,
610     <literal>transyn</literal>, <literal>diagset</literal>,
611     <literal>recsyn</literal>, <literal>resform</literal>,
612     <literal>accform</literal>, <literal>extserv</literal>,
613     <literal>userinfo</literal>, <literal>elemspec</literal>,
614     <literal>varset</literal>, <literal>schema</literal>,
615     <literal>tagset</literal>, <literal>general</literal>.
616     If you're in doubt use the <literal>general</literal>
617     class.
618    </para>
619   </listitem>
620  </varlistentry>
621
622  <varlistentry><term>
623    <literal>register_tab</literal>
624    <replaceable>command</replaceable>
625    <replaceable>string</replaceable>
626   </term>
627   <listitem>
628    <para>This command registers a TAB completion string for
629     the command given.
630    </para>
631   </listitem>
632  </varlistentry>
633
634  <varlistentry><term>
635    <literal>sleep</literal>
636    <replaceable>seconds</replaceable>
637   </term>
638   <listitem>
639    <para>This command makes YAZ client sleep (be idle) for
640     the number of seconds given.
641    </para>
642   </listitem>
643  </varlistentry>
644
645  <varlistentry id="command-wait-response"><term>
646    <literal>wait_response</literal>
647    [ <replaceable>number</replaceable>]
648   </term>
649   <listitem>
650    <para>This command makes YAZ client wait for a number of
651     response packages from target. If <replaceable>number</replaceable> is
652     omitted, 1 is assumed. 
653    </para>
654    <para>This command is rarely used and is only useful if command
655     <link linkend="command-set-auto-wait">
656      <literal>set_auto_wait</literal>
657     </link> is set to off.
658    </para>
659   </listitem>
660  </varlistentry>
661
662  <varlistentry id="command-xmles"><term>
663    <literal>xmles</literal>
664    <replaceable>OID</replaceable>
665    <replaceable>doc</replaceable>
666   </term>
667   <listitem>
668    <para>Sends XML Extended Services request using the OID and doc given.
669    </para>
670   </listitem>
671  </varlistentry>
672
673  <varlistentry><term>
674    <literal>zversion</literal>
675    <replaceable>ver</replaceable>
676   </term>
677   <listitem>
678    <para>This command sets Z39.50 version for negotiation. 
679     Should be used before 
680     <link linkend="command-open"><literal>open</literal></link>.
681     By default 3 (version 3) is used.
682    </para>
683   </listitem>
684  </varlistentry>
685
686  <varlistentry><term>
687    <literal>options</literal>
688    <replaceable>op1 op2..</replaceable>
689   </term>
690   <listitem>
691    <para>This command sets Z39.50 options for negotiation. 
692     Should be used before 
693    <link linkend="command-open"><literal>open</literal></link>.
694    </para>
695    <para>
696     The following options are supported:
697     <literal>search</literal>,  
698     <literal>present</literal>,  
699     <literal>delSet</literal>,  
700     <literal>resourceReport</literal>,  
701     <literal>triggerResourceCtrl</literal>,  
702     <literal>resourceCtrl</literal>,  
703     <literal>accessCtrl</literal>,  
704     <literal>scan</literal>,  
705     <literal>sort</literal>,  
706     <literal>extendedServices</literal>,  
707     <literal>level_1Segmentation</literal>,  
708     <literal>level_2Segmentation</literal>,  
709     <literal>concurrentOperations</literal>,  
710     <literal>namedResultSets</literal>,  
711     <literal>encapsulation</literal>,  
712     <literal>resultCount</literal>,  
713     <literal>negotiationModel</literal>,  
714     <literal>duplicationDetection</literal>,  
715     <literal>queryType104</literal>,  
716     <literal>pQESCorrection</literal>,  
717     <literal>stringSchema</literal>.
718    </para>
719   </listitem>
720  </varlistentry>
721  
722 </variablelist>
723 <!-- Keep this comment at the end of the file
724 Local variables:
725 mode: sgml
726 sgml-omittag:t
727 sgml-shorttag:t
728 sgml-minimize-attributes:nil
729 sgml-always-quote-attributes:t
730 sgml-indent-step:1
731 sgml-indent-data:t
732 sgml-parent-document: "yaz.xml"
733 sgml-local-catalogs: nil
734 sgml-namecase-general:t
735 End:
736 -->