api_name => "open-ils.storage.authority.in_db.browse_or_search",
method => "authority_in_db_browse_or_search",
api_level => 1,
- argc => 5
+ argc => 5,
+ signature => {
+ desc => q/Use stored procedures to perform authorities-based
+ browses or searches/,
+ params => [
+ {name => "method", type => "string", desc => q/
+ The name of a method within the authority schema to call. This
+ is an API call on a private service for a reason. Do not pass
+ unfiltered user input into this API call, especially in this
+ parameter./},
+ {name => "what", type => "string", desc => q/
+ What to search. Could be an axis name, an authority tag
+ number, or a bib tag number/},
+ {name => "term", type => "string", desc => "Search term"},
+ {name => "page", type => "number", desc => "Zero-based page number"},
+ {name => "page_size", type => "number",
+ desc => "Number of records per page"}
+ ],
+ return => {
+ desc => "A list of authority record IDs",
+ type => "array"
+ }
+ }
);
sub authority_in_db_browse_or_search {
argc => 1,
signature => {
desc => q/Generated method/,
+ params => [
+ {name => "what",
+ desc => "An axis, an authority tag number, or a bibliographic tag number, depending on invocation",
+ type => "string"},
+ {name => "term",
+ desc => "A search term",
+ type => "string"},
+ {name => "page",
+ desc => "zero-based page number of results",
+ type => "number"},
+ {name => "page size",
+ desc => "number of results per page",
+ type => "number"}
+ ],
+ return => {
+ desc => "A list of authority record IDs", type => "array"
+ }
}
);
# We want to be extra careful with these arguments, since the next
# thing we're doing with them is passing them to a DB procedure.
+ my $what = ''.shift;
my $term = ''.shift;
- my $value = ''.shift;
my $page = int(shift || 0);
my $page_size = shift;
# Match authority.full_rec normalization
# XXX don't know whether we need second arg 'subfield'?
- $value = naco_normalize($value);
+ $term = naco_normalize($term);
my $storage = create OpenSRF::AppSession("open-ils.storage");
my $list = $storage->request(
"open-ils.storage.authority.in_db.browse_or_search",
- $method, $term, $value, $page, $page_size
+ $method, $what, $term, $page, $page_size
)->gather(1);
$storage->kill_me;