getselections
Getselections retrieves all records selected in the current session.
Syntax
command=getselections
-
output
(String)
[optional] output format to be returned. Values for
output
can be either json
or xml
(xml
is the default, so you don't need to specify that explicitly). However, the output format produced by jQuery applications is always JSON, so you don't need to specify the output type there either.
Read more about JSON output here.
-
callback
(String)
[optional] returns JSON output wrapped in brackets with your callback function name, for AJAX requests: <callback function name>( <JSON output> ); You don't need to specify
output=json
, because the output format is JSON by default.
Description
You can use a selection to collect records (with getselections) for some common goal, like storing them in a saved search (aka pointer file).
A selection can only be made if in the current session a search yielded a result set, and you want to select a record in that result set. The selection remains intact during the current session and applies only to this session (so you won't be able to observe a WebAPI record selection in your Collections application). In the return XML, selected records have the attribute selected="True"
present in the <record>
node, for example: <record priref="2" selected="True">
.
Examples
-
Start a stateful session
show
For selection commands to work, an active session is required. Usually, a session will be started implicitly when the user begins submitting WebAPI requests, so this explicit startsession
command will often not be required. See the startsession command documentation for more information.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&command=startsession
-
Search all records: return all records from collect.inf
show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&search=all
-
From the result set of the example above, select the record with record number 2
show
- no further description -
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&command=selectrecord&priref=2
-
Limit the result set of the examples above to the selected records
show
Since we only selected record 2, only record 2 is retrieved.
http://test2.adlibsoft.com/api/wwwopac.ashx?database=collect.inf&command=getselections
Description
- no Adlib.Data-specific description available yet; see the URL request tab for all information -
Examples
Description
- no jQuery-specific description available yet; see the URL request tab for all information -
Examples