From a25e2b62f64013cb3adae385df5286eafea19fa0 Mon Sep 17 00:00:00 2001 From: dbs Date: Wed, 17 Sep 2008 18:38:44 +0000 Subject: [PATCH] i18nize vandelay insert statements and move them into 950.data.seed-values.sql git-svn-id: svn://svn.open-ils.org/ILS/trunk@10624 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/sql/Pg/012.schema.vandelay.sql | 131 ++++++++++--------- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 66 ++++++++++ 2 files changed, 133 insertions(+), 64 deletions(-) diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index d47d8351bf..1ba3975dc9 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -35,22 +35,6 @@ CREATE TABLE vandelay.bib_attr_definition ( ident BOOL NOT NULL DEFAULT FALSE ); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('title','Title of work','//*[@tag="245"]/*[contains("abcmnopr",@code)]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('author','Author of work','//*[@tag="100" or @tag="110" or @tag="113"]/*[contains("ad",@code)]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('language','Lanuage of work','//*[@tag="240"]/*[@code="l"][1]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('pagination','Pagination','//*[@tag="300"]/*[@code="a"][1]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident, remove ) VALUES ('isbn','ISBN','//*[@tag="020"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident, remove ) VALUES ('issn','ISSN','//*[@tag="022"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('price','Price','//*[@tag="020" or @tag="022"]/*[@code="c"][1]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Accession Number','//*[@tag="001"]', TRUE); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('eg_tcn','TCN Value','//*[@tag="901"]/*[@code="a"]', TRUE); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('eg_tcn_source','TCN Source','//*[@tag="901"]/*[@code="b"]', TRUE); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, ident ) VALUES ('eg_identifier','Internal ID','//*[@tag="901"]/*[@code="c"]', TRUE); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('publisher','Publisher','//*[@tag="260"]/*[@code="b"][1]'); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath, remove ) VALUES ('pubdate','Publication Date','//*[@tag="260"]/*[@code="c"][1]',$r$\D$r$); -INSERT INTO vandelay.bib_attr_definition ( code, description, xpath ) VALUES ('edition','Edition','//*[@tag="250"]/*[@code="a"][1]'); - - -- Each TEXT field (other than 'name') should hold an XPath predicate for pulling the data needed -- DROP TABLE vandelay.import_item_attr_definition CASCADE; CREATE TABLE vandelay.import_item_attr_definition ( @@ -83,53 +67,6 @@ CREATE TABLE vandelay.import_item_attr_definition ( CONSTRAINT vand_import_item_attr_def_idx UNIQUE (owner,name) ); -INSERT INTO vandelay.import_item_attr_definition ( - owner, name, tag, owning_lib, circ_lib, location, - call_number, circ_modifier, barcode, price, copy_number, - circulate, ref, holdable, opac_visible, status -) VALUES ( - 1, - 'Evergreen 852 export format', - '852', - '[@code = "b"][1]', - '[@code = "b"][2]', - 'c', - 'j', - 'g', - 'p', - 'y', - 't', - '[@code = "x" and text() = "circulating"]', - '[@code = "x" and text() = "reference"]', - '[@code = "x" and text() = "holdable"]', - '[@code = "x" and text() = "visible"]', - 'z' -); - -INSERT INTO vandelay.import_item_attr_definition ( - owner, - name, - tag, - owning_lib, - location, - call_number, - circ_modifier, - barcode, - price, - status -) VALUES ( - 1, - 'Unicorn Import format -- 999', - '999', - 'm', - 'l', - 'a', - 't', - 'i', - 'p', - 'k' -); - CREATE TABLE vandelay.bib_queue ( queue_type TEXT NOT NULL DEFAULT 'bib' CHECK (queue_type = 'bib'), item_attr_def TEXT REFERENCES vandelay.import_item_attr_definition (id) ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED, @@ -642,7 +579,6 @@ CREATE TABLE vandelay.authority_attr_definition ( remove TEXT NOT NULL DEFAULT '', ident BOOL NOT NULL DEFAULT FALSE ); -INSERT INTO vandelay.authority_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Identifier','//*[@tag="001"]', TRUE); CREATE TABLE vandelay.authority_queue ( queue_type TEXT NOT NULL DEFAULT 'authority' CHECK (queue_type = 'authority'), @@ -707,5 +643,72 @@ CREATE TRIGGER ingest_authority_trigger AFTER INSERT OR UPDATE ON vandelay.queued_authority_record FOR EACH ROW EXECUTE PROCEDURE vandelay.ingest_authority_marc(); +-- Vandelay (for importing and exporting records) 012.schema.vandelay.sql +/* +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (1, 'title', oils_i18n_gettext(1, 'vqbrad', 'Title of work', 'description'),'//*[@tag="245"]/*[contains("abcmnopr",@code)]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (2, 'author', oils_i18n_gettext(1, 'vqbrad', 'Author of work', 'description'),'//*[@tag="100" or @tag="110" or @tag="113"]/*[contains("ad",@code)]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (3, 'language', oils_i18n_gettext(3, 'vqbrad', 'Language of work', 'description'),'//*[@tag="240"]/*[@code="l"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (4, 'pagination', oils_i18n_gettext(4, 'vqbrad', 'Pagination', 'description'),'//*[@tag="300"]/*[@code="a"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident, remove ) VALUES (5, 'isbn',oils_i18n_gettext(5, 'vqbrad', 'ISBN', 'description'),'//*[@tag="020"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident, remove ) VALUES (6, 'issn',oils_i18n_gettext(6, 'vqbrad', 'ISSN', 'description'),'//*[@tag="022"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (7, 'price',oils_i18n_gettext(7, 'vqbrad', 'Price', 'description'),'//*[@tag="020" or @tag="022"]/*[@code="c"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (8, 'rec_identifier',oils_i18n_gettext(8, 'vqbrad', 'Accession Number', 'description'),'//*[@tag="001"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (9, 'eg_tcn',oils_i18n_gettext(9, 'vqbrad', 'TCN Value', 'description'),'//*[@tag="901"]/*[@code="a"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (10, 'eg_tcn_source',oils_i18n_gettext(10, 'vqbrad', 'TCN Source', 'description'),'//*[@tag="901"]/*[@code="b"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (11, 'eg_identifier',oils_i18n_gettext(11, 'vqbrad', 'Internal ID', 'description'),'//*[@tag="901"]/*[@code="c"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (12, 'publisher',oils_i18n_gettext(12, 'vqbrad', 'Publisher', 'description'),'//*[@tag="260"]/*[@code="b"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, remove ) VALUES (13, 'pubdate',oils_i18n_gettext(13, 'vqbrad', 'Publication Date', '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, 'vqbrad', 'Edition', 'description'),'//*[@tag="250"]/*[@code="a"][1]'); + +INSERT INTO vandelay.import_item_attr_definition ( + owner, name, tag, owning_lib, circ_lib, location, + call_number, circ_modifier, barcode, price, copy_number, + circulate, ref, holdable, opac_visible, status +) VALUES ( + 1, + 'Evergreen 852 export format', + '852', + '[@code = "b"][1]', + '[@code = "b"][2]', + 'c', + 'j', + 'g', + 'p', + 'y', + 't', + '[@code = "x" and text() = "circulating"]', + '[@code = "x" and text() = "reference"]', + '[@code = "x" and text() = "holdable"]', + '[@code = "x" and text() = "visible"]', + 'z' +); + +INSERT INTO vandelay.import_item_attr_definition ( + owner, + name, + tag, + owning_lib, + location, + call_number, + circ_modifier, + barcode, + price, + status +) VALUES ( + 1, + 'Unicorn Import format -- 999', + '999', + 'm', + 'l', + 'a', + 't', + 'i', + 'p', + 'k' +); + +INSERT INTO vandelay.authority_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Identifier','//*[@tag="001"]', TRUE); +*/ + COMMIT; 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 a83a33d4d3..261aa7849b 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -1359,3 +1359,69 @@ INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(10 INSERT INTO search.relevance_adjustment (field, bump_type, multiplier) VALUES(15, 'word_order', 10); +-- Vandelay (for importing and exporting records) 012.schema.vandelay.sql +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (1, 'title', oils_i18n_gettext(1, 'vqbrad', 'Title of work', 'description'),'//*[@tag="245"]/*[contains("abcmnopr",@code)]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (2, 'author', oils_i18n_gettext(1, 'vqbrad', 'Author of work', 'description'),'//*[@tag="100" or @tag="110" or @tag="113"]/*[contains("ad",@code)]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (3, 'language', oils_i18n_gettext(3, 'vqbrad', 'Language of work', 'description'),'//*[@tag="240"]/*[@code="l"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (4, 'pagination', oils_i18n_gettext(4, 'vqbrad', 'Pagination', 'description'),'//*[@tag="300"]/*[@code="a"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident, remove ) VALUES (5, 'isbn',oils_i18n_gettext(5, 'vqbrad', 'ISBN', 'description'),'//*[@tag="020"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident, remove ) VALUES (6, 'issn',oils_i18n_gettext(6, 'vqbrad', 'ISSN', 'description'),'//*[@tag="022"]/*[@code="a"]', TRUE, $r$(?:-|\s.+$)$r$); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (7, 'price',oils_i18n_gettext(7, 'vqbrad', 'Price', 'description'),'//*[@tag="020" or @tag="022"]/*[@code="c"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (8, 'rec_identifier',oils_i18n_gettext(8, 'vqbrad', 'Accession Number', 'description'),'//*[@tag="001"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (9, 'eg_tcn',oils_i18n_gettext(9, 'vqbrad', 'TCN Value', 'description'),'//*[@tag="901"]/*[@code="a"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (10, 'eg_tcn_source',oils_i18n_gettext(10, 'vqbrad', 'TCN Source', 'description'),'//*[@tag="901"]/*[@code="b"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, ident ) VALUES (11, 'eg_identifier',oils_i18n_gettext(11, 'vqbrad', 'Internal ID', 'description'),'//*[@tag="901"]/*[@code="c"]', TRUE); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath ) VALUES (12, 'publisher',oils_i18n_gettext(12, 'vqbrad', 'Publisher', 'description'),'//*[@tag="260"]/*[@code="b"][1]'); +INSERT INTO vandelay.bib_attr_definition ( id, code, description, xpath, remove ) VALUES (13, 'pubdate',oils_i18n_gettext(13, 'vqbrad', 'Publication Date', '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, 'vqbrad', 'Edition', 'description'),'//*[@tag="250"]/*[@code="a"][1]'); + +INSERT INTO vandelay.import_item_attr_definition ( + owner, name, tag, owning_lib, circ_lib, location, + call_number, circ_modifier, barcode, price, copy_number, + circulate, ref, holdable, opac_visible, status +) VALUES ( + 1, + 'Evergreen 852 export format', + '852', + '[@code = "b"][1]', + '[@code = "b"][2]', + 'c', + 'j', + 'g', + 'p', + 'y', + 't', + '[@code = "x" and text() = "circulating"]', + '[@code = "x" and text() = "reference"]', + '[@code = "x" and text() = "holdable"]', + '[@code = "x" and text() = "visible"]', + 'z' +); + +INSERT INTO vandelay.import_item_attr_definition ( + owner, + name, + tag, + owning_lib, + location, + call_number, + circ_modifier, + barcode, + price, + status +) VALUES ( + 1, + 'Unicorn Import format -- 999', + '999', + 'm', + 'l', + 'a', + 't', + 'i', + 'p', + 'k' +); + +INSERT INTO vandelay.authority_attr_definition ( code, description, xpath, ident ) VALUES ('rec_identifier','Identifier','//*[@tag="001"]', TRUE); + + -- 2.43.2