2f9c22f9558d2c66fb91d4b88640ff7d9a691311
[pazpar2-moved-to-github.git] / PROTOCOL
1
2 Webservice requests are any that refer to filename "search.pz2". Arguments
3 are GET-style parameters. Argument 'command' is required and specifies
4 command.
5
6 Commands:
7
8 init
9
10 Initializes a session. Returns session ID to be used in subsequent requests. Example:
11
12 search.pz2?command=init
13
14 Response example:
15
16 <init>
17   <status>OK</status>
18   <session>2044502273</session>
19 </init>
20
21 search
22
23 Launches a search, parameters:
24
25 session
26 query
27
28 Example:
29
30 search.pz2?session=2044502273&command=search&query=computer
31
32 Response example:
33
34 <search>
35   <status>OK</status>
36 </search>
37
38 stat
39
40 Provides status of ongoing search. Parameters:
41
42 session
43
44 Example:
45
46 search.pz2?session=2044502273&command=stat
47
48 Output:
49
50 <stat>
51   <hits>7</hits>                   -- Total hitcount
52   <records>7</records>             -- Total number of records fetched
53   <clients>1</clients>             -- Total number of associated clients
54   <unconnected>0</unconnected>     -- Number of disconnected clients
55   <connecting>0</connecting>       -- Number of clients in connecting state
56   <initializing>0</initializing>   -- Number of clients initializing
57   <searching>0</searching>         -- ... searching
58   <presenting>0</presenting>       -- ... presenting
59   <idle>1</idle>                   -- ... idle (not doing anything)
60   <failed>0</failed>               -- ... Connection failed
61   <error>0</error>                 -- ... Error was produced somewhere
62 </stat>
63
64 show
65
66 Shows records retrieved
67
68 parameters:
69
70 session
71 start      -- 0-indexed!!
72 num        -- default=20
73
74 Example:
75
76 search.pz2?session=2044502273&command=show&start=0&num=2
77
78 Output:
79
80 <show>
81   <status>OK</status>
82   <merged>6</merged>
83   <total>7</total>
84   <start>0</start>
85   <num>2</num>
86   <hit>
87     <title>How to program a computer, by Jack Collins</title>
88     <count>2</count> <!-- Number of merged records -->
89   </hit>
90   <hit>
91     <title>
92   Computer processing of dynamic images from an Anger scintillation camera :
93   the proceedings of a workshop /
94     </title>
95   </hit>
96 </show>