From: erickson Date: Thu, 12 Aug 2010 13:33:31 +0000 (+0000) Subject: created batch/streaming versions of hold placement and possibility check calls: open... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=11a28bd3aae926dd25511e581a83a94e1a89a563;p=evergreen%2Fbjwebb.git created batch/streaming versions of hold placement and possibility check calls: open-ils.circ.holds.create[.override].batch and open-ils.circ.title_hold.is_possible.batch. Arguments are the same as non-batch, just delivered as an array; responses are delivered in order inbound params git-svn-id: svn://svn.open-ils.org/ILS/trunk@17186 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm index ca35b3353..7a75ee913 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm @@ -39,6 +39,43 @@ my $U = $apputils; __PACKAGE__->register_method( + method => "create_hold_batch", + api_name => "open-ils.circ.holds.create.batch", + stream => 1, + signature => { + desc => q/@see open-ils.circ.holds.create.batch/, + params => [ + { desc => 'Authentication token', type => 'string' }, + { desc => 'Array of hold objects', type => 'array' } + ], + return => { + desc => 'Array of hold ID on success, -1 on missing arg, event (or ref to array of events) on error(s)', + }, + } +); + +__PACKAGE__->register_method( + method => "create_hold_batch", + api_name => "open-ils.circ.holds.create.override.batch", + stream => 1, + signature => { + desc => '@see open-ils.circ.holds.create.batch', + } +); + + +sub create_hold_batch { + my( $self, $conn, $auth, $hold_list ) = @_; + (my $method = $self->api_name) =~ s/\.batch//og; + foreach (@$hold_list) { + my ($res) = $self->method_lookup($method)->run($auth, $_); + $conn->respond($res); + } + return undef; +} + + +__PACKAGE__->register_method( method => "create_hold", api_name => "open-ils.circ.holds.create", signature => { @@ -1607,6 +1644,32 @@ sub fetch_captured_holds { return undef; } +__PACKAGE__->register_method( + method => "check_title_hold_batch", + api_name => "open-ils.circ.title_hold.is_possible.batch", + stream => 1, + signature => { + desc => '@see open-ils.circ.title_hold.is_possible.batch', + params => [ + { desc => 'Authentication token', type => 'string'}, + { desc => 'Array of Hash of named parameters', type => 'array'}, + ], + return => { + desc => 'Array of response objects', + type => 'array' + } + } +); + +sub check_title_hold_batch { + my($self, $client, $authtoken, $param_list) = @_; + foreach (@$param_list) { + my ($res) = $self->method_lookup('open-ils.circ.title_hold.is_possible')->run($authtoken, $_); + $client->respond($res); + } + return undef; +} + __PACKAGE__->register_method( method => "check_title_hold", @@ -1721,6 +1784,8 @@ sub check_title_hold { } } + + sub do_possibility_checks { my($e, $patron, $request_lib, $depth, %params) = @_;