From 675f6c65f545aa01f7943cc260ca6365e8d03de3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 9 Jul 2014 15:00:18 -0400 Subject: [PATCH] Fleshed, streaming, authoritative hold pull list API Signed-off-by: Bill Erickson --- .../lib/OpenILS/Application/Circ/Holds.pm | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 794f2dd1b3..bf8ed7e385 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -1555,6 +1555,25 @@ __PACKAGE__->register_method( } ); +__PACKAGE__->register_method( + method => "hold_pull_list", + stream => 1, + # TODO: tag with api_level 2 once fully supported + api_name => "open-ils.circ.hold_pull_list.fleshed.stream", + signature => { + desc => q/Returns a stream of fleshed holds that need to be + "pulled" by a given location. The location is + determined by the login session. + This API calls always run in authoritative mode./, + params => [ + { desc => 'Limit (optional)', type => 'number'}, + { desc => 'Offset (optional)', type => 'number'}, + ], + return => { + desc => 'Stream of holds holds, or event on failure', + } + } +); sub hold_pull_list { my( $self, $conn, $authtoken, $limit, $offset ) = @_; @@ -1577,12 +1596,24 @@ sub hold_pull_list { return $count; } elsif( $self->api_name =~ /id_list/ ) { - return $U->storagereq( + $U->storagereq( + 'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered.atomic', + $org, $limit, $offset ); + + } elsif ($self->api_name =~ /fleshed/) { + + my $ids = $U->storagereq( 'open-ils.storage.direct.action.hold_request.pull_list.id_list.current_copy_circ_lib.status_filtered.atomic', $org, $limit, $offset ); + my $e = new_editor(xact => 1, requestor => $reqr); + $conn->respond(uber_hold_impl($e, $_)) for @$ids; + $e->rollback; + $conn->respond_complete; + return; + } else { - return $U->storagereq( + $U->storagereq( 'open-ils.storage.direct.action.hold_request.pull_list.search.current_copy_circ_lib.status_filtered.atomic', $org, $limit, $offset ); } -- 2.43.2