Add display_field column to config.metabib_field
authorDan Scott <dan@coffeecode.net>
Mon, 27 Jun 2011 20:53:55 +0000 (16:53 -0400)
committerLiam Darragh Whalen <ldw@ldw-laptop.(none)>
Thu, 8 Dec 2011 20:23:59 +0000 (15:23 -0500)
The idea is to pull the XPath definitions and i18nized labels for
config.metabib_field entries into other contexts, to avoid duplicate /
conflicting defintions in different layers of the code. If display_field
is TRUE, then it is a signal that it could be usefully exposed to users.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/950.data.seed-values.sql

index ec1cac6..cc1011c 100644 (file)
@@ -2071,6 +2071,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
                        <field reporter:label="Search Field" name="search_field" reporter:datatype="bool" />
                        <field reporter:label="Facet Field" name="facet_field" reporter:datatype="bool" />
                        <field reporter:label="Facet XPath" name="facet_xpath" reporter:datatype="text" />
+                       <field reporter:label="Display Field?" name="display_field" reporter:datatype="bool" />
                </fields>
                <links>
                        <link field="field_class" reltype="has_a" key="name" map="" class="cmc"/>
index 54a13e3..e0e579a 100644 (file)
@@ -31,7 +31,7 @@ package config::metabib_field;
 use base qw/config/;
 __PACKAGE__->table('config_metabib_field');
 __PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/field_class name xpath weight format search_field facet_field/);
+__PACKAGE__->columns(Essential => qw/field_class name xpath weight format search_field facet_field metabib_field/);
 #-------------------------------------------------------------------------------
 
 package config::identification_type;
index ac1f113..93bee0a 100644 (file)
@@ -200,7 +200,8 @@ CREATE TABLE config.metabib_field (
        format          TEXT    NOT NULL REFERENCES config.xml_transform (name) DEFAULT 'mods33',
        search_field    BOOL    NOT NULL DEFAULT TRUE,
        facet_field     BOOL    NOT NULL DEFAULT FALSE,
-    facet_xpath TEXT
+    facet_xpath TEXT,
+    display_field BOOL NOT NULL DEFAULT TRUE
 );
 COMMENT ON TABLE config.metabib_field IS $$
 XPath used for record indexing ingest
index 41e8d19..4bda86c 100644 (file)
@@ -68,10 +68,10 @@ INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath,
     (14, 'subject', 'topic', oils_i18n_gettext(14, 'Topic Subject', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject/mods32:topic$$, TRUE );
 --INSERT INTO config.metabib_field ( id, field_class, name, format, xpath ) VALUES 
 --  ( id, field_class, name, xpath ) VALUES ( 'subject', 'genre', 'mods32', $$//mods32:mods/mods32:genre$$ );
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES 
-    (15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */;
-INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
-    (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject$$ );
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, display_field ) VALUES 
+    (15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$ ); -- /* to fool vim */, FALSE;
+INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, display_field ) VALUES
+    (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject$$, FALSE );
 
 INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath ) VALUES
     (17, 'identifier', 'accession', oils_i18n_gettext(17, 'Accession Number', 'cmf', 'label'), 'marcxml', $$//marc:controlfield[@tag='001']$$ );