%local;
<!ENTITY % entities SYSTEM "entities.ent">
%entities;
- <!ENTITY % common SYSTEM "common/common.ent">
- %common;
+ <!ENTITY % idcommon SYSTEM "common/common.ent">
+ %idcommon;
]>
-<!-- $Id: pazpar2_protocol.xml,v 1.1 2007-01-12 14:54:58 adam Exp $ -->
+<!-- $Id: pazpar2_protocol.xml,v 1.8 2007-06-04 10:34:06 adam Exp $ -->
<refentry id="pazpar2_protocol">
<refentryinfo>
<productname>Pazpar2</productname>
<refsect1><title>DESCRIPTION</title>
<para>
Webservice requests are any that refer to filename "search.pz2". Arguments
- are GET-style parameters. Argument 'command' is required and specifies
- command. Any request not recognized as a webservice request as described,
- are forwarded to the HTTP server specified in option -p.
+ are GET-style parameters. Argument 'command' is always required and specifies
+ the operation to perform. Any request not recognized as a webservice
+ request is forwarded to the HTTP server specified in the configuration
+ using the proxy setting.
+ This way, a regular webserver can host the user interface (itself dynamic
+ or static HTML), and AJAX-style calls can be used from JS (or any other client-based
+ scripting environment) to interact with the search logic in pazpar2.
</para>
<para>
Each command is described in sub sections to follow.
<session>2044502273</session>
</init>
]]></screen>
+ <para>
+ The init command may take a number of setting parameters, similar to
+ the 'settings' command described below. These settings are immediately
+ applied to the new session.
+ </para>
</refsect2>
<refsect2 id="command-ping"><title>ping</title>
]]></screen>
</para>
</refsect2>
+ <refsect2 id="command-settings">
+ <title>settings</title>
+ <para>
+ The settings command applies session-specific settings to one or more
+ databases. A typical function of this is to enable access to
+ restricted resources for registered users, or to set a user- or
+ library-specific username/password to use against a target. Each
+ setting parameter has the form name[target]=value, where name is the
+ name of the setting (e.g. pz:authentication), target is a target ID,
+ or possibly a wildcard, and value is the desired value for the
+ setting.
+ </para>
+
+ <para>
+ Because the settings command manipulates potentially sensitive
+ information, it is possible to configure pazpar2 to only allow access
+ to this command from a trusted site -- usually from server-side
+ scripting, which in turn is responsible for authenticating the user,
+ and possibly determining which resources he has access to, etc.
+ </para>
+
+ <para>
+ Note: As a shortcut, it is also possible to override settings directly in
+ the init command.
+ </para>
+
+ <para>
+ Example:
+ <screen><![CDATA[
+ search.pz?command=settings&session=2044502273&pz:allow[search.com:210/db1]=1
+ ]]></screen>
+ Response:
+ <screen><![CDATA[
+<settings>
+ <status>OK</status>
+</settings>
+]]></screen>
+ </para>
+
+ </refsect2>
<refsect2 id="command-search"><title>search</title>
<para>
Launches a search, parameters:
<para>
Example:
<screen><![CDATA[
-search.pz2?session=2044502273&command=search&query=computer
+search.pz2?session=2044502273&command=search&query=computer+science
]]>
</screen>
Response:
<refsect2 id="command-stat">
<title>stat</title>
<para>
- Provides status of ongoing search. Parameters:
+ Provides status information about an ongoing search. Parameters:
<variablelist>
<varlistentry>
<stat>
<activeclients>3</activeclients>
<hits>7</hits> -- Total hitcount
- <records>7</records> -- Total number of records fetched
+ <records>7</records> -- Total number of records fetched in last query
<clients>1</clients> -- Total number of associated clients
<unconnected>0</unconnected> -- Number of disconnected clients
<connecting>0</connecting> -- Number of clients in connecting state
<term>block</term>
<listitem>
<para>
- If block is set, the command will hang until there are records ready
+ If block is set to 1, the command will hang until there are records ready
to display. Use this to show first records rapidly without
requiring rapid polling.
</para>
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>sort</term>
+ <listitem>
+ <para>
+ Specifies sort criteria. The argument is a comma-separated list
+ (no whitespace allowed) of sort fields, with the highest-priority
+ field first. A sort field may be followed by a colon followed by
+ the number '0' or '1', indicating whether results should be sorted in
+ increasing or decreasing order according to that field. 0==Decreasing is
+ the default.
+ </para>
+ </listitem>
+ </varlistentry>
+
</variablelist>
</para>
<para>
Example:
<screen><![CDATA[
-search.pz2?session=2044502273&command=show&start=0&num=2
+search.pz2?session=2044502273&command=show&start=0&num=2&sort=title:1
]]></screen>
Output:
<screen><![CDATA[
<show>
<status>OK</status>
- <activeclients>3</activeclients>
- <merged>6</merged>
- <total>7</total>
- <start>0</start>
- <num>2</num>
+ <activeclients>3</activeclients> -- How many clients are still working
+ <merged>6</merged> -- Number of merged records
+ <total>7</total> -- Total of all hitcounts
+ <start>0</start> -- The start number you requested
+ <num>2</num> -- Number of records retrieved
<hit>
<md-title>How to program a computer, by Jack Collins</md-title>
- <count>2</count> <!-- Number of merged records -->
- <recid>6</recid>
+ <count>2</count> -- Number of merged records
+ <recid>6</recid> -- Record ID for this record
</hit>
<hit>
<md-title>
<variablelist>
<varlistentry>
+ <term>session</term>
+ <listitem>
+ <para>
+ Session ID
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>id</term>
<listitem>
<para>
<screen><![CDATA[
<term>
<name>library2.mcmaster.ca</name>
- <frequency>11734</frequency>
- <state>Client_Idle</state>
- <diagnostic>0</diagnostic>
+ <frequency>11734</frequency> -- Number of hits
+ <state>Client_Idle</state> -- See the description of 'bytarget' below
+ <diagnostic>0</diagnostic> -- Z39.50 diagnostic codes
</term>
]]></screen>
</para>
</refsect2>
+
+ <refsect2 id="command-bytarget">
+ <title>bytarget</title>
+ <para>
+ Returns information about the status of each active client. Parameters:
+
+ <variablelist>
+ <varlistentry>
+ <term>session</term>
+ <listitem>
+ <para>
+ Session Id.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </para>
+ <para>
+ Example:
+ <screen><![CDATA[
+search.pz2?session=605047297&command=record&id=3
+]]></screen>
+
+ Example output:
+
+ <screen><![CDATA[
+<bytarget>
+ <status>OK</status>
+ <target>
+ <id>z3950.loc.gov/voyager/</id>
+ <hits>10000</hits>
+ <diagnostic>0</diagnostic>
+ <records>65</records>
+ <state>Client_Presenting</state>
+ </target>
+ <!-- ... more target nodes below as necessary -->
+</bytarget>
+]]></screen>
+
+ The following client states are defined: Client_Connecting,
+ Client_Connected, Client_Idle, Client_Initializing, Client_Searching,
+ Client_Searching, Client_Presenting, Client_Error, Client_Failed,
+ Client_Disconnected, Client_Stopped.
+ </para>
+ </refsect2>
+
</refsect1>
</refentry>