[open-ils-commits] r9217 - in trunk/Open-ILS/src:
perlmods/OpenILS/Application/Storage/Publisher sql/Pg
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 4 00:32:53 EDT 2008
Author: miker
Date: 2008-04-03 23:56:23 -0400 (Thu, 03 Apr 2008)
New Revision: 9217
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
Log:
adding bib_level filter support
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm 2008-04-04 03:41:02 UTC (rev 9216)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm 2008-04-04 03:56:23 UTC (rev 9217)
@@ -2324,7 +2324,7 @@
die "No search arguments were passed to ".$self->api_name;
}
- my (@statuses, at types, at forms, at lang, at aud, at lit_form, at vformats);
+ my (@statuses, at types, at forms, at lang, at aud, at lit_form, at vformats, at bib_level);
if ($args{available}) {
@statuses = (0,7);
@@ -2360,6 +2360,11 @@
@types = @$t;
}
+ if (my $b = $args{bib_level}) {
+ $b = [$b] if (!ref($b));
+ @bib_level = @$b;
+ }
+
if (my $v = $args{vr_format}) {
$v = [$v] if (!ref($v));
@vformats = @$v;
@@ -2423,6 +2428,7 @@
my $param_types = '$${' . join(',', map { s/\$//go; $_ } @types) . '}$$';
my $param_forms = '$${' . join(',', map { s/\$//go; $_ } @forms) . '}$$';
my $param_vformats = '$${' . join(',', map { s/\$//go; $_ } @vformats) . '}$$';
+ my $param_bib_level = '$${' . join(',', map { s/\$//go; $_ } @bib_level) . '}$$';
my $param_pref_lang = $args{preferred_language}; $param_pref_lang =~ s/\$//go; $param_pref_lang = '$$'.$param_pref_lang.'$$';
my $param_pref_lang_multiplier = $args{preferred_language_weight}; $param_pref_lang_multiplier ||= 'NULL';
my $param_sort = $args{'sort'}; $param_sort =~ s/\$//go; $param_sort = '$$'.$param_sort.'$$';
@@ -2446,6 +2452,7 @@
$param_types,
$param_forms,
$param_vformats,
+ $param_bib_level,
$param_pref_lang,
$param_pref_lang_multiplier,
$param_sort,
Modified: trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-04-04 03:41:02 UTC (rev 9216)
+++ trunk/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-04-04 03:56:23 UTC (rev 9217)
@@ -59,6 +59,7 @@
param_types TEXT[],
param_forms TEXT[],
param_vformats TEXT[],
+ param_bib_level TEXT[],
param_pref_lang TEXT,
param_pref_lang_multiplier REAL,
param_sort TEXT,
@@ -333,6 +334,10 @@
where_clause = where_clause || $$ AND mrd.vr_format IN ('$$ || array_to_string(param_vformats, $$','$$) || $$') $$;
END IF;
+ IF param_bib_level IS NOT NULL AND array_upper(param_bib_level, 1) > 0 THEN
+ where_clause = where_clause || $$ AND mrd.bib_level IN ('$$ || array_to_string(param_bib_level, $$','$$) || $$') $$;
+ END IF;
+
core_rel_query := select_clause || from_clause || where_clause ||
' GROUP BY 1 ORDER BY 4' || CASE WHEN sort_desc THEN ' DESC' ELSE ' ASC' END || ';';
--RAISE NOTICE 'Base Query: %', core_rel_query;
More information about the open-ils-commits
mailing list