LP#1727487 Display field seed data WIP
authorBill Erickson <berickxx@gmail.com>
Thu, 26 Oct 2017 15:19:51 +0000 (11:19 -0400)
committerBill Erickson <berickxx@gmail.com>
Fri, 10 Nov 2017 14:57:03 +0000 (09:57 -0500)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/sql/Pg/upgrade/XXXX.data.display-field-seed-data.sql

index 353be11..4242956 100644 (file)
@@ -3819,6 +3819,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field name="subject_topic" reporter:label="Topic Subject" reporter:datatype="text"/>
                        <field name="abstract" reporter:label="Abstract" reporter:datatype="text"/>
                        <field name="toc" reporter:label="Table of Contents" reporter:datatype="text"/>
+                       <field name="pubdate" reporter:label="Publication Date" reporter:datatype="text"/>
                        <field name="type_of_resource" reporter:label="Type of Resource" reporter:datatype="text"/>
                </fields>
                <links>
index 9c61bc0..e21bb65 100644 (file)
@@ -58,6 +58,16 @@ VALUES (
     TRUE, FALSE, FALSE
 );
 
+INSERT INTO config.metabib_field (id, field_class, name, 
+    label, xpath, display_field, search_field, browse_field)
+VALUES (
+    44, 'identifier', 'pubdate', 
+    oils_i18n_gettext(44, 'Publication Date', 'cmf', 'label'),
+    $$//mods33:mods/mods33:originInfo//mods33:dateIssued[@encoding="marc"]|//mods33:mods/mods33:originInfo//mods33:dateIssued[1]$$,
+    TRUE, FALSE, FALSE
+);
+
+
 -- Modify existing config.metabib_field entries
 
 UPDATE config.metabib_field SET display_field = TRUE WHERE id IN (
@@ -87,7 +97,8 @@ INSERT INTO config.display_field_map (name, field, multi) VALUES
     ('publisher',           40, FALSE),
     ('abstract',            41, FALSE),
     ('toc',                 42, FALSE),
-    ('type_of_resource',    43, FALSE)
+    ('type_of_resource',    43, FALSE),
+    ('pubdate',             44, FALSE)
 ;
 
 -- Add a column to wide-display-entry per well-known field
@@ -113,6 +124,7 @@ CREATE VIEW metabib.wide_display_entry AS
         COALESCE(mcde_seriestitle.value, 'null') AS seriestitle,
         COALESCE(mcde_abstract.value, 'null') AS abstract,
         COALESCE(mcde_toc.value, 'null') AS toc,
+        COALESCE(mcde_pubdate.value, 'null') AS pubdate,
         COALESCE(mcde_type_of_resource.value, 'null') AS type_of_resource
     FROM biblio.record_entry bre 
     LEFT JOIN metabib.compressed_display_entry mcde_title 
@@ -156,6 +168,8 @@ CREATE VIEW metabib.wide_display_entry AS
         ON (bre.id = mcde_abstract.source AND mcde_abstract.name = 'abstract')
     LEFT JOIN metabib.compressed_display_entry mcde_toc 
         ON (bre.id = mcde_toc.source AND mcde_toc.name = 'toc')
+    LEFT JOIN metabib.compressed_display_entry mcde_pubdate 
+        ON (bre.id = mcde_pubdate.source AND mcde_pubdate.name = 'pubdate')
     LEFT JOIN metabib.compressed_display_entry mcde_type_of_resource 
         ON (bre.id = mcde_type_of_resource.source 
             AND mcde_type_of_resource.name = 'type_of_resource')
@@ -166,9 +180,9 @@ COMMIT;
 /** ROLLBACK 
 
 BEGIN;
-DELETE FROM metabib.display_entry WHERE field IN (1,11,12,13,14,19,20,26,38,39,40,41,42,43);
-DELETE FROM config.display_field_map WHERE field IN (1,11,12,13,14,19,20,26,38,39,40,41,42,43);
-DELETE FROM config.metabib_field WHERE id IN (38,39,40,41,42,43);
+DELETE FROM metabib.display_entry WHERE field IN (1,11,12,13,14,19,20,26,38,39,40,41,42,43,44);
+DELETE FROM config.display_field_map WHERE field IN (1,11,12,13,14,19,20,26,38,39,40,41,42,43,44);
+DELETE FROM config.metabib_field WHERE id IN (38,39,40,41,42,43,44);
 COMMIT;
 
 */