From 16cc7e16263ffbd10312d8650d755f65f41e4349 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 20 Nov 2007 17:08:58 -0600 Subject: [PATCH] started biblios integration Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- biblios/bib | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 biblios/bib diff --git a/biblios/bib b/biblios/bib new file mode 100755 index 0000000000..b8ddbd3923 --- /dev/null +++ b/biblios/bib @@ -0,0 +1,46 @@ +#!/usr/bin/perl + +# Copyright 2007 LibLime +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA +# + +use strict; +use CGI; +use C4::Auth; +use C4::Biblio; +use XML::Simple; + +my $query = new CGI; + +# do initial validation +my $path_info = $query->path_info(); + +my $biblionumber = undef; +if ($path_info =~ m!^/(\d+)$!) { + $biblionumber = $1; +} else { + print $query->header(-type => 'text/xml', -status => '400 Bad Request'); +} + +my $record = GetMarcBiblio($biblionumber); + +if (defined $record) { + print $query->header(-type => 'text/xml'); + print $record->as_xml_record(); +} else { + print $query->header(-type => 'text/xml', -status => '404 Not Found'); +} -- 2.39.5