From ded30787b29b520f71912bb09ab5bb219b6eb004 Mon Sep 17 00:00:00 2001 From: erickson Date: Mon, 7 Apr 2008 16:52:22 +0000 Subject: [PATCH] made fund, funding_source, provider org retrievals streaming methods git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9249 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/Acq/Financials.pm | 22 ++++++++++++---------- .../perlmods/OpenILS/Application/Acq/Provider.pm | 5 +++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm index 7892724c4f..9404f274f0 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm @@ -100,6 +100,7 @@ sub retrieve_funding_source { __PACKAGE__->register_method( method => 'retrieve_org_funding_sources', api_name => 'open-ils.acq.funding_source.org.retrieve', + stream => 1, signature => { desc => 'Retrieves all the funding_sources associated with an org unit that the requestor has access to see', params => [ @@ -130,13 +131,13 @@ sub retrieve_org_funding_sources { return [] unless @$org_ids; my $sources = $e->search_acq_funding_source({owner => $org_ids}); - if($$options{flesh_summary}) { - for my $source (@$sources) { - $source->summary(retrieve_funding_source_summary_impl($e, $source)); - } + for my $source (@$sources) { + $source->summary(retrieve_funding_source_summary_impl($e, $source)) + if $$options{flesh_summary}; + $conn->respond($source); } - return $sources; + return undef; } sub retrieve_funding_source_summary_impl { @@ -266,6 +267,7 @@ sub retrieve_fund { __PACKAGE__->register_method( method => 'retrieve_org_funds', api_name => 'open-ils.acq.fund.org.retrieve', + stream => 1, signature => { desc => 'Retrieves all the funds associated with an org unit', params => [ @@ -297,13 +299,13 @@ sub retrieve_org_funds { return [] unless @$org_ids; my $funds = $e->search_acq_fund({org => $org_ids}); - if($$options{flesh_summary}) { - for my $fund (@$funds) { - $fund->summary(retrieve_fund_summary_impl($e, $fund)); - } + for my $fund (@$funds) { + $fund->summary(retrieve_fund_summary_impl($e, $fund)) + if $$options{flesh_summary}; + $conn->respond($fund); } - return $funds; + return undef; } __PACKAGE__->register_method( diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm index 3e81b5e679..0fca4c741d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm @@ -64,6 +64,7 @@ sub retrieve_provider { __PACKAGE__->register_method( method => 'retrieve_org_providers', api_name => 'open-ils.acq.provider.org.retrieve', + stream => 1, signature => { desc => 'Retrieves all the providers associated with an org unit that the requestor has access to see', params => [ @@ -92,9 +93,9 @@ sub retrieve_org_providers { $U->find_highest_work_orgs($e, $limit_perm, {descendants =>1}); return [] unless @$org_ids; - my $sources = $e->search_acq_provider({owner => $org_ids}); + $conn->respond($_) for @{$e->search_acq_provider({owner => $org_ids})}; - return $sources; + return undef; } -- 2.11.0