From 53a32534ba4fbe022e39d756631627b13978eec4 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 14 May 2008 17:55:39 +0000 Subject: [PATCH] user picklist retrieve is now streaming git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9604 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../src/perlmods/OpenILS/Application/Acq/Picklist.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm index 3949937ad4..0a5dac7fb2 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm @@ -144,6 +144,7 @@ sub retrieve_picklist_name { __PACKAGE__->register_method( method => 'retrieve_user_picklist', api_name => 'open-ils.acq.picklist.user.retrieve', + stream => 1, signature => { desc => 'Retrieves a user\'s picklists', params => [ @@ -163,18 +164,21 @@ sub retrieve_user_picklist { # don't grab the PL with name == "", because that is the designated temporary picklist my $list = $e->search_acq_picklist( {owner=>$e->requestor->id, name=>{'!='=>''}}, - {idlist=>$$options{idlist}} + {idlist=>1} ); - if($$options{flesh_lineitem_count}) { - $_->entry_count(retrieve_lineitem_count($e, $_->id)) for @$list; - }; - - if($$options{flesh_username}) { - $_->owner($e->retrieve_actor_user($_->owner)->usrname) for @$list; + for my $id (@$list) { + if($$options{idlist}) { + $conn->respond($id); + } else { + my $pl = $e->retrieve_acq_picklist($id); + $pl->entry_count(retrieve_lineitem_count($e, $id)) if $$options{flesh_lineitem_count}; + $pl->owner($e->retrieve_actor_user($pl->owner)->usrname) if $$options{flesh_username}; + $conn->respond($pl); + } } - return $list; + return undef; } -- 2.11.0