From: Lebbeous Fogle-Weekley Date: Tue, 4 Oct 2011 20:28:33 +0000 (-0400) Subject: API documentation for new authorities methods X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d1fe4517ac8948615e0280a7c794b40ec7a3df9b;p=evergreen%2Fequinox.git API documentation for new authorities methods in open-ils.supercat and open-ils.storage. Signed-off-by: Lebbeous Fogle-Weekley --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm index f5f940a129..b0cdfe47a8 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm @@ -263,7 +263,29 @@ __PACKAGE__->register_method( 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 { diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm index 7d04fe2405..879ba77c5b 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm @@ -235,6 +235,23 @@ sub register_new_authorities_methods { 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" + } } ); @@ -260,8 +277,8 @@ sub generic_new_authorities_method { # 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; @@ -281,12 +298,12 @@ sub generic_new_authorities_method { # 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;