);
}
__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+$/;
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);
# 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;
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;
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(
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);
}