From: dbs Date: Sat, 7 Mar 2009 21:34:43 +0000 (+0000) Subject: Upgrade to MODS 3.3 for ingest and ModsParser.pm; use an explicit format for config... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=79c49afe4ee64855d334d1466a9f1c1f14fac452;p=Evergreen.git Upgrade to MODS 3.3 for ingest and ModsParser.pm; use an explicit format for config.metabib_field in seed data git-svn-id: svn://svn.open-ils.org/ILS/trunk@12464 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm index 41cc53247f..972953224a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm @@ -20,6 +20,7 @@ use XML::LibXSLT; use Time::HiRes qw(time); our %supported_formats = ( + mods33 => {ns => 'http://www.loc.gov/mods/v3'}, mods32 => {ns => 'http://www.loc.gov/mods/v3'}, mods3 => {ns => 'http://www.loc.gov/mods/v3'}, mods => {ns => 'http://www.loc.gov/mods/'}, @@ -74,6 +75,12 @@ sub post_init { $supported_formats{mods32}{xslt} = $xslt->parse_stylesheet( $xslt_doc ); } + unless ($supported_formats{mods33}{xslt}) { + $log->debug("Loading MODS v33 XSLT", DEBUG); + my $xslt_doc = $parser->parse_file( $xsldir . "/MARC21slim2MODS33.xsl"); + $supported_formats{mods33}{xslt} = $xslt->parse_stylesheet( $xslt_doc ); + } + my $req = OpenSRF::AppSession ->create('open-ils.cstore') diff --git a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm index 731b84d221..ee41a7101a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm +++ b/Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm @@ -321,7 +321,7 @@ sub start_mods_batch { if(!$mods_sheet) { my $xslt_doc = $parser->parse_file( - OpenSRF::Utils::SettingsClient->new->config_value(dirs => 'xsl') . "/MARC21slim2MODS32.xsl"); + OpenSRF::Utils::SettingsClient->new->config_value(dirs => 'xsl') . "/MARC21slim2MODS33.xsl"); $mods_sheet = $xslt->parse_stylesheet( $xslt_doc ); } diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index cac02de327..3c088ee2b1 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -138,7 +138,7 @@ CREATE TABLE config.metabib_field ( name TEXT NOT NULL, xpath TEXT NOT NULL, weight INT NOT NULL DEFAULT 1, - format TEXT NOT NULL DEFAULT 'mods32', + format TEXT NOT NULL DEFAULT 'mods33', search_field BOOL NOT NULL DEFAULT TRUE, facet_field BOOL NOT NULL DEFAULT FALSE ); 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 6c7880d0e8..802ff85032 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -11,38 +11,38 @@ INSERT INTO config.standing (id, value) VALUES (1, oils_i18n_gettext(1, 'Good', INSERT INTO config.standing (id, value) VALUES (2, oils_i18n_gettext(2, 'Barred', 'cst', 'value')); SELECT SETVAL('config.standing_id_seq'::TEXT, 100); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'series', 'seriestitle', $$//mods32:mods/mods32:relatedItem[@type="series"]/mods32:titleInfo$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'title', 'abbreviated', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='abbreviated')]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'title', 'translated', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='translated')]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'title', 'alternative', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='alternative')]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'title', 'uniform', $$//mods32:mods/mods32:titleInfo[mods32:title and (@type='uniform')]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'title', 'proper', $$//mods32:mods/mods32:titleInfo[mods32:title and not (@type)]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'author', 'corporate', $$//mods32:mods/mods32:name[@type='corporate']/mods32:namePart[../mods32:role/mods32:roleTerm[text()='creator']]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'author', 'personal', $$//mods32:mods/mods32:name[@type='personal']/mods32:namePart[../mods32:role/mods32:roleTerm[text()='creator']]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'author', 'conference', $$//mods32:mods/mods32:name[@type='conference']/mods32:namePart[../mods32:role/mods32:roleTerm[text()='creator']]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'author', 'other', $$//mods32:mods/mods32:name[@type='personal']/mods32:namePart[not(../mods32:role)]$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'subject', 'geographic', $$//mods32:mods/mods32:subject/mods32:geographic$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'subject', 'name', $$//mods32:mods/mods32:subject/mods32:name$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'subject', 'temporal', $$//mods32:mods/mods32:subject/mods32:temporal$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'subject', 'topic', $$//mods32:mods/mods32:subject/mods32:topic$$ ); ---INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES --- ( field_class, name, xpath ) VALUES ( 'subject', 'genre', $$//mods32:mods/mods32:genre$$ ); -INSERT INTO config.metabib_field ( field_class, name, xpath ) VALUES - ( 'keyword', 'keyword', $$//mods32:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */; +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'series', 'seriestitle', 'mods33', $$//mods33:mods/mods33:relatedItem[@type="series"]/mods33:titleInfo$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'title', 'abbreviated', 'mods33', $$//mods33:mods/mods33:titleInfo[mods33:title and (@type='abbreviated')]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'title', 'translated', 'mods33', $$//mods33:mods/mods33:titleInfo[mods33:title and (@type='translated')]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'title', 'alternative', 'mods33', $$//mods33:mods/mods33:titleInfo[mods33:title and (@type='alternative')]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'title', 'uniform', 'mods33', $$//mods33:mods/mods33:titleInfo[mods33:title and (@type='uniform')]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'title', 'proper', 'mods33', $$//mods33:mods/mods33:titleInfo[mods33:title and not (@type)]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'author', 'corporate', 'mods33', $$//mods33:mods/mods33:name[@type='corporate']/mods33:namePart[../mods33:role/mods33:roleTerm[text()='creator']]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'author', 'personal', 'mods33', $$//mods33:mods/mods33:name[@type='personal']/mods33:namePart[../mods33:role/mods33:roleTerm[text()='creator']]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'author', 'conference', 'mods33', $$//mods33:mods/mods33:name[@type='conference']/mods33:namePart[../mods33:role/mods33:roleTerm[text()='creator']]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'author', 'other', 'mods33', $$//mods33:mods/mods33:name[@type='personal']/mods33:namePart[not(../mods33:role)]$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'subject', 'geographic', 'mods33', $$//mods33:mods/mods33:subject/mods33:geographic$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'subject', 'name', 'mods33', $$//mods33:mods/mods33:subject/mods33:name$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'subject', 'temporal', 'mods33', $$//mods33:mods/mods33:subject/mods33:temporal$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'subject', 'topic', 'mods33', $$//mods33:mods/mods33:subject/mods33:topic$$ ); +--INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES +-- ( field_class, name, xpath ) VALUES ( 'subject', 'genre', 'mods33', $$//mods33:mods/mods33:genre$$ ); +INSERT INTO config.metabib_field ( field_class, name, format, xpath ) VALUES + ( 'keyword', 'keyword', 'mods33', $$//mods33:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */; INSERT INTO config.non_cataloged_type ( id, owning_lib, name ) VALUES ( 1, 1, oils_i18n_gettext(1, 'Paperback Book', 'cnct', 'name') ); SELECT SETVAL('config.non_cataloged_type_id_seq'::TEXT, 100);