From ce767218e8c11f5fa5df158d65423e937552c0fb Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Tue, 4 Oct 2011 16:02:12 -0400 Subject: [PATCH] Add some missing SuperCat WWW entry points, and ... ... rename the open-ils.storage API call to be a little more correct (browse /and/ search). Signed-off-by: Lebbeous Fogle-Weekley --- .../Application/Storage/Publisher/authority.pm | 6 ++-- .../perlmods/lib/OpenILS/Application/SuperCat.pm | 2 +- Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm | 34 +++++++++++++--------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm index 5de1381e46..f5f940a129 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/authority.pm @@ -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+$/; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm index 7b8913bde4..7d04fe2405 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/SuperCat.pm @@ -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); diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm index 1ae1dd0f1f..708cc22478 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/SuperCat.pm @@ -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); } -- 2.11.0