syncing cvs with the real world
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jul 2005 13:37:54 +0000 (13:37 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 7 Jul 2005 13:37:54 +0000 (13:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1089 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/src/extras/import/import_clean_marc.pl
Evergreen/src/extras/import/import_holdings.pl
Evergreen/src/extras/import/pg-drop-create.sh
Evergreen/src/extras/import/pines_libs.txt
Open-ILS/src/extras/import/build-oils-db.sh
Open-ILS/src/extras/import/cleanse-usmarc.sh
Open-ILS/src/extras/import/extract-holdings.sh
Open-ILS/src/extras/import/generate-srfsh-wormer.pl
Open-ILS/src/sql/Postgres/build-db-Postgres.sh

index ac06eeb..2c45eb2 100755 (executable)
@@ -9,12 +9,11 @@ use open qw/:utf8/;
 
 $|=1;
 
-my ($userid, $sourceid, $rec_id, $entry_file, $marc_file, $map_file) = (1, 2, 1, 'record_entry.sql','record_marc.sql','record_id_map.pl');
+my ($userid, $sourceid, $rec_id, $entry_file, $map_file) = (1, 2, 1, 'record_entry.sql','record_id_map.pl');
 
 GetOptions (   
        "sourceid"              => \$sourceid,
        "entry_file=s"          => \$entry_file,
-       "marc_file=s"           => \$marc_file,
        "tcn_map_file=s"        => \$map_file,
        "userid=i"              => \$userid,
        "first=i"               => \$rec_id,
@@ -23,16 +22,10 @@ GetOptions (
 my $tcn_map;
 
 open RE, ">$entry_file" or die "Can't open $entry_file!  $!\n";
-open RM, ">$marc_file" or die "Can't open $marc_file!  $!\n";
 
 print RE <<SQL;
 SET CLIENT_ENCODING TO 'UNICODE';
-COPY biblio.record_entry (id,editor,creator,source,tcn_value,last_xact_id) FROM STDIN;
-SQL
-
-print RM <<SQL;
-SET CLIENT_ENCODING TO 'UNICODE';
-COPY biblio.record_marc (id,marc,last_xact_id) FROM STDIN;
+COPY biblio.record_entry (id,editor,creator,source,tcn_value,marc,last_xact_id) FROM STDIN;
 SQL
 
 my $xact_id = time;
@@ -78,8 +71,7 @@ while ( $xml .= <STDIN> ) {
        print ".";
        $$tcn_map{$tcn} = $rec_id;
 
-       print RE join("\t", ($rec_id,$userid,$userid,$sourceid,$tcn,$xact_id))."\n";
-       print RM join("\t", ($rec_id,$xml,$xact_id))."\n";
+       print RE join("\t", ($rec_id,$userid,$userid,$sourceid,$tcn,$xml,$xact_id))."\n";
 
        $rec_id++;
        $xml = '';
@@ -87,7 +79,6 @@ while ( $xml .= <STDIN> ) {
 
 print RE "\\.\n";
 print RE "SELECT setval('biblio.record_entry_id_seq'::TEXT, $rec_id);\n";
-print RM "\\.\n";
 
 open MAP, ">$map_file" or die "Can't open $map_file!  $!\n";
 print MAP Data::Dumper->Dump([$tcn_map],['tcn_map']);
index 10e8d9b..f76f88b 100755 (executable)
@@ -32,10 +32,27 @@ eval `cat $lib_map_file`;
 open CP, ">$cp_file" or die "Can't open $cp_file!  $!\n";
 open CN, ">$cn_file" or die "Can't open $cn_file!  $!\n";
 
+my %status_map = (
+       ''              => 0,
+       CHECKEDOUT      => 1,
+       BINDERY         => 2,
+       LOST            => 3,
+       MISSING         => 4,
+       INPROCESS       => 5,
+       INTRANSIT       => 6,
+       RESHELVING      => 7,
+       'ON HOLDS SHELF' => 8,
+       'ON-ORDER'      => 9,
+       ILL             => 10,
+       CATALOGING      => 11,
+       RESERVES        => 12,
+       DISCARD         => 13,
+);
+
 
 print CP <<SQL;
 SET CLIENT_ENCODING TO 'UNICODE';
-COPY asset.copy (id,editor,creator,barcode,call_number,copy_number,available,loan_duration,fine_level,circulate,deposit,deposit_amount,price,ref,opac_visible) FROM STDIN;
+COPY asset.copy (id,circ_lib,editor,creator,barcode,call_number,copy_number,status,loan_duration,fine_level,circulate,deposit,deposit_amount,price,ref,opac_visible) FROM STDIN;
 SQL
 
 print CN <<SQL;
@@ -90,7 +107,9 @@ while ( $xml .= <STDIN> ) {
                my $owning_lib = $$lib_map{ $node->findvalue( '*[@code="m"]' ) };
                my $price = $node->findvalue( '*[@code="p"]' );
                my $copy_number = $node->findvalue( '*[@code="c"]' );
-               my $available = $node->findvalue( '*[@code="k"]' ) ? 1 : 0;
+               my $available = $node->findvalue( '*[@code="k"]' ) || '';
+
+               my $status = $status_map{$available} || 0;
 
                next unless $barcode;
                next unless $owning_lib;
@@ -112,9 +131,9 @@ while ( $xml .= <STDIN> ) {
 
 # id,editor,creator,barcode,call_number,copy_number,available,loan_duration,fine_level,circulate,deposit,deposit_amount,price,ref,opac_visible
 
-               print CP join("\t", (   $cp_id,$userid,$userid,$barcode,
+               print CP join("\t", (   $cp_id,$owning_lib,$userid,$userid,$barcode,
                                        $$cn_map{"$rec_id/$owning_lib/$label"},
-                                       $copy_number,$available,2,2,1,0,'0.00',
+                                       $copy_number,$status,2,2,1,0,'0.00',
                                        $price,0,1 )
                         )."\n";
                print 'c';
index 71ac9ad..2e4cd55 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
-dropdb open-ils-utf8-dev
-createdb -E UNICODE open-ils-utf8-dev
+dropdb demo-dev
+createdb -E UNICODE demo-dev
index d749eb0..a27cfde 100644 (file)
@@ -54,14 +54,14 @@ ECGR-BKM    Bookmobile      East Central Georgia Regional Library
 ECGR-BURKE     Burke County Library    East Central Georgia Regional Library
 ECGR-EUCHE     Euchee Creek Library    East Central Georgia Regional Library
 ECGR-FRMAN     Friedman Branch Library East Central Georgia Regional Library
-ECGR-GIBBS     Columbia County Libraries/Gibbs Memorial        East Central Georgia Regional Library
+ECGR-GIBBS     Gibbs Memorial  East Central Georgia Regional Library
 ECGR-GLSCK     Glascock County Library East Central Georgia Regional Library
 ECGR-HARLM     Harlem Branch Library   East Central Georgia Regional Library
 ECGR-LINCN     Lincoln County Library  East Central Georgia Regional Library
 ECGR-MAIN      Augusta-Richmond County Public Library  East Central Georgia Regional Library
 ECGR-MIDVL     Midville Branch Library East Central Georgia Regional Library
 ECGR-MXWLL     Maxwell Branch Library  East Central Georgia Regional Library
-ECGR-SOAUG     South Augusta Branch Library/ Diamond Lakes Branch Library      East Central Georgia Regional Library
+ECGR-SOAUG     Diamond Lakes Branch Library    East Central Georgia Regional Library
 ECGR-SRDIS     Sardis Branch Library   East Central Georgia Regional Library
 ECGR-WALLC     Wallace Branch Library  East Central Georgia Regional Library
 ECGR-WARRN     Warren County Library   East Central Georgia Regional Library
@@ -135,9 +135,9 @@ MRLS-UCPL   Union County Public Library     Mountain Regional Library
 NCLS-COVTN     Newton County Library Headqtrs. Newton County Library System
 NEG-BKMB       Bookmobile--See Clarkesville-Habersham Co.      Northeast Georgia Regional Library
 NEG-CLRKVL     Clarkesville-Habersham County Library   Northeast Georgia Regional Library
-NEG-CLVLND     "White County Library, Cleveland Branch"        Northeast Georgia Regional Library
+NEG-CLVLND     White County Library, Cleveland Branch  Northeast Georgia Regional Library
 NEG-CORNEL     Cornelia-Habersham Library      Northeast Georgia Regional Library
-NEG-HELEN      "White County Library, Helen Branch"    Northeast Georgia Regional Library
+NEG-HELEN      White County Library, Helen Branch      Northeast Georgia Regional Library
 NEG-RABUN      Rabun County Library    Northeast Georgia Regional Library
 NEG-TOCCOA     Toccoa-Stephens County Library  Northeast Georgia Regional Library
 OCRL-DUBLN     Oconee Regional Library Oconee Regional Library
index c4f291a..844f5b3 100755 (executable)
@@ -9,8 +9,8 @@ PWD=`pwd`
 WD=`dirname $0`
 
 (
-       echo "cd $PWD/$WD/../../sql/$2/;"
-       cd $PWD/$WD/../../sql/$2/;
+       echo "cd $WD/../../sql/$2/;"
+       cd $WD/../../sql/$2/;
        pwd
        ./build-db-$2.sh $1 $3 $4
 )
index 1ab608f..631901b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-DUMPER=../marcdumper/marcdumper
+DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper
 
 
 $DUMPER -X -f MARC8 -t UTF8 -r '/*/*[@tag="999"]' $*
index 09204db..d270748 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-DUMPER=../marcdumper/marcdumper
+DUMPER=/home/miker/cvs/ILS/Open-ILS/src/extras/import/../marcdumper/marcdumper
 
 
 $DUMPER -X -f MARC8 -t UTF8 -r '/*/*[(local-name()="datafield" and (@tag!="035" and @tag!="999")) or local-name()!="datafield"]' $*
index e3d4120..16f76b7 100755 (executable)
@@ -20,7 +20,7 @@ for my $i ( $start .. $stop ) {
                push @list, $i;
                next;
        }
-       print SFSH "request open-ils.storage open-ils.worm.wormize.batch ".join(',', @list)."\n" if (@list);
+       print SFSH "request open-ils.storage open-ils.worm.wormize.no_map.batch ".join(',', @list)."\n" if (@list);
        @list = ($i);
 }
-print SFSH "request open-ils.storage open-ils.worm.wormize.batch ".join(',', @list)."\n" if (@list);
+print SFSH "request open-ils.storage open-ils.worm.wormize.no_map.no_map.batch ".join(',', @list)."\n" if (@list);
index 74a63f9..1bd2daf 100755 (executable)
@@ -9,5 +9,5 @@ psql -U $1 -d $2 -f 040.schema.asset.sql
 psql -U $1 -d $2 -f 080.schema.money.sql
 psql -U $1 -d $2 -f 090.schema.action.sql
 
-psql -U $1 -d $2 -f 800.fkeys.sql
-psql -U $1 -d $2 -f 900.audit-tables.sql
+#psql -U $1 -d $2 -f 800.fkeys.sql
+#psql -U $1 -d $2 -f 900.audit-tables.sql