From aff5fee73efd5fac3b0011be09a4d950934cdebb Mon Sep 17 00:00:00 2001 From: miker Date: Wed, 22 Feb 2006 23:37:19 +0000 Subject: [PATCH] unapi r1 complete!; using (fake) info uris git-svn-id: svn://svn.open-ils.org/ILS/trunk@3173 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../perlmods/OpenILS/Application/SuperCat.pm | 4 +- Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm | 50 ++++++++++++++----- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm index d4ae0ba11c..d229b67431 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/SuperCat.pm @@ -238,7 +238,7 @@ sub retrieve_metarecord_mods { ->ownerDocument ->createElement("mods:recordIdentifier"); - $recordIdentifier->setAttribute( source => 'oils:/metabib-metarecord/' ); + $recordIdentifier->setAttribute( source => 'info:oils/metabib-metarecord/' ); my $id = $mr->id; $recordIdentifier->appendTextNode( $id ); @@ -307,7 +307,7 @@ sub retrieve_metarecord_mods { ->ownerDocument ->createElement("mods:recordIdentifier"); - $subRecordIdentifier->setAttribute( source => 'oils:/biblio-record_entry/' ); + $subRecordIdentifier->setAttribute( source => 'info:oils/biblio-record_entry/' ); my $subid = $map->source; $subRecordIdentifier->appendTextNode( $subid ); diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 6099c870a6..eee3beb4ff 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -42,18 +42,19 @@ sub handler { my ($id,$type,$format,$command) = reverse split '/', $path; - print "Content-type: text/xml; charset=utf-8\n\n"; + print "Content-type: application/xml; charset=utf-8\n"; if ( $path =~ m{^/?$}o ) { my $cgi = new CGI; my $uri = $cgi->param('uri') || ''; + my $base = $cgi->url; $format = $cgi->param('format'); ($id,$type) = ('',''); if (!$format) { - if ($uri =~ m{^oils:/([^\/]+)/(\d+)}o) { + if ($uri =~ m{^info:oils/([^\/]+)/(\d+)}o) { $id = $2; $type = 'record'; $type = 'metarecord' if ($1 =~ /^m/o); @@ -62,12 +63,27 @@ sub handler { ->request("open-ils.supercat.$type.formats") ->gather(1); - print ''. + print "\n"; + + my $body = + " + $uri + + opac + text/html + ". + join('', - map { - "$_text/xml" + map { " + $_ + application/xml + " } @$list - ).''; + ). + + ''; + + $apache->custom_response( 300, $body); return 300; } else { my $list = $supercat @@ -82,7 +98,11 @@ sub handler { my %hash = map { ($_ => $_) } @$list; $list = [ sort keys %hash ]; - print ''. + print "\n + + opac + text/html + ". join('', map { "$_text/xml" @@ -93,19 +113,27 @@ sub handler { } - if ($uri =~ m{^oils:/([^\/]+)/(\d+)}o) { + if ($uri =~ m{^info:oils/([^\/]+)/(\d+)}o) { $id = $2; $type = 'record'; $type = 'metarecord' if ($1 =~ /^m/o); $command = 'retrieve'; } + if ($format eq 'opac') { + print "Location: $base/../../en-US/skin/default/xml/rresult.xml?m=$id\n\n" + if ($type eq 'metarecord'); + print "Location: $base/../../en-US/skin/default/xml/rdetail.xml?r=$id\n\n" + if ($type eq 'record'); + return 302; + } + } elsif ( $path =~ m{^/formats/([^\/]+)$}o ) { my $list = $supercat ->request("open-ils.supercat.$1.formats") ->gather(1); - print ''. + print "\n". join('', map { "$_text/xml" @@ -114,9 +142,7 @@ sub handler { return Apache2::Const::OK; } - print $supercat - ->request("open-ils.supercat.$type.$format.$command",$id) - ->gather(1); + print "\n" . $supercat->request("open-ils.supercat.$type.$format.$command",$id)->gather(1); return Apache2::Const::OK; } -- 2.43.2