started biblios integration

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2007-11-20 17:08:58 -06:00 committed by Joshua Ferraro
parent 51e253ae3e
commit 16cc7e1626
1 changed files with 46 additions and 0 deletions

46
biblios/bib Executable file
View File

@ -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');
}