[open-ils-commits] r11181 - in trunk/Open-ILS/src/perlmods/OpenILS: Application WWW
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Nov 14 00:44:53 EST 2008
Author: miker
Date: 2008-11-14 00:44:50 -0500 (Fri, 14 Nov 2008)
New Revision: 11181
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
add configurable tag browser wrapper; register record browsing methods in supercat
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2008-11-14 04:12:20 UTC (rev 11180)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm 2008-11-14 05:44:50 UTC (rev 11181)
@@ -394,6 +394,93 @@
);
+sub general_browse {
+ my $self = shift;
+ my $client = shift;
+ return tag_sf_browse($self, $client, $self->{tag}, $self->{subfield}, @_);
+}
+__PACKAGE__->register_method(
+ method => 'general_browse',
+ api_name => 'open-ils.supercat.title.browse',
+ tag => '245', subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested org-scoped record ids held"
+ params =>
+ [ { name => 'value', desc => 'The target title', type => 'string' },
+ { name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_browse',
+ api_name => 'open-ils.supercat.author.browse',
+ tag => [qw/100 110 111/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested org-scoped record ids held"
+ params =>
+ [ { name => 'value', desc => 'The target author', type => 'string' },
+ { name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_browse',
+ api_name => 'open-ils.supercat.subject.browse',
+ tag => [qw/600 610 611 630 648 650 651 653 655 656 662 690 691 696 697 698 699/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested org-scoped record ids held"
+ params =>
+ [ { name => 'value', desc => 'The target subject', type => 'string' },
+ { name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_browse',
+ api_name => 'open-ils.supercat.topic.browse',
+ tag => [qw/650 690/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested org-scoped record ids held"
+ params =>
+ [ { name => 'value', desc => 'The target topical subject', type => 'string' },
+ { name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
+ }
+);
+__PACKAGE__->register_method(
+ method => 'general_browse',
+ api_name => 'open-ils.supercat.series.browse',
+ tag => [qw/440 490 800 810 811 830/], subfield => 'a',
+ api_level => 1,
+ argc => 1,
+ signature =>
+ { desc => "Returns a list of the requested org-scoped record ids held"
+ params =>
+ [ { name => 'value', desc => 'The target series', type => 'string' },
+ { name => 'org_unit', desc => 'The org unit shortname (or "-" or undef for global) to browse', type => 'string' },
+ { name => 'page_size', desc => 'Count of records to retrieve, default is 9', type => 'number' },
+ { name => 'page', desc => 'The page of records retrieve, calculated based on page_size. Can be positive, negative or 0.', type => 'number' }, ],
+ 'return' => { desc => 'Record IDs that have copies at the relevant org units', type => 'array' }
+ }
+);
+
+
sub tag_sf_browse {
my $self = shift;
my $client = shift;
Modified: trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2008-11-14 04:12:20 UTC (rev 11180)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2008-11-14 05:44:50 UTC (rev 11181)
@@ -139,6 +139,26 @@
$cn_browse_xslt = $xslt->parse_stylesheet( $cn_browse_xslt );
+ my $list = $supercat
+ ->request("open-ils.supercat.record.formats")
+ ->gather(1);
+
+ for my $record_browse_format ( @$list ) {
+ for my $browse_axis ( qw/title author subject topic series/ ) {
+ $browse_types{$browse_axis}{$record_browse_format} = sub {
+ my $record_list = shift;
+ my $prev = shift;
+ my $next = shift;
+
+ my $feed = create_record_feed( 'record', $record_browse_format, $record_list, undef, undef, 0 );
+
+ return (
+ "Content-type: ". $feed->type ."; charset=utf-8\n\n",
+ $feed->toString
+ );
+ };
+ }
+ }
}
sub oisbn {
More information about the open-ils-commits
mailing list