[open-ils-commits] r9262 - 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 23:29:19 EDT 2008


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

Modified:
   branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
Log:
changed lineitem retrieval call to streaming

Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-04-08 02:38:32 UTC (rev 9261)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Acq/Picklist.pm	2008-04-08 02:52:15 UTC (rev 9262)
@@ -444,6 +444,7 @@
 __PACKAGE__->register_method(
 	method => 'retrieve_pl_lineitem',
 	api_name	=> 'open-ils.acq.lineitem.picklist.retrieve',
+    stream => 1,
 	signature => {
         desc => 'Retrieves lineitem objects according to picklist',
         params => [
@@ -510,22 +511,23 @@
 
     my @ids;
     push(@ids, $_->{id}) for @$entries;
-    return \@ids if $$options{idlist} or not @ids;
 
-    if($$options{flesh_attrs}) {
-        $entries = $e->search_acq_lineitem([
-            {id => \@ids},
-            {flesh => 1, flesh_fields => {jub => ['attributes']}}
-        ]);
-    } else {
-        $entries = $e->batch_retrieve_acq_lineitem(\@ids);
-    }
+    for my $id (@ids) {
+        if($$options{idlist}) {
+            $conn->respond($id);
+            next;
+        } 
 
-    if($$options{clear_marc}) {
-        $_->clear_marc for @$entries;
+        my $entry;
+        my $flesh = ($$options{flesh_attrs}) ? 
+            {flesh => 1, flesh_fields => {jub => ['attributes']}} : {};
+
+        $entry = $e->retrieve_acq_lineitem([$id, $flesh]);
+        $entry->clear_marc if $$options{clear_marc};
+        $conn->respond($entry);
     }
 
-    return $entries;
+    return undef;
 }
 
 =head comment



More information about the open-ils-commits mailing list