From: Mike Rylander Date: Mon, 11 Apr 2011 01:33:40 +0000 (-0400) Subject: Actually use authority.rec_descriptor, populating it with RecStat, ELvl and Subj... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bfed0299bd167da616b8960d96c1fc8bda1754a1;p=evergreen%2Fmasslnc.git Actually use authority.rec_descriptor, populating it with RecStat, ELvl and Subj (aka Thesaurus) --- diff --git a/Open-ILS/src/sql/Pg/011.schema.authority.sql b/Open-ILS/src/sql/Pg/011.schema.authority.sql index d2e57956c3..ab083ea77c 100644 --- a/Open-ILS/src/sql/Pg/011.schema.authority.sql +++ b/Open-ILS/src/sql/Pg/011.schema.authority.sql @@ -98,7 +98,7 @@ CREATE TABLE authority.rec_descriptor ( id BIGSERIAL PRIMARY KEY, record BIGINT, record_status TEXT, - char_encoding TEXT, + encoding_level TEXT, thesaurus TEXT ); CREATE INDEX authority_rec_descriptor_record_idx ON authority.rec_descriptor (record); 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 fbe3e65412..2c38927f8c 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -3284,6 +3284,8 @@ INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('MAP', INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('SCO','cd','abcdmsi'); INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('REC','ij','abcdmsi'); INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('COM','m','abcdmsi'); +INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('AUT','z',' '); +INSERT INTO config.marc21_rec_type_map (code, type_val, blvl_val) VALUES ('MFHD','uvxy',' '); ------ Physical Characteristics @@ -4107,6 +4109,7 @@ INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, leng INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('ELvl', 'ldr', 'SCO', 17, 1, ' '); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('ELvl', 'ldr', 'SER', 17, 1, ' '); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('ELvl', 'ldr', 'VIS', 17, 1, ' '); +INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('ELvl', 'ldr', 'AUT', 17, 1, ' '); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Fest', '006', 'BKS', 13, 1, '0'); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Fest', '008', 'BKS', 30, 1, '0'); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Form', '006', 'BKS', 6, 1, ' '); @@ -4169,6 +4172,8 @@ INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, leng INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Type', 'ldr', 'SCO', 6, 1, 'c'); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Type', 'ldr', 'SER', 6, 1, 'a'); INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Type', 'ldr', 'VIS', 6, 1, 'g'); +INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('Subj', '008', 'AUT', 11, 1, '|'); +INSERT INTO config.marc21_ff_pos_map (fixed_field, tag, rec_type,start_pos, length, default_val) VALUES ('RecStat', 'ldr', 'AUT', 5, 1, 'n'); -- record attributes INSERT INTO config.record_attr_definition (name,label,fixed_field) values ('alph','Alph','Alph'); diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql index f1ea7766e1..553223ab18 100644 --- a/Open-ILS/src/sql/Pg/999.functions.global.sql +++ b/Open-ILS/src/sql/Pg/999.functions.global.sql @@ -1440,9 +1440,13 @@ $func$ LANGUAGE PLPGSQL; CREATE OR REPLACE FUNCTION authority.reingest_authority_rec_descriptor( auth_id BIGINT ) RETURNS VOID AS $func$ BEGIN DELETE FROM authority.rec_descriptor WHERE record = auth_id; --- INSERT INTO authority.rec_descriptor (record, record_status, char_encoding, thesaurus) --- SELECT auth_id, ; - + INSERT INTO authority.rec_descriptor (record, record_status, encoding_level, thesaurus) + SELECT auth_id, + vandelay.marc21_extract_fixed_field(marc,'RecStat'), + vandelay.marc21_extract_fixed_field(marc,'ELvl'), + vandelay.marc21_extract_fixed_field(marc,'Subj') + FROM authority.record + WHERE id = auth_id; RETURN; END; $func$ LANGUAGE PLPGSQL; @@ -1482,11 +1486,10 @@ BEGIN PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_authority_full_rec' AND enabled; IF NOT FOUND THEN PERFORM authority.reingest_authority_full_rec(NEW.id); --- authority.rec_descriptor is not currently used --- PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_authority_rec_descriptor' AND enabled; --- IF NOT FOUND THEN --- PERFORM authority.reingest_authority_rec_descriptor(NEW.id); --- END IF; + PERFORM * FROM config.internal_flag WHERE name = 'ingest.disable_authority_rec_descriptor' AND enabled; + IF NOT FOUND THEN + PERFORM authority.reingest_authority_rec_descriptor(NEW.id); + END IF; END IF; RETURN NEW;