[open-ils-commits] r17186 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Aug 12 09:33:33 EDT 2010


Author: erickson
Date: 2010-08-12 09:33:31 -0400 (Thu, 12 Aug 2010)
New Revision: 17186

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
Log:
created batch/streaming versions of hold placement and possibility check calls: open-ils.circ.holds.create[.override].batch and open-ils.circ.title_hold.is_possible.batch.  Arguments are the same as non-batch, just delivered as an array; responses are delivered in order inbound params

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-08-12 12:57:13 UTC (rev 17185)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Circ/Holds.pm	2010-08-12 13:33:31 UTC (rev 17186)
@@ -39,6 +39,43 @@
 
 
 __PACKAGE__->register_method(
+    method    => "create_hold_batch",
+    api_name  => "open-ils.circ.holds.create.batch",
+    stream => 1,
+    signature => {
+        desc => q/@see open-ils.circ.holds.create.batch/,
+        params => [
+            { desc => 'Authentication token', type => 'string' },
+            { desc => 'Array of hold objects', type => 'array' }
+        ],
+        return => {
+            desc => 'Array of hold ID on success, -1 on missing arg, event (or ref to array of events) on error(s)',
+        },
+    }
+);
+
+__PACKAGE__->register_method(
+    method    => "create_hold_batch",
+    api_name  => "open-ils.circ.holds.create.override.batch",
+    stream => 1,
+    signature => {
+        desc  => '@see open-ils.circ.holds.create.batch',
+    }
+);
+
+
+sub create_hold_batch {
+	my( $self, $conn, $auth, $hold_list ) = @_;
+    (my $method = $self->api_name) =~ s/\.batch//og;
+    foreach (@$hold_list) {
+        my ($res) = $self->method_lookup($method)->run($auth, $_);
+        $conn->respond($res);
+    }
+    return undef;
+}
+
+
+__PACKAGE__->register_method(
     method    => "create_hold",
     api_name  => "open-ils.circ.holds.create",
     signature => {
@@ -1607,7 +1644,33 @@
     return undef;
 }
 
+__PACKAGE__->register_method(
+    method    => "check_title_hold_batch",
+    api_name  => "open-ils.circ.title_hold.is_possible.batch",
+    stream    => 1,
+    signature => {
+        desc  => '@see open-ils.circ.title_hold.is_possible.batch',
+        params => [
+            { desc => 'Authentication token',     type => 'string'},
+            { desc => 'Array of Hash of named parameters', type => 'array'},
+        ],
+        return => {
+            desc => 'Array of response objects',
+            type => 'array'
+        }
+    }
+);
 
+sub check_title_hold_batch {
+    my($self, $client, $authtoken, $param_list) = @_;
+    foreach (@$param_list) {
+        my ($res) = $self->method_lookup('open-ils.circ.title_hold.is_possible')->run($authtoken, $_);
+        $client->respond($res);
+    }
+    return undef;
+}
+
+
 __PACKAGE__->register_method(
     method    => "check_title_hold",
     api_name  => "open-ils.circ.title_hold.is_possible",
@@ -1721,6 +1784,8 @@
     }
 }
 
+
+
 sub do_possibility_checks {
     my($e, $patron, $request_lib, $depth, %params) = @_;
 



More information about the open-ils-commits mailing list