koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/export export_filtered.pl [rel_3_0]


From: LAURIN arnaud
Subject: [Koha-cvs] koha/export export_filtered.pl [rel_3_0]
Date: Fri, 12 Jan 2007 10:34:48 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_3_0
Changes by:     LAURIN arnaud <alaurin> 07/01/12 10:34:48

Added files:
        export         : export_filtered.pl 

Log message:
        adding a new system to export xml values from biblioitems to an iso 
file, but with the difference to filter all the biblionumber are in the 
zebraqueue list (for us considered as problem, and not indexable by zebra) .
        
        this programm must be improved for distictions between deletion of 
notice, deletion of items and problems of notice who are more than 110 items 
linked (bug from marcxml ????)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/export/export_filtered.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1

Patches:
Index: export_filtered.pl
===================================================================
RCS file: export_filtered.pl
diff -N export_filtered.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ export_filtered.pl  12 Jan 2007 10:34:47 -0000      1.1.2.1
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+
+# 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
+
+## This script allows you to export a rel_2_2 bibliographic db in
+#MARC21 format from the command line.
+#
+
+use strict;
+require Exporter;
+use C4::Auth;
+use C4::Interface::CGI::Output;
+use C4::Output;    # contains gettemplate
+use C4::Biblio;
+use CGI;
+use C4::Auth;
+
+my $outfile = $ARGV[0];
+open( OUT, ">$outfile" ) or die $!;
+my $query                = new CGI;
+# my $StartingBiblionumber = $query->param("StartingBiblionumber");
+# my $EndingBiblionumber   = $query->param("EndingBiblionumber");
+my $StartingBiblionumber = $ARGV[1];
+my $EndingBiblionumber   = $ARGV[2];
+my $dbh                  = C4::Context->dbh;
+my $sth;
+
+warn "start ->".$StartingBiblionumber;
+warn "stop ->".$EndingBiblionumber;
+
+    my $query =
+         my $query = "
+        SELECT biblionumber
+        FROM   biblioitems
+        WHERE  biblionumber >=?
+        AND   biblionumber <=?
+        AND NOT EXISTS (
+                SELECT DISTINCT (biblio_auth_number) FROM zebraqueue
+                WHERE ( biblioitems.biblionumber  =  
zebraqueue.biblio_auth_number)
+                AND (zebraqueue.server = 'biblioserver' 
+                       OR zebraqueue.server = '')
+                )
+        ORDER BY biblionumber
+        ";
+    $sth = $dbh->prepare($query);
+    $sth->execute( $StartingBiblionumber, $EndingBiblionumber );
+binmode(OUT, 'utf8');
+my $i = 0;
+while ( my ($biblionumber) = $sth->fetchrow ) {
+    my $record = GetMarcBiblio($biblionumber);
+    print $i++ . "\n";
+
+    print OUT $record->as_usmarc();
+}
+
+close(OUT);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]