UNPKG

node-zoom

Version:
1,322 lines (1,279 loc) 134 kB
<!--Generated by stripref.xsl . Do not edit--> <refentry id="yaz-client"> <refentryinfo> <productname class="trade">YAZ</productname> <productnumber>5.8.1</productnumber> <info><orgname>Index Data</orgname></info> </refentryinfo> <refmeta> <refentrytitle>yaz-client</refentrytitle> <manvolnum>1</manvolnum> <refmiscinfo class="manual">Commands</refmiscinfo> </refmeta> <refnamediv> <refname>yaz-client</refname> <refpurpose>Z39.50/SRU client for implementors</refpurpose> </refnamediv> <refsynopsisdiv> <cmdsynopsis sepchar=" "> <command moreinfo="none">yaz-client</command> <arg choice="opt" rep="norepeat"><option>-a <replaceable>apdulog</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-b <replaceable>berdump</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-c <replaceable>cclfile</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-d <replaceable>dump</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-f <replaceable>cmdfile</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-k <replaceable>size</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-m <replaceable>marclog</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-p <replaceable>proxy-addr</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-q <replaceable>cqlfile</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-t <replaceable>dispcharset</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-u <replaceable>auth</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-v <replaceable>loglevel</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-V</option></arg> <arg choice="opt" rep="norepeat"><option>-x</option></arg> <arg choice="opt" rep="norepeat">server-addr</arg> </cmdsynopsis> </refsynopsisdiv> <refsect1><title>DESCRIPTION</title> <para> <command moreinfo="none">yaz-client</command> is a <ulink url="http://www.loc.gov/z3950/agency/">Z39.50</ulink>/<ulink url="http://www.loc.gov/standards/sru/">SRU</ulink> client (origin) with a simple command line interface that allows you to test behavior and performance of Z39.50 targets and SRU servers. </para> <para> From YAZ version 4.1.0 <command moreinfo="none">yaz-client</command> may also operate as a <ulink url="http://lucene.apache.org/solr/">Solr</ulink> Web Service client. </para> <para> If the <replaceable>server-addr</replaceable> is specified, the client creates a connection to the Z39.50/SRU target at the address given. </para> <para> When <command moreinfo="none">yaz-client</command> is started it tries to read commands from one of the following files: <itemizedlist> <listitem><para> Command file if it is given by option -f. </para></listitem> <listitem><para> <filename moreinfo="none">.yazclientrc</filename> in current working directory. </para></listitem> <listitem><para> <filename moreinfo="none">.yazclientrc</filename> in the user's home directory. The value of the <literal moreinfo="none">HOME</literal> is used to determine the home directory. Normally, <literal moreinfo="none">HOME</literal> is only set on POSIX systems such as Linux, FreeBSD, Solaris. </para></listitem> </itemizedlist> </para> </refsect1> <refsect1> <title>OPTIONS</title> <variablelist> <varlistentry> <term>-a <replaceable>filename</replaceable></term> <listitem><para> If specified, logging of protocol packages will be appended file given. If <replaceable>filename</replaceable> is specified as <literal moreinfo="none">-</literal>, the output is written to <literal moreinfo="none">stdout</literal>. </para></listitem> </varlistentry> <varlistentry> <term>-b <replaceable>filename</replaceable></term> <listitem><para> If specified, YAZ will dump BER data in readable notation to the file specified. If <replaceable>filename</replaceable> is specified as <literal moreinfo="none">-</literal> the output is written to <literal moreinfo="none">stdout</literal>. </para></listitem> </varlistentry> <varlistentry> <term>-c <replaceable>filename</replaceable></term> <listitem><para> If specified, CCL configuration will be read from the file given. </para></listitem> </varlistentry> <varlistentry> <term>-d <replaceable>dump</replaceable></term> <listitem><para> If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named <replaceable>dump</replaceable>.DDD.<literal moreinfo="none">raw</literal>, where DDD is 001, 002, 003, .. </para></listitem> </varlistentry> <varlistentry> <term>-f <replaceable>cmdfile</replaceable></term> <listitem><para> Reads commands from <replaceable>cmdfile</replaceable>. When this option is used, YAZ client does not read .yazclientrc from current directory or home directory. </para></listitem> </varlistentry> <varlistentry> <term>-k <replaceable>size</replaceable></term> <listitem><para> Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 65536 (64 MB). </para></listitem> </varlistentry> <varlistentry> <term>-m <replaceable>filename</replaceable></term> <listitem><para> If specified, retrieved records will be appended to the file given. </para></listitem> </varlistentry> <varlistentry> <term>-p <replaceable>proxy-addr</replaceable></term> <listitem><para> If specified, the client will use the proxy at the address given. YAZ client will connect to a proxy on the address and port given. The actual target will be specified as part of the InitRequest to inform the proxy about actual target. </para></listitem> </varlistentry> <varlistentry> <term>-q <replaceable>filename</replaceable></term> <listitem><para> If specified, CQL configuration will be read from the file given. </para></listitem> </varlistentry> <varlistentry> <term>-t <replaceable>displaycharset</replaceable></term> <listitem><para> If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). </para></listitem> </varlistentry> <varlistentry> <term>-u <replaceable>auth</replaceable></term> <listitem><para> If specified, the <replaceable>auth</replaceable> string will be used for authentication. </para></listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">-v</literal> <replaceable>level</replaceable> </term><listitem> <simpara>Sets the LOG level to <replaceable>level</replaceable>. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of <literal moreinfo="none">fatal</literal>, <literal moreinfo="none">debug</literal>, <literal moreinfo="none">warn</literal>, <literal moreinfo="none">log</literal>, <literal moreinfo="none">malloc</literal>, <literal moreinfo="none">all</literal>, <literal moreinfo="none">none</literal>. </simpara></listitem> </varlistentry> <varlistentry> <term>-V</term> <listitem><para> Prints YAZ version. </para></listitem> </varlistentry> <varlistentry> <term>-x</term> <listitem><para> Makes the YAZ client print hex dumps of packages sent and received on standard output. </para></listitem> </varlistentry> </variablelist> </refsect1> <refsect1> <title>COMMANDS</title> <para> The YAZ client accepts the following commands. </para> <variablelist> <varlistentry id="command-open"><term> <literal moreinfo="none">open </literal><replaceable>zurl</replaceable> </term> <listitem> <para>Opens a connection to a server. The syntax for <replaceable>zurl</replaceable> is the same as described above for connecting from the command line. </para> <para> Syntax: </para> <para> [<literal moreinfo="none">(tcp|ssl|unix|http)':'</literal>]<replaceable>host</replaceable> [:<replaceable>port</replaceable>][/<replaceable>base</replaceable>] </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">quit</literal> </term> <listitem> <para>Quits YAZ client</para> </listitem> </varlistentry> <varlistentry id="command-find"><term> <literal moreinfo="none">find </literal><replaceable>query</replaceable></term> <listitem> <para>Sends a Search Request using the <replaceable>query</replaceable> given. By default the query is assumed to be PQF. See command <link linkend="command-querytype">querytype</link> for more information. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">delete</literal> <replaceable>setname</replaceable></term> <listitem> <para>Deletes result set with name <replaceable>setname</replaceable> on the server.</para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">base </literal><replaceable>base1</replaceable> <replaceable>base2</replaceable> ... </term> <listitem> <para>Sets the name(s) of the database(s) to search. One or more databases may be specified separated by blanks. This commands overrides the database given in <replaceable>zurl</replaceable>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">show </literal> [<replaceable>start</replaceable>[+<replaceable>number</replaceable>]] </term> <listitem> <para>Fetches records by sending a Present Request from the start position given by <replaceable>start</replaceable> a number of records given by <replaceable>number</replaceable>. If <replaceable>start</replaceable> is not given, then the client will fetch from position of the last retrieved record plus 1. If <replaceable>number</replaceable> is not given, then one record will be fetched at a time. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">scan</literal> <replaceable>term</replaceable> </term> <listitem> <simpara>Scans database index for a term. The syntax resembles the syntax for <link linkend="command-find"><literal moreinfo="none">find</literal></link>. If you want to scan for the word <literal moreinfo="none">water</literal> you could write </simpara> <screen format="linespecific"> scan water </screen> <simpara> but if you want to scan only in, say the title field, you would write </simpara> <screen format="linespecific"> scan @attr 1=4 water </screen> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">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 moreinfo="none">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 moreinfo="none">sort</literal> <replaceable>sortspecs</replaceable> </term> <listitem> <para>Sorts a result set. The sort command takes a 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 moreinfo="none">=</literal> it is assumed that the <literal moreinfo="none">SortKey</literal> is of type <literal moreinfo="none">sortAttributes</literal> using Bib-1: in this case the integer before <literal moreinfo="none">=</literal> is the attribute type and the integer following <literal moreinfo="none">=</literal> is the attribute value. If no <literal moreinfo="none">=</literal> character is in the criterion, it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of <literal moreinfo="none">s</literal> for case sensitive or <literal moreinfo="none">i</literal> for case insensitive, and <literal moreinfo="none">&lt;</literal> for ascending order or <literal moreinfo="none">&gt;</literal> for descending order. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">sort+</literal> </term> <listitem> <para>Same as <literal moreinfo="none">sort</literal> but stores the sorted result set in a new result set. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">authentication</literal> <replaceable>openauth</replaceable> </term> <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 <link linkend="command-open"><literal moreinfo="none">open</literal></link> command is issued and the Z39.50 Initialize Request is sent, so this command must be used before <literal moreinfo="none">open</literal> in order to be effective. A common convention for the <replaceable>authopen</replaceable> string is that the username - and password is separated by a slash, e.g. <literal moreinfo="none">myusername/mysecret</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">sru</literal> <replaceable>method</replaceable> <replaceable>version</replaceable> </term> <listitem> <para>Selects Web Service method and version. Must be one of <literal moreinfo="none">post</literal>, <literal moreinfo="none">get</literal>, <literal moreinfo="none">soap</literal> (default) or <literal moreinfo="none">solr</literal>. Version should be either 1.1, 1.2 or 2.0 for SRU. Other versions are allowed - for testing purposes (version negotiation with SRU server). The version is currently not used for Solr Web Services </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">list_all</literal> </term> <listitem> <para>This command displays status and values for many settings. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">lslb</literal> <replaceable>n</replaceable> </term> <listitem> <para>Sets the limit for when no records should be returned together with the search result. See the <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6"> Z39.50 standard on set bounds </ulink> for more details. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">ssub</literal> <replaceable>n</replaceable> </term> <listitem> <para>Sets the limit for when all records should be returned with the search result. See the <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6"> Z39.50 standard on set bounds </ulink> for more details. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">mspn</literal> <replaceable>n</replaceable> </term> <listitem> <para>Sets the number of records should be returned if the number of records in the result set is between the values of <literal moreinfo="none">lslb</literal> and <literal moreinfo="none">ssub</literal>. See the <ulink url="http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6"> Z39.50 standard on set bounds </ulink> for more details. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">status</literal> </term> <listitem> <para>Displays the values of <literal moreinfo="none">lslb</literal>, <literal moreinfo="none">ssub</literal> and <literal moreinfo="none">mspn</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">setname</literal> </term> <listitem> <para>Switches named result sets on and off. Default is on. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">cancel</literal> </term> <listitem> <para>Sends a Trigger Resource Control Request to the target. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">format</literal> <replaceable>oid</replaceable> </term> <listitem> <para>Sets the preferred transfer syntax for retrieved records. yaz-client supports all the record syntaxes that currently are registered. See <ulink url="http://www.loc.gov/z3950/agency/defns/oids.html#5"> Z39.50 Record Syntax Identifiers </ulink> for more details. Commonly used records syntaxes include usmarc, sutrs and xml. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">elements</literal> <replaceable>e</replaceable> </term> <listitem> <para>Sets the element set name for the records. Many targets support element sets are B (for brief) and F (for full). </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">close</literal> </term> <listitem> <para>Sends a Z39.50 Close APDU and closes connection with the peer </para> </listitem> </varlistentry> <varlistentry id="command-querytype"><term> <literal moreinfo="none">querytype</literal> <replaceable>type</replaceable> </term> <listitem> <para>Sets the query type as used by command <link linkend="command-find"><literal moreinfo="none">find</literal></link>. The following is supported: <literal moreinfo="none">prefix</literal> for <link linkend="PQF">Prefix Query Notation</link> (Type-1 Query); <literal moreinfo="none">ccl</literal> for CCL search (Type-2 Query), <literal moreinfo="none">cql</literal> for CQL (Type-104 search with CQL OID), <literal moreinfo="none">ccl2rpn</literal> for <link linkend="CCL">CCL</link> to RPN conversion (Type-1 Query). <literal moreinfo="none">cql2rpn</literal> for CQL to RPN conversion (Type-1 Query). </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">attributeset</literal> <replaceable>set</replaceable> </term> <listitem> <para> Sets attribute set OID for prefix queries (RPN, Type-1). </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">refid</literal> <replaceable>id</replaceable> </term> <listitem> <para>Sets reference ID for Z39.50 Request(s). </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">itemorder</literal> <replaceable>type</replaceable> <replaceable>no</replaceable> </term> <listitem> <para>Sends an Item Order Request using the ILL External. <replaceable>type</replaceable> is either 1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The <replaceable>no</replaceable> is the Result Set position of the record to be ordered. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">update</literal> <replaceable>action</replaceable> <replaceable>recid</replaceable> <replaceable>doc</replaceable> </term> <listitem> <para>Sends Item Update Request. The <replaceable>action</replaceable> argument must be the action type: one of <literal moreinfo="none">insert</literal>, <literal moreinfo="none">replace</literal>, <literal moreinfo="none">delete</literal> and <literal moreinfo="none">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 moreinfo="none">source</literal> <replaceable>filename</replaceable> </term> <listitem> <para>Executes list of commands from file <replaceable>filename</replaceable>, just like source on most UNIX shells. A single dot (<literal moreinfo="none">.</literal>) can be used as an alternative. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">!</literal> <replaceable>args</replaceable> </term> <listitem> <para>Executes command <replaceable>args</replaceable> in subshell using the <literal moreinfo="none">system</literal> call. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">push_command</literal> <replaceable>command</replaceable> </term> <listitem> <para>The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed. This command only works if you have GNU readline/history enabled. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">set_apdufile</literal> <replaceable>filename</replaceable> </term> <listitem> <para>Sets that APDU should be logged to file <replaceable>filename</replaceable>. Another way to achieve APDU log is by using command-line option <literal moreinfo="none">-a</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">on</literal> or <literal moreinfo="none">off</literal>. </para> </listitem> </varlistentry> <varlistentry id="command-set-auto-wait"><term> <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">wait_response</literal> </link> is used. </para> <para> <replaceable>flag</replaceable> must be either <literal moreinfo="none">on</literal> or <literal moreinfo="none">off</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">set_marcdump</literal> <replaceable>filename</replaceable> </term> <listitem> <para>Specifies that all retrieved records should be appended to file <replaceable>filename</replaceable>. This command does the thing as option <literal moreinfo="none">-m</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">-</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 moreinfo="none">-</literal> (dash) can be used. If the special name <literal moreinfo="none">auto</literal> is given, YAZ client will convert strings to the encoding of the terminal as returned by <function moreinfo="none">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 moreinfo="none">marcharset</literal> command. </para> <note> <para> Since character set negotiation takes effect in the Z39.50 Initialize Request you should issue this command before command <link linkend="command-open"><literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">charset</literal></link>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">charset</literal></link>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">charset</literal> command. If <literal moreinfo="none">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 moreinfo="none">charset</literal></link>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">set_cclfile</literal> <replaceable>filename</replaceable> </term> <listitem> <para>Specifies that CCL fields should be read from file file <replaceable>filename</replaceable>. This command does the thing as option <literal moreinfo="none">-c</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">-q</literal>. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">register_oid</literal> <replaceable>name</replaceable> <replaceable>class</replaceable> <replaceable>OID</replaceable> </term> <listitem> <para>This command allows you to register your own object identifier - so that instead of entering a long dot-notation you can use a short name instead. The <replaceable>name</replaceable> is your name for the OID, <replaceable>class</replaceable> is the class, and <replaceable>OID</replaceable> is the raw OID in dot notation. Class is one <literal moreinfo="none">appctx</literal>, <literal moreinfo="none">absyn</literal>, <literal moreinfo="none">attet</literal>, <literal moreinfo="none">transyn</literal>, <literal moreinfo="none">diagset</literal>, <literal moreinfo="none">recsyn</literal>, <literal moreinfo="none">resform</literal>, <literal moreinfo="none">accform</literal>, <literal moreinfo="none">extserv</literal>, <literal moreinfo="none">userinfo</literal>, <literal moreinfo="none">elemspec</literal>, <literal moreinfo="none">varset</literal>, <literal moreinfo="none">schema</literal>, <literal moreinfo="none">tagset</literal>, <literal moreinfo="none">general</literal>. If you're in doubt use the <literal moreinfo="none">general</literal> class. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">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 moreinfo="none">set_auto_wait</literal> </link> is set to off. </para> </listitem> </varlistentry> <varlistentry id="command-xmles"><term> <literal moreinfo="none">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 moreinfo="none">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 moreinfo="none">open</literal></link>. By default 3 (version 3) is used. </para> </listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">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 moreinfo="none">open</literal></link>. </para> <para> The following options are supported: <literal moreinfo="none">search</literal>, <literal moreinfo="none">present</literal>, <literal moreinfo="none">delSet</literal>, <literal moreinfo="none">resourceReport</literal>, <literal moreinfo="none">triggerResourceCtrl</literal>, <literal moreinfo="none">resourceCtrl</literal>, <literal moreinfo="none">accessCtrl</literal>, <literal moreinfo="none">scan</literal>, <literal moreinfo="none">sort</literal>, <literal moreinfo="none">extendedServices</literal>, <literal moreinfo="none">level_1Segmentation</literal>, <literal moreinfo="none">level_2Segmentation</literal>, <literal moreinfo="none">concurrentOperations</literal>, <literal moreinfo="none">namedResultSets</literal>, <literal moreinfo="none">encapsulation</literal>, <literal moreinfo="none">resultCount</literal>, <literal moreinfo="none">negotiationModel</literal>, <literal moreinfo="none">duplicationDetection</literal>, <literal moreinfo="none">queryType104</literal>, <literal moreinfo="none">pQESCorrection</literal>, <literal moreinfo="none">stringSchema</literal>. </para> </listitem> </varlistentry> </variablelist> </refsect1> <refsect1><title>EXAMPLE</title> <para> The simplest example of a Prefix Query would be something like <screen format="linespecific"> f knuth </screen> or <screen format="linespecific"> f "donald knuth" </screen> In those queries no attributes was specified. This leaves it up to the server what fields to search but most servers will search in all fields. Some servers does not support this feature though, and require that some attributes are defined. To add one attribute you could do: <screen format="linespecific"> f @attr 1=4 computer </screen> where we search in the title field, since the use(1) is title(4). If we want to search in the author field <emphasis>and</emphasis> in the title field, and in the title field using right truncation it could look something like this: <screen format="linespecific"> f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer </screen> Finally using a mix of Bib-1 and GILS attributes could look something like this: <screen format="linespecific"> f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather </screen> </para> </refsect1> <refsect1><title>FILES</title> <para> <filename moreinfo="none">yaz-&lt;version&gt;/client/client.c</filename> </para> <para> <filename moreinfo="none">$HOME/.yazclientrc</filename> </para> <para> <filename moreinfo="none">$HOME/.yazclient.history</filename> </para> </refsect1> <refsect1><title>SEE ALSO</title> <para> <citerefentry> <refentrytitle>yaz</refentrytitle> <manvolnum>7</manvolnum> </citerefentry> <citerefentry> <refentrytitle>bib1-attr</refentrytitle> <manvolnum>7</manvolnum> </citerefentry> </para> </refsect1> </refentry> <!--Generated by stripref.xsl . Do not edit--> <refentry id="yaz-ztest"> <refentryinfo> <productname class="trade">YAZ</productname> <productnumber>5.8.1</productnumber> <info><orgname>Index Data</orgname></info> </refentryinfo> <refmeta> <refentrytitle>yaz-ztest</refentrytitle> <manvolnum>8</manvolnum> <refmiscinfo class="manual">System management commands</refmiscinfo> </refmeta> <refnamediv> <refname>yaz-ztest</refname> <refpurpose>Z39.50/SRU Test Server</refpurpose> </refnamediv> <refsynopsisdiv> <!-- cmd description of YAZ GFS application. Included in both manual and man page for yaz-ztest --> <cmdsynopsis sepchar=" "> <command moreinfo="none">application</command> <arg choice="opt" rep="norepeat"><option>-install</option></arg> <arg choice="opt" rep="norepeat"><option>-installa</option></arg> <arg choice="opt" rep="norepeat"><option>-remove</option></arg> <arg choice="opt" rep="norepeat"><option>-a <replaceable>file</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-v <replaceable>level</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-l <replaceable>file</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-u <replaceable>uid</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-c <replaceable>config</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-f <replaceable>vconfig</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-C <replaceable>fname</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-t <replaceable>minutes</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-k <replaceable>kilobytes</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-K</option></arg> <arg choice="opt" rep="norepeat"><option>-d <replaceable>daemon</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-w <replaceable>dir</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-p <replaceable>pidfile</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-r <replaceable>kilobytes</replaceable></option></arg> <arg choice="opt" rep="norepeat"><option>-ziDSTV1</option></arg> <arg choice="opt" rep="repeat">listener-spec</arg> </cmdsynopsis> <!-- Keep this comment at the end of the file Local variables: mode: nxml nxml-child-indent: 1 End: --> </refsynopsisdiv> <refsect1><title>DESCRIPTION</title> <para> <command moreinfo="none">yaz-ztest</command> is a Z39.50/SRU test server that uses the YAZ generic frontend server (GFS) API. The server acts as a real Z39.50/SRU server but does not use a database. It returns a random hit count and returns a subset of a few built-in records. </para> <para> The <replaceable>listener-spec</replaceable> consists of a transport mode followed by a colon, followed by a listener address. The transport mode is either <literal moreinfo="none">tcp</literal>, <literal moreinfo="none">unix</literal>, or <literal moreinfo="none">ssl</literal>. </para> <para> For TCP and SSL, an address has the form: <screen format="linespecific"> hostname | IP-number [ : portnumber ] </screen> </para> <para> For UNIX local socket the address is the filename of the local socket. </para> </refsect1> <refsect1> <title>OPTIONS</title> <!-- Options for generic frontend server and yaz-ztest. Included in both manual and man page for yaz-ztest --> <variablelist> <varlistentry> <term><literal moreinfo="none">-a </literal> <replaceable>file</replaceable></term> <listitem><para> Specify a file for dumping PDUs (for diagnostic purposes). The special name <literal moreinfo="none">-</literal> (dash) sends output to <literal moreinfo="none">stderr</literal>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-S</literal></term> <listitem><para> Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-1</literal></term> <listitem><para> Like <literal moreinfo="none">-S</literal> but after one session the server exits. This mode is for debugging <emphasis>only</emphasis>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-T</literal></term> <listitem><para> Operate the server in threaded mode. The server creates a thread for each connection rather than a fork a process. Only available on UNIX systems that offers POSIX threads. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-s</literal></term> <listitem><para> Use the SR protocol (obsolete). </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-z</literal></term> <listitem><para> Use the Z39.50 protocol (default). This option and <literal moreinfo="none">-s</literal> complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-l </literal><replaceable>file</replaceable></term> <listitem><para>The logfile. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-c </literal><replaceable>config</replaceable></term> <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 moreinfo="none">configname</literal> of the <literal moreinfo="none">statserv_options_block</literal>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-f </literal><replaceable>vconfig</replaceable></term> <listitem><para>This specifies an XML file that describes one or more YAZ frontend virtual servers. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-C </literal><replaceable>fname</replaceable></term> <listitem><para>Sets SSL certificate file name for server (PEM). </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-v </literal><replaceable>level</replaceable></term> <listitem><para> The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-u </literal><replaceable>uid</replaceable></term> <listitem><para> Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-w </literal><replaceable>dir</replaceable></term> <listitem><para> The server changes to this directory during before listening on incoming connections. This option is useful when the server is operating from the <application moreinfo="none">inetd</application> daemon (see <literal moreinfo="none">-i</literal>). </para></listitem> </varlistentry> <varlistentry><term> <literal moreinfo="none">-p </literal><replaceable>pidfile</replaceable> </term> <listitem><para> Specifies that the server should write its Process ID to file given by <replaceable>pidfile</replaceable>. A typical location would be <filename moreinfo="none">/var/run/yaz-ztest.pid</filename>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-i</literal></term> <listitem><para> Use this to make the the server run from the <application moreinfo="none">inetd</application> server (UNIX only). </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-D</literal></term> <listitem><para> Use this to make the server put itself in the background and run as a daemon. If neither <literal moreinfo="none">-i</literal> nor <literal moreinfo="none">-D</literal> is given, the server starts in the foreground. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-install</literal></term> <listitem><para> Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-installa</literal></term> <listitem><para> Use this to install the server as an NT service and mark it as "auto-start. Control the server by going to the Services in the Control Panel. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-remove</literal></term> <listitem><para> Use this to remove the server from the NT services (Windows NT/2000/XP only). </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-t </literal><replaceable>minutes</replaceable></term> <listitem><para> Idle session timeout, in minutes. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-k </literal><replaceable>size</replaceable></term> <listitem><para> Maximum record size/message size, in kilobytes. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-K</literal></term> <listitem><para> Forces no-keepalive for HTTP sessions. By default GFS will keep sessions alive for HTTP 1.1 sessions (as defined by the standard). Using this option will force GFS to close the connection for each operation. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-r </literal><replaceable>size</replaceable></term> <listitem><para> Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB). </para></listitem> </varlistentry> <varlistentry> <term> <literal moreinfo="none">-d </literal><replaceable>daemon</replaceable> </term> <listitem><para> Set name of daemon to be used in hosts access file. See <citerefentry> <refentrytitle>hosts_access</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> and <citerefentry> <refentrytitle>tcpd</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-m </literal><replaceable>time-format</replaceable></term> <listitem><para> Sets the format of time-stamps in the log-file. Specify a string in the input format to <literal moreinfo="none">strftime()</literal>. </para></listitem> </varlistentry> <varlistentry> <term><literal moreinfo="none">-V </literal></term> <listitem><para> Display YAZ version and exit. </para></listitem> </varlistentry> </variablelist> <!-- Keep this comment at the end of the file Local variables: mode: nxml nxml-child-indent: 1 End: --> </refsect1> <refsect1> <title>TESTING</title> <para> <command moreinfo="none">yaz-ztest</command> normally returns a random hit count between 0 and 24. However, if a query term includes leading digits, then the integer value of that term is used as hit count. This allows testers to return any number of hits. <command moreinfo="none">yaz-ztest</command> includes 24 MARC records for testing. Hit counts exceeding 24 will make <command moreinfo="none">yaz-ztest</command> return the same record batch over and over.. So record at position 1, 25, 49, etc .. are equivalent. </para> <para> For XML if no element set is given or element has value "marcxml", MARCXML is returned (each of the 24 dummy records converted from ISO2709 to XML). For element set OP, OPAC XML is returned. </para> <para> yaz-ztes