From 14012633cd77f4a9bc2b72cf618700c590c65ae3 Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Mon, 27 Jun 2011 16:53:55 -0400 Subject: [PATCH] Add display_field column to config.metabib_field 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 Conflicts: Open-ILS/examples/fm_IDL.xml Open-ILS/src/sql/Pg/002.schema.config.sql Open-ILS/src/sql/Pg/950.data.seed-values.sql Signed-off-by: Bill Erickson --- Open-ILS/examples/fm_IDL.xml | 1 + .../src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm | 2 +- Open-ILS/src/sql/Pg/002.schema.config.sql | 3 ++- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 8 ++++---- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index 40fd709376..1b57c73989 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -2571,6 +2571,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm index 3873405f97..4f79a4a773 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/CDBI/config.pm @@ -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; diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index be088c24f2..d796e1aa9c 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -197,7 +197,8 @@ CREATE TABLE config.metabib_field ( facet_xpath TEXT, authority_xpath TEXT, joiner TEXT, - restrict BOOL DEFAULT FALSE NOT NULL + restrict BOOL DEFAULT FALSE NOT NULL, + display_field BOOL NOT NULL DEFAULT TRUE ); COMMENT ON TABLE config.metabib_field IS $$ XPath used for record indexing ingest 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 ee541b2a8c..9e40406733 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -146,10 +146,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, '//@xlink:href' ); --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, browse_field ) VALUES - (15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$, FALSE ); -- /* to fool vim */; -INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, browse_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, browse_field, display_field ) VALUES + (15, 'keyword', 'keyword', oils_i18n_gettext(15, 'General Keywords', 'cmf', 'label'), 'mods32', $$//mods32:mods/*[not(local-name()='originInfo')]$$, FALSE, FALSE ); -- /* to fool vim */; +INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, browse_field, display_field ) VALUES + (16, 'subject', 'complete', oils_i18n_gettext(16, 'All Subjects', 'cmf', 'label'), 'mods32', $$//mods32:mods/mods32:subject$$, FALSE, FALSE ); INSERT INTO config.metabib_field ( id, field_class, name, label, format, xpath, browse_field ) VALUES (17, 'identifier', 'accession', oils_i18n_gettext(17, 'Accession Number', 'cmf', 'label'), 'marcxml', $$//marc:controlfield[@tag='001']$$, FALSE ); -- 2.11.0