From: miker Date: Fri, 5 Sep 2008 12:05:24 +0000 (+0000) Subject: cleaning up the Evergreen repo area; adding Overlay as an option to Vandelay upload... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0e43a8f89835c166468956031f3194a5ab8051f0;p=Evergreen.git cleaning up the Evergreen repo area; adding Overlay as an option to Vandelay upload; fix thinko in in-db circ to load the circ test git-svn-id: svn://svn.open-ils.org/ILS/trunk@10540 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Evergreen/src/extras/import/object_dumper.pl b/Evergreen/src/extras/import/object_dumper.pl deleted file mode 100755 index 0f69ca42f8..0000000000 --- a/Evergreen/src/extras/import/object_dumper.pl +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/perl -# --------------------------------------------------------------------- -# Generic databse object dumper. -# ./object_dumper.pl , , ... -# ./object_dumper.pl /openils/conf/opensrf_core.xml permission.grp_tree -# --------------------------------------------------------------------- - -use strict; -use warnings; -use OpenSRF::Utils::JSON; -use OpenSRF::System; -use OpenILS::Utils::Fieldmapper; -use OpenSRF::Utils::SettingsClient; - -my $config = shift || die "bootstrap config required\n"; - -OpenSRF::System->bootstrap_client( config_file => $config ); -Fieldmapper->import; - -require OpenILS::Utils::CStoreEditor; -my $e = OpenILS::Utils::CStoreEditor->new; - -for my $t (@ARGV) { - $t =~ s/\./_/og; - my $m = "retrieve_all_$t"; - my $d = $e->$m(); - print OpenSRF::Utils::JSON->perl2JSON($_) . "\n" for @$d; -} diff --git a/Evergreen/src/extras/import/quick_metarecord_map.sql b/Evergreen/src/extras/import/quick_metarecord_map.sql deleted file mode 100644 index f058a4dee4..0000000000 --- a/Evergreen/src/extras/import/quick_metarecord_map.sql +++ /dev/null @@ -1,31 +0,0 @@ -BEGIN; - -ALTER TABLE metabib.metarecord_source_map DROP CONSTRAINT metabib_metarecord_source_map_metarecord_fkey; - -TRUNCATE metabib.metarecord; -TRUNCATE metabib.metarecord_source_map; - -INSERT INTO metabib.metarecord (fingerprint,master_record) - SELECT fingerprint,id - FROM (SELECT DISTINCT ON (fingerprint) - fingerprint, id, quality - FROM biblio.record_entry - ORDER BY fingerprint, quality desc) AS x - WHERE fingerprint IS NOT NULL; - -INSERT INTO metabib.metarecord_source_map (metarecord,source) - SELECT m.id, b.id - FROM biblio.record_entry b - JOIN metabib.metarecord m ON (m.fingerprint = b.fingerprint); - -COMMIT; - -BEGIN; - -ALTER TABLE metabib.metarecord_source_map ADD CONSTRAINT metabib_metarecord_source_map_metarecord_fkey FOREIGN KEY (metarecord) REFERENCES metabib.metarecord (id) DEFERRABLE INITIALLY DEFERRED; - -COMMIT; - -VACUUM FULL ANALYZE VERBOSE metabib.metarecord; -VACUUM FULL ANALYZE VERBOSE metabib.metarecord_source_map; - diff --git a/Evergreen/src/extras/import/user_import.pl b/Evergreen/src/extras/import/user_import.pl deleted file mode 100755 index 9031468088..0000000000 --- a/Evergreen/src/extras/import/user_import.pl +++ /dev/null @@ -1,70 +0,0 @@ -#!/usr/bin/perl - -use strict; -use Data::Dumper; - -while () { - chomp; - my @parts = split '\|'; -# @parts = @parts[ -# PRIV_EXP_DATE CREATION_DATE PRIV_GRANT_DATE DELINQ_STATUS -# 3, 4, 5, 7, -# -# USER_BARCODE PROFILE COUNTY(CAT1) BIRTH_YEAR -# 10, 12, 13, 15, -# -# HOME_LIB ZIP ALTID ADDRESS1 -# 16, 17, 18, 19, -# -# ADDRESS2 PHONE EMAIL NAME -# 20, 21, 22, 23, -# -# NUM_CLAIMED_RETURNED -# 24 -# ]; - - my $addr = parse_addr(@parts[19,20]); - - $$addr{county} = $parts[13]; - $$addr{zip} ||= $parts[17]; - - print Dumper($addr); -} - -sub parse_addr { - my $addr1 = shift; - my $addr2 = shift; - - $addr1 =~ s/^\s*(.+)\s*$/$1/gso; - $addr2 =~ s/^\s*(.+)\s*$/$1/gso; - - $addr1 =~ s/\s+/ /gso; - $addr2 =~ s/\s+/ /gso; - - my %hash; - - if ($addr1 =~ /^(\d+\s+[^,]+)/o) { - $hash{address1} = $1; - if ($addr1 =~ /,\s+(.+)$/o) { - my $a2 = $1; - if ($a2 =~ /^(\w{2})\.?\s+(\d+)$/o) { - $hash{state} = uc($1); - $hash{zip} = $2; - } elsif (lc($a2) !~ /^(?:s\.?e\.?|s\.?w\.?|n\.?e\.?|n\.?w\.?|south|north|east|west|n\.?|s\.?|e\.?|w\.?)$/) { - $hash{address2} = $a2; - } else { - $hash{address1} .= " $a2"; - } - } - } else { - $hash{address1} = $addr1; - } - - if ($addr2 =~ /^([^,]+),\s*(\w{2}).*\s+(\w+)$/o) { - $hash{city} = $1; - $hash{state} = uc($2); - $hash{zip} = $3; - } - - return \%hash; -} diff --git a/Evergreen/src/extras/report-fail b/Evergreen/src/extras/report-fail deleted file mode 100644 index 496da93949..0000000000 --- a/Evergreen/src/extras/report-fail +++ /dev/null @@ -1,20 +0,0 @@ -To: {TO} -From: {FROM} -Reply-To: {REPLY_TO} -Subject: Report Failure Notification - -Your report, named [{REPORT_NAME}], was scheduled to run at {RUN_TIME} has failed with the following error message: - - {ERROR_TEXT} - -The SQL command attempted was: - - {SQL} - -If you are unsure of the meaning of this message, please contact PINES staff -and give them both the error message and the SQL command. - -Thanks, - -Clark Kent, your friendly neighorhood reporter. - diff --git a/Evergreen/src/extras/report-success b/Evergreen/src/extras/report-success deleted file mode 100644 index 38212df0d4..0000000000 --- a/Evergreen/src/extras/report-success +++ /dev/null @@ -1,16 +0,0 @@ -To: {TO} -From: {FROM} -Reply-To: {REPLY_TO} -Subject: Report Completion Notification - -Your report, named [{REPORT_NAME}], was scheduled to run at {RUN_TIME} and completed at {COMPLETE_TIME}. -It is available for viewing at the following URL: - - {OUTPUT_URL} - -If you have any general questions, please contact the PINES staff. - -Thanks, - -Clark Kent, your friendly neighorhood reporter. - diff --git a/Open-ILS/src/extras/import/quick_metarecord_map.sql b/Open-ILS/src/extras/import/quick_metarecord_map.sql new file mode 100644 index 0000000000..f058a4dee4 --- /dev/null +++ b/Open-ILS/src/extras/import/quick_metarecord_map.sql @@ -0,0 +1,31 @@ +BEGIN; + +ALTER TABLE metabib.metarecord_source_map DROP CONSTRAINT metabib_metarecord_source_map_metarecord_fkey; + +TRUNCATE metabib.metarecord; +TRUNCATE metabib.metarecord_source_map; + +INSERT INTO metabib.metarecord (fingerprint,master_record) + SELECT fingerprint,id + FROM (SELECT DISTINCT ON (fingerprint) + fingerprint, id, quality + FROM biblio.record_entry + ORDER BY fingerprint, quality desc) AS x + WHERE fingerprint IS NOT NULL; + +INSERT INTO metabib.metarecord_source_map (metarecord,source) + SELECT m.id, b.id + FROM biblio.record_entry b + JOIN metabib.metarecord m ON (m.fingerprint = b.fingerprint); + +COMMIT; + +BEGIN; + +ALTER TABLE metabib.metarecord_source_map ADD CONSTRAINT metabib_metarecord_source_map_metarecord_fkey FOREIGN KEY (metarecord) REFERENCES metabib.metarecord (id) DEFERRABLE INITIALLY DEFERRED; + +COMMIT; + +VACUUM FULL ANALYZE VERBOSE metabib.metarecord; +VACUUM FULL ANALYZE VERBOSE metabib.metarecord_source_map; + diff --git a/Open-ILS/src/extras/import/user_import.pl b/Open-ILS/src/extras/import/user_import.pl new file mode 100755 index 0000000000..9031468088 --- /dev/null +++ b/Open-ILS/src/extras/import/user_import.pl @@ -0,0 +1,70 @@ +#!/usr/bin/perl + +use strict; +use Data::Dumper; + +while () { + chomp; + my @parts = split '\|'; +# @parts = @parts[ +# PRIV_EXP_DATE CREATION_DATE PRIV_GRANT_DATE DELINQ_STATUS +# 3, 4, 5, 7, +# +# USER_BARCODE PROFILE COUNTY(CAT1) BIRTH_YEAR +# 10, 12, 13, 15, +# +# HOME_LIB ZIP ALTID ADDRESS1 +# 16, 17, 18, 19, +# +# ADDRESS2 PHONE EMAIL NAME +# 20, 21, 22, 23, +# +# NUM_CLAIMED_RETURNED +# 24 +# ]; + + my $addr = parse_addr(@parts[19,20]); + + $$addr{county} = $parts[13]; + $$addr{zip} ||= $parts[17]; + + print Dumper($addr); +} + +sub parse_addr { + my $addr1 = shift; + my $addr2 = shift; + + $addr1 =~ s/^\s*(.+)\s*$/$1/gso; + $addr2 =~ s/^\s*(.+)\s*$/$1/gso; + + $addr1 =~ s/\s+/ /gso; + $addr2 =~ s/\s+/ /gso; + + my %hash; + + if ($addr1 =~ /^(\d+\s+[^,]+)/o) { + $hash{address1} = $1; + if ($addr1 =~ /,\s+(.+)$/o) { + my $a2 = $1; + if ($a2 =~ /^(\w{2})\.?\s+(\d+)$/o) { + $hash{state} = uc($1); + $hash{zip} = $2; + } elsif (lc($a2) !~ /^(?:s\.?e\.?|s\.?w\.?|n\.?e\.?|n\.?w\.?|south|north|east|west|n\.?|s\.?|e\.?|w\.?)$/) { + $hash{address2} = $a2; + } else { + $hash{address1} .= " $a2"; + } + } + } else { + $hash{address1} = $addr1; + } + + if ($addr2 =~ /^([^,]+),\s*(\w{2}).*\s+(\w+)$/o) { + $hash{city} = $1; + $hash{state} = uc($2); + $hash{zip} = $3; + } + + return \%hash; +} diff --git a/Open-ILS/src/extras/report-fail b/Open-ILS/src/extras/report-fail new file mode 100644 index 0000000000..496da93949 --- /dev/null +++ b/Open-ILS/src/extras/report-fail @@ -0,0 +1,20 @@ +To: {TO} +From: {FROM} +Reply-To: {REPLY_TO} +Subject: Report Failure Notification + +Your report, named [{REPORT_NAME}], was scheduled to run at {RUN_TIME} has failed with the following error message: + + {ERROR_TEXT} + +The SQL command attempted was: + + {SQL} + +If you are unsure of the meaning of this message, please contact PINES staff +and give them both the error message and the SQL command. + +Thanks, + +Clark Kent, your friendly neighorhood reporter. + diff --git a/Open-ILS/src/extras/report-success b/Open-ILS/src/extras/report-success new file mode 100644 index 0000000000..38212df0d4 --- /dev/null +++ b/Open-ILS/src/extras/report-success @@ -0,0 +1,16 @@ +To: {TO} +From: {FROM} +Reply-To: {REPLY_TO} +Subject: Report Completion Notification + +Your report, named [{REPORT_NAME}], was scheduled to run at {RUN_TIME} and completed at {COMPLETE_TIME}. +It is available for viewing at the following URL: + + {OUTPUT_URL} + +If you have any general questions, please contact the PINES staff. + +Thanks, + +Clark Kent, your friendly neighorhood reporter. + diff --git a/Open-ILS/src/sql/Pg/100.circ_matrix.sql b/Open-ILS/src/sql/Pg/100.circ_matrix.sql index 1aa7d69f81..50593513f0 100644 --- a/Open-ILS/src/sql/Pg/100.circ_matrix.sql +++ b/Open-ILS/src/sql/Pg/100.circ_matrix.sql @@ -288,6 +288,8 @@ BEGIN SELECT INTO matchpoint_id action.find_circ_matrix_matchpoint(circ_ou, match_item, match_user, renewal); result.matchpoint := matchpoint_id; + SELECT INTO circ_test * from config.circ_matrix_test WHERE matchpoint = result.matchpoint; + -- Fail if we couldn't find a set of tests IF result.matchpoint IS NULL THEN result.fail_part := 'no_matchpoint'; diff --git a/Open-ILS/src/support-scripts/object_dumper.pl b/Open-ILS/src/support-scripts/object_dumper.pl new file mode 100755 index 0000000000..0f69ca42f8 --- /dev/null +++ b/Open-ILS/src/support-scripts/object_dumper.pl @@ -0,0 +1,28 @@ +#!/usr/bin/perl +# --------------------------------------------------------------------- +# Generic databse object dumper. +# ./object_dumper.pl , , ... +# ./object_dumper.pl /openils/conf/opensrf_core.xml permission.grp_tree +# --------------------------------------------------------------------- + +use strict; +use warnings; +use OpenSRF::Utils::JSON; +use OpenSRF::System; +use OpenILS::Utils::Fieldmapper; +use OpenSRF::Utils::SettingsClient; + +my $config = shift || die "bootstrap config required\n"; + +OpenSRF::System->bootstrap_client( config_file => $config ); +Fieldmapper->import; + +require OpenILS::Utils::CStoreEditor; +my $e = OpenILS::Utils::CStoreEditor->new; + +for my $t (@ARGV) { + $t =~ s/\./_/og; + my $m = "retrieve_all_$t"; + my $d = $e->$m(); + print OpenSRF::Utils::JSON->perl2JSON($_) . "\n" for @$d; +} diff --git a/Open-ILS/web/vandelay/vandelay.html b/Open-ILS/web/vandelay/vandelay.html index 415a6a2e79..c83303b74e 100644 --- a/Open-ILS/web/vandelay/vandelay.html +++ b/Open-ILS/web/vandelay/vandelay.html @@ -73,6 +73,7 @@