From 9dff75bd1173f2f9806087752f75cae3b5108a91 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 13 Feb 2013 14:07:29 -0500 Subject: [PATCH] Z39.50 Batch Search/Overlay Seed Data Org unit setting seed data: * cat.z3950.batch.max_parallel * cat.z3950.batch.max_parallel Stock / sample seed data entries for config.z3950_index_field_map, with room added for future stock data. Vandelay bib attribute seed data for Z39.50 source (901z), which is stamped during the Z39.50 batch search-and-queue operation. Signed-off-by: Bill Erickson --- .../lib/OpenILS/Application/Search/Z3950.pm | 9 ++- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 58 +++++++++++++++++++ .../XXXX.schema.z39-batch-fetch-overlay.sql | 50 ++++++++++++++++ 3 files changed, 115 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm index e01460ade8..f9c88df6b0 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm @@ -686,8 +686,13 @@ sub stamp_and_queue_results { sub send_and_queue_bucket_searches { my ($conn, $e, $queue, $z_searches) = @_; - my $max_parallel = 5; # TODO org setting - my $search_limit = 5; # TODO org setting + my $max_parallel = $U->ou_ancestor_setting( + $e->requestor->ws_ou, + 'cat.z3950.batch.max_parallel') || 5; + + my $search_limit = $U->ou_ancestor_setting( + $e->requestor->ws_ou, + 'cat.z3950.batch.max_results') || 5; my $response = { bre_count => 0, diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 7f401cd5f9..125a4b23f3 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -4840,6 +4840,7 @@ INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, remove ) VALUES (13, 'pubdate',oils_i18n_gettext(13, 'Publication Date', 'vqbrad', 'description'),'//*[@tag="260"]/*[@code="c"][1]',$r$\D$r$); INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (14, 'edition',oils_i18n_gettext(14, 'Edition', 'vqbrad', 'description'),'//*[@tag="250"]/*[@code="a"][1]'); INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (15, 'item_barcode',oils_i18n_gettext(15, 'Item Barcode', 'vqbrad', 'description'),'//*[@tag="852"]/*[@code="p"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (16, 'zsource', oils_i18n_gettext(16, 'Z39.50 Source', 'vqbrad', 'description'), '//*[@tag="901"]/*[@code="z"]'); SELECT SETVAL('vandelay.bib_attr_definition_id_seq'::TEXT, 100); INSERT INTO vandelay.import_item_attr_definition ( @@ -12620,3 +12621,60 @@ VALUES ( 'bool' ); +INSERT INTO config.z3950_index_field_map + (id, label, metabib_field, z3950_attr_type) VALUES +(1, oils_i18n_gettext(1, 'Title', 'czifm', 'label'), 5, 'title'), +(2, oils_i18n_gettext(2, 'Author', 'czifm', 'label'), 8, 'author'), +(3, oils_i18n_gettext(3, 'ISBN', 'czifm', 'label'), 18, 'isbn'), +(4, oils_i18n_gettext(4, 'ISSN', 'czifm', 'label'), 19, 'issn'), +(5, oils_i18n_gettext(5, 'LCCN', 'czifm', 'label'), 30, 'lccn'); + +INSERT INTO config.z3950_index_field_map + (id, label, record_attr, z3950_attr_type) VALUES +(6, oils_i18n_gettext(6, 'Pubdate', 'czifm', 'label'),'pubdate', 'pubdate'), +(7, oils_i18n_gettext(7, 'Item Type', 'czifm', 'label'),'item_type', 'item_type'); + + +-- let's leave room for more stock mappings +SELECT SETVAL('config.z3950_index_field_map_id_seq'::TEXT, 1000); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES ( + 'cat.z3950.batch.max_parallel', + 'cat', + oils_i18n_gettext( + 'cat.z3950.batch.max_parallel', + 'Maximum Parallel Z39.50 Batch Searches', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'cat.z3950.batch.max_parallel', + 'The maximum number of Z39.50 searches that can be in-flight at any given time when performing batch Z39.50 searches', + 'coust', + 'description' + ), + 'integer' + ); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES ( + 'cat.z3950.batch.max_results', + 'cat', + oils_i18n_gettext( + 'cat.z3950.batch.max_results', + 'Maximum Z39.50 Batch Search Results', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'cat.z3950.batch.max_results', + 'The maximum number of search results to retrieve and queue for each record + Z39 source during batch Z39.50 searches', + 'coust', + 'description' + ), + 'integer' + ); + diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.z39-batch-fetch-overlay.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.z39-batch-fetch-overlay.sql index 8edf2986b3..7bfaac3cde 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.z39-batch-fetch-overlay.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.z39-batch-fetch-overlay.sql @@ -49,4 +49,54 @@ INSERT INTO config.z3950_index_field_map -- let's leave room for more stock mappings SELECT SETVAL('config.z3950_index_field_map_id_seq'::TEXT, 1000); +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES ( + 'cat.z3950.batch.max_parallel', + 'cat', + oils_i18n_gettext( + 'cat.z3950.batch.max_parallel', + 'Maximum Parallel Z39.50 Batch Searches', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'cat.z3950.batch.max_parallel', + 'The maximum number of Z39.50 searches that can be in-flight at any given time when performing batch Z39.50 searches', + 'coust', + 'description' + ), + 'integer' + ); + +INSERT INTO config.org_unit_setting_type + (name, grp, label, description, datatype) + VALUES ( + 'cat.z3950.batch.max_results', + 'cat', + oils_i18n_gettext( + 'cat.z3950.batch.max_results', + 'Maximum Z39.50 Batch Search Results', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'cat.z3950.batch.max_results', + 'The maximum number of search results to retrieve and queue for each record + Z39 source during batch Z39.50 searches', + 'coust', + 'description' + ), + 'integer' + ); + +INSERT INTO vandelay.bib_attr_definition (id, code, description, xpath) + VALUES ( + 16, + 'zsource', + oils_i18n_gettext(16, 'Z39.50 Source', 'vqbrad', 'description'), + '//*[@tag="901"]/*[@code="z"]' + ); + + + COMMIT; -- 2.43.2