[open-ils-commits] r9249 - branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 7 13:29:23 EDT 2008


Author: erickson
Date: 2008-04-07 12:52:22 -0400 (Mon, 07 Apr 2008)
New Revision: 9249

Modified:
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
Log:
made fund, funding_source, provider org retrievals streaming methods

Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm	2008-04-07 16:31:39 UTC (rev 9248)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Financials.pm	2008-04-07 16:52:22 UTC (rev 9249)
@@ -100,6 +100,7 @@
 __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 @@
     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 @@
 __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 @@
     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(

Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm	2008-04-07 16:31:39 UTC (rev 9248)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Provider.pm	2008-04-07 16:52:22 UTC (rev 9249)
@@ -64,6 +64,7 @@
 __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 @@
         $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;
 }
 
 



More information about the open-ils-commits mailing list