1 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN"
2 "http://www.oasis-open.org/docbook/xml/4.1/docbookx.dtd"
4 <!ENTITY % local SYSTEM "local.ent">
6 <!ENTITY % entities SYSTEM "entities.ent">
8 <!ENTITY % common SYSTEM "common/common.ent">
11 <!-- $Id: pazpar2_protocol.xml,v 1.4 2007-01-19 19:08:00 quinn Exp $ -->
12 <refentry id="pazpar2_protocol">
14 <productname>Pazpar2</productname>
15 <productnumber>&version;</productnumber>
18 <refentrytitle>Pazpar2 protocol</refentrytitle>
19 <manvolnum>7</manvolnum>
23 <refname>pazpar2_protocol</refname>
24 <refpurpose>The webservice protocol of Pazpar2</refpurpose>
27 <refsect1><title>DESCRIPTION</title>
29 Webservice requests are any that refer to filename "search.pz2". Arguments
30 are GET-style parameters. Argument 'command' is always required and specifies
31 the operation to perform. Any request not recognized as a webservice
32 request is forwarded to the HTTP server specified in the configuration
33 using the proxy setting.
34 This way, a regular webserver can host the user interface (itself dynamic
35 or static HTML), and AJAX-style calls can be used from JS (or any other client-based
36 scripting environment) to interact with the search logic in pazpar2.
39 Each command is described in sub sections to follow.
41 <refsect2 id="command-init"><title>init</title>
43 Initializes a session.
44 Returns session ID to be used in subsequent requests.
49 search.pz2?command=init
58 <session>2044502273</session>
63 <refsect2 id="command-ping"><title>ping</title>
65 Keeps a session alive. An idle session will time out after one minute.
66 The ping command can be used to keep the session alive absent other
68 It is suggested that any browser client have a simple alarm handler which
69 sends a ping every 50 seconds or so once a session has been initialized.
74 search.pz?command=ping&session=2044502273
85 <refsect2 id="command-search"><title>search</title>
87 Launches a search, parameters:
112 search.pz2?session=2044502273&command=search&query=computer+science
124 <refsect2 id="command-stat">
127 Provides status information about an ongoing search. Parameters:
144 search.pz2?session=2044502273&command=stat
149 <activeclients>3</activeclients>
150 <hits>7</hits> -- Total hitcount
151 <records>7</records> -- Total number of records fetched in last query
152 <clients>1</clients> -- Total number of associated clients
153 <unconnected>0</unconnected> -- Number of disconnected clients
154 <connecting>0</connecting> -- Number of clients in connecting state
155 <initializing>0</initializing> -- Number of clients initializing
156 <searching>0</searching> -- ... searching
157 <presenting>0</presenting> -- ... presenting
158 <idle>1</idle> -- ... idle (not doing anything)
159 <failed>0</failed> -- ... Connection failed
160 <error>0</error> -- ... Error was produced somewhere
166 <refsect2 id="command-show">
169 Shows records retrieved. Parameters:
183 <para>First record to show - 0-indexed.</para>
191 Number of records to show If omitted, 20 is used.
200 If block is set to 1, the command will hang until there are records ready
201 to display. Use this to show first records rapidly without
202 requiring rapid polling.
211 Specifies sort criteria. The argument is a comma-separated list
212 (no whitespace allowed) of sort fields, with the highest-priority
213 field first. A sort field may be followed by a colon followed by
214 the number '0' or '1', indicating whether results should be sorted in
215 increasing or decreasing order according to that field. 0==Decreasing is
226 search.pz2?session=2044502273&command=show&start=0&num=2&sort=title:1
232 <activeclients>3</activeclients> -- How many clients are still working
233 <merged>6</merged> -- Number of merged records
234 <total>7</total> -- Total of all hitcounts
235 <start>0</start> -- The start number you requested
236 <num>2</num> -- Number of records retrieved
238 <md-title>How to program a computer, by Jack Collins</md-title>
239 <count>2</count> -- Number of merged records
240 <recid>6</recid> -- Record ID for this record
244 Computer processing of dynamic images from an Anger scintillation camera :
245 the proceedings of a workshop /
254 <refsect2 id="command-record">
255 <title>record</title>
257 Retrieves a detailed record. Parameters:
273 record ID as provided by the
274 <link linkend="command-show">show</link> command.
283 search.pz2?session=605047297&command=record&id=3
291 The Puget Sound Region : a portfolio of thematic computer maps /
293 <md-date>1974</md-date>
294 <md-author>Mairs, John W.</md-author>
295 <md-subject>Cartography</md-subject>
302 <refsect2 id="command-termlist">
303 <title>termlist</title>
305 Retrieves term list(s). Parameters:
308 name -- comma-separated list of termlist names (default "subject")
314 search.pz2?session=2044502273&command=termlist&name=author,subject
319 <activeclients>3</activeclients>
322 <name>Donald Knuth</name>
323 <frequency>10</frequency>
326 <name>Robert Pirsig</name>
327 <frequency>2</frequency>
330 <list name="subject">
332 <name>Computer programming</name>
333 <frequency>10</frequency>
341 For the special termlist name "xtargets", results
342 are returned about the targets which have returned the most hits.
343 The 'term' subtree has additional elements,
344 specifically a state and diagnostic field (in the example below, a
345 target ID is returned in place of 'name'.
346 This may or may not change later.
352 <name>library2.mcmaster.ca</name>
353 <frequency>11734</frequency> -- Number of hits
354 <state>Client_Idle</state> -- See the description of 'bytarget' below
355 <diagnostic>0</diagnostic> -- Z39.50 diagnostic codes
362 <refsect2 id="command-bytarget">
363 <title>bytarget</title>
365 Returns information about the status of each active client. Parameters:
381 search.pz2?session=605047297&command=record&id=3
390 <id>z3950.loc.gov/voyager/</id>
392 <diagnostic>0</diagnostic>
393 <records>65</records>
394 <state>Client_Presenting</state>
396 <!-- ... more target nodes below as necessary -->
401 The following client states are defined: Client_Connecting,
402 Client_Connected, Client_Idle, Client_Initializing, Client_Searching,
403 Client_Searching, Client_Presenting, Client_Error, Client_Failed,
404 Client_Disconnected, Client_Stopped.
411 <!-- Keep this comment at the end of the file
416 sgml-minimize-attributes:nil
417 sgml-always-quote-attributes:t
420 sgml-parent-document:nil
421 sgml-local-catalogs: nil
422 sgml-namecase-general:t