Add some missing SuperCat WWW entry points, and ...
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tue, 4 Oct 2011 20:02:12 +0000 (16:02 -0400)
committerMike Rylander <mrylander@gmail.com>
Thu, 6 Oct 2011 15:34:36 +0000 (11:34 -0400)
... rename the open-ils.storage API call to be a little more
correct (browse /and/ search).

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm
Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm

index 5de1381..f5f940a 100644 (file)
@@ -260,13 +260,13 @@ for my $class ( qw/title author subject keyword series identifier/ ) {
        );
 }
 __PACKAGE__->register_method(
-    api_name   => "open-ils.storage.authority.in_db.browse",
-    method             => "authority_in_db_browse",
+    api_name   => "open-ils.storage.authority.in_db.browse_or_search",
+    method             => "authority_in_db_browse_or_search",
     api_level  => 1,
     argc        => 5
 );
 
-sub authority_in_db_browse {
+sub authority_in_db_browse_or_search {
     my ($self, $shift, $method, @args) = @_;
 
     return unless $method =~ /^\w+$/;
index 7b8913b..7d04fe2 100644 (file)
@@ -285,7 +285,7 @@ sub generic_new_authorities_method {
 
     my $storage = create OpenSRF::AppSession("open-ils.storage");
     my $list = $storage->request(
-        "open-ils.storage.authority.in_db.browse",
+        "open-ils.storage.authority.in_db.browse_or_search",
         $method, $term, $value, $page, $page_size
     )->gather(1);
 
index 1ae1dd0..708cc22 100644 (file)
@@ -36,6 +36,8 @@ my $U = 'OpenILS::Application::AppUtils';
 # set the bootstrap config when this module is loaded
 my ($bootstrap, $supercat, $actor, $parser, $search, $xslt, $cn_browse_xslt, %browse_types, %qualifier_map);
 
+my $authority_axis_re = qr/^authority\.(\w+)(\.refs)?$/;
+
 $browse_types{call_number}{xml} = sub {
     my $tree = shift;
 
@@ -1561,11 +1563,7 @@ sub string_browse {
 
     my $tree;
     if ($axis =~ /^authority/) {
-        # Formerly, this was always browse by axis, so for right this moment
-        # I'm still not implementing a front door API for atag and btag
-        # browsing, but I might do it in a moment.
-
-        my ($realaxis, $refs) = ($axis =~ /^authority\.(\w+)(\.refs)?$/);
+        my ($realaxis, $refs) = ($axis =~ $authority_axis_re);
 
         my $method = "open-ils.supercat.authority.browse_center.by_axis";
         $method .= ".refs" if $refs;
@@ -1646,12 +1644,17 @@ sub string_startwith {
 
     my $tree;
     if ($axis =~ /^authority/) {
+        my ($realaxis, $refs) = ($axis =~ $authority_axis_re);
+
+        my $method = "open-ils.supercat.authority.browse_top.by_axis";
+        $method .= ".refs" if $refs;
+
         $tree = $supercat->request(
-            "open-ils.supercat.authority.startwith.by_axis",
-            $axis,
+            $method,
+            $realaxis,
             $string,
-            $page_size,
-            $page
+            $page,
+            $page_size
         )->gather(1);
     } else {
         $tree = $supercat->request(
@@ -2119,12 +2122,17 @@ sub return_auth_response {
     if ($qualifier eq "id") {
         $recs = [ int($term) ];
     } else {
+        my ($realaxis, $refs) = ($qualifier =~ $authority_axis_re);
+
+        my $method = "open-ils.supercat.authority.browse_top.by_axis";
+        $method .= ".refs" if $refs;
+
         $recs = $supercat->request(
-            "open-ils.supercat.authority.startwith.by_axis",
-            $qualifier,
+            $method,
+            $realaxis,
             $term,
-            $page_size,
-            $page
+            $page,
+            $page_size
         )->gather(1);
     }