[open-ils-commits] r16733 - in trunk/Open-ILS/src/perlmods/OpenILS: Application WWW (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Jun 16 15:21:53 EDT 2010


Author: miker
Date: 2010-06-16 15:21:48 -0400 (Wed, 16 Jun 2010)
New Revision: 16733

Modified:
   trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
   trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
add authority marcxml retrieve method, switch on record type

Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-06-16 19:11:16 UTC (rev 16732)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm	2010-06-16 19:21:48 UTC (rev 16733)
@@ -1351,6 +1351,39 @@
 }
 
 
+sub retrieve_authority_marcxml {
+	my $self = shift;
+	my $client = shift;
+	my $rid = shift;
+
+	my $_storage = OpenSRF::AppSession->create( 'open-ils.cstore' );
+
+	my $record = $_storage->request( 'open-ils.cstore.direct.authority.record_entry.retrieve' => $rid )->gather(1);
+	return $U->entityize( $record->marc ) if ($record);
+	return undef;
+}
+
+__PACKAGE__->register_method(
+	method    => 'retrieve_authority_marcxml',
+	api_name  => 'open-ils.supercat.authority.marcxml.retrieve',
+	api_level => 1,
+	argc      => 1,
+	signature =>
+		{ desc     => <<"		  DESC",
+Returns the MARCXML representation of the requested authority record
+		  DESC
+		  params   =>
+		  	[
+				{ name => 'authorityId',
+				  desc => 'An OpenILS authority::record_entry id',
+				  type => 'number' },
+			],
+		  'return' =>
+		  	{ desc => 'The authority record in MARCXML',
+			  type => 'string' }
+		}
+);
+
 sub retrieve_record_marcxml {
 	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	2010-06-16 19:11:16 UTC (rev 16732)
+++ trunk/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-06-16 19:21:48 UTC (rev 16733)
@@ -163,7 +163,8 @@
                 	my $site = shift;
 
 			$log->info("Creating record feed with params [$real_format, $record_list, $unapi, $site]");
-                	my $feed = create_record_feed( 'record', $real_format, $record_list, $unapi, $site, $real_format =~ /(-full|-uris)$/o ? 1 : 0 );
+                	my $bib_or_authority = $__a =~ /^authority/ ? 'authority' : 'record';
+                	my $feed = create_record_feed( $bib_or_authority, $real_format, $record_list, $unapi, $site, $real_format =~ /(-full|-uris)$/o ? 1 : 0 );
                 	$feed->root( "$base/../" );
                 	$feed->lib( $site );
                 	$feed->link( next => $next => $feed->type );
@@ -1328,6 +1329,7 @@
 
 		my $item_tag = "tag:$host,$year:biblio-record_entry/$rec/$lib";
 		$item_tag = "tag:$host,$year:isbn/$rec/$lib" if ($search eq 'isbn');
+		$item_tag = "tag:$host,$year:authorit-record_entry/$rec" if ($search eq 'authority');
 
 		my $xml = $supercat->request(
 			"open-ils.supercat.$search.$type.retrieve",



More information about the open-ils-commits mailing list