[open-ils-commits] [GIT] Evergreen ILS branch master updated. 7f50fd7b3d5ec0c8f27a27a6768aab67601202ba
Evergreen Git
git at git.evergreen-ils.org
Wed Jan 4 10:36:26 EST 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, master has been updated
via 7f50fd7b3d5ec0c8f27a27a6768aab67601202ba (commit)
via 8602d3d8073eb66ff1dd19d0e534e43cdefb7f14 (commit)
from e0896f470df01957b192a60a9b2b8496309516ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7f50fd7b3d5ec0c8f27a27a6768aab67601202ba
Author: Mike Rylander <mrylander at gmail.com>
Date: Wed Jan 4 10:36:08 2012 -0500
Stamping upgrade script for coded value map index normalizer
Signed-off-by: Mike Rylander <mrylander at gmail.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 8eba8b3..642048f 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -86,7 +86,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0661', :eg_version); -- berick/dbs
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0662', :eg_version); -- berick/miker
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql b/Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql
similarity index 82%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql
rename to Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql
index 2cc1c80..1c9694f 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql
@@ -1,9 +1,9 @@
--- Evergreen DB patch XXXX.schema.coded-value-map-index-normalizer.sql
+-- Evergreen DB patch 0662.schema.coded-value-map-index-normalizer.sql
--
BEGIN;
-- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0662', :eg_version);
-- create the normalizer
CREATE OR REPLACE FUNCTION evergreen.coded_value_map_normalizer( input TEXT, ctype TEXT )
commit 8602d3d8073eb66ff1dd19d0e534e43cdefb7f14
Author: Bill Erickson <berick at esilibrary.com>
Date: Tue Jan 3 16:41:42 2012 -0500
Coded value map index normalizer
New index normalizer which maps a coded value from the record to the
display value configured in config.coded_value_map. The normalizer is
applied with one parameter, the ctype of the coded_value_map to use for
the mapping.
E.g config.metabib_field_index_norm_map:
id | field | norm | params | pos
---+-------+------+---------------+-----
57 | 31 | 17 | ["item_lang"] | -1
* pos = -1 causes this normalizer to be applied to facet_entry's
This is primarily useful for facets. For example, you could create a
metabib_field for language and mark it as a facet_field. Applying this
index would allow the mapped language names (e.g. "French" instead of
"fre") to display as facets.
Signed-off-by: Bill Erickson <berick at esilibrary.com>
Signed-off-by: Mike Rylander <mrylander at gmail.com>
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 50b7192..3283727 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -7200,6 +7200,14 @@ INSERT INTO config.index_normalizer (name, description, func, param_count) VALUE
1
);
+INSERT INTO config.index_normalizer (name, description, func, param_count) VALUES (
+ 'Coded Value Map Normalizer',
+ 'Applies coded_value_map mapping of values',
+ 'coded_value_map_normalizer',
+ 1
+);
+
+
-- make use of the index normalizers
INSERT INTO config.metabib_field_index_norm_map (field,norm)
diff --git a/Open-ILS/src/sql/Pg/999.functions.global.sql b/Open-ILS/src/sql/Pg/999.functions.global.sql
index 9885876..1acd06a 100644
--- a/Open-ILS/src/sql/Pg/999.functions.global.sql
+++ b/Open-ILS/src/sql/Pg/999.functions.global.sql
@@ -2085,3 +2085,11 @@ WHERE
ORDER BY actor.org_unit_proximity(owner, $1)
$$ LANGUAGE SQL;
+CREATE OR REPLACE FUNCTION evergreen.coded_value_map_normalizer( input TEXT, ctype TEXT )
+ RETURNS TEXT AS $F$
+ SELECT COALESCE(value,$1)
+ FROM config.coded_value_map
+ WHERE ctype = $2 AND code = $1;
+$F$ LANGUAGE SQL;
+
+
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql
new file mode 100644
index 0000000..2cc1c80
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.schema.coded-value-map-index-normalizer.sql
@@ -0,0 +1,24 @@
+-- Evergreen DB patch XXXX.schema.coded-value-map-index-normalizer.sql
+--
+BEGIN;
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+-- create the normalizer
+CREATE OR REPLACE FUNCTION evergreen.coded_value_map_normalizer( input TEXT, ctype TEXT )
+ RETURNS TEXT AS $F$
+ SELECT COALESCE(value,$1)
+ FROM config.coded_value_map
+ WHERE ctype = $2 AND code = $1;
+$F$ LANGUAGE SQL;
+
+-- register the normalizer
+INSERT INTO config.index_normalizer (name, description, func, param_count) VALUES (
+ 'Coded Value Map Normalizer',
+ 'Applies coded_value_map mapping of values',
+ 'coded_value_map_normalizer',
+ 1
+);
+
+COMMIT;
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 8 ++++++
Open-ILS/src/sql/Pg/999.functions.global.sql | 8 ++++++
...662.schema.coded-value-map-index-normalizer.sql | 24 ++++++++++++++++++++
4 files changed, 41 insertions(+), 1 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0662.schema.coded-value-map-index-normalizer.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list