Upgrade to MODS 3.3 for ingest and ModsParser.pm; use an explicit format for config...
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 7 Mar 2009 21:34:43 +0000 (21:34 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 7 Mar 2009 21:34:43 +0000 (21:34 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@12464 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
Open-ILS/src/perlmods/OpenILS/Utils/ModsParser.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index 41cc532..9729532 100644 (file)
@@ -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')
                 
index 731b84d..ee41a71 100644 (file)
@@ -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 );
        }
 
index cac02de..3c088ee 100644 (file)
@@ -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
 );
index 6c7880d..802ff85 100644 (file)
@@ -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);