[open-ils-commits] SPAM: r10173 - in branches/acq-experiment: .
Open-ILS/examples Open-ILS/src
Open-ILS/src/javascript/backend/catalog
Open-ILS/src/perlmods/OpenILS/Application
Open-ILS/src/perlmods/OpenILS/Application/Circ
Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher
Open-ILS/src/perlmods/OpenILS/WWW Open-ILS/src/sql/Pg
Open-ILS/web/opac/locale/en-US
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Jul 29 12:53:00 EDT 2008
Author: erickson
Date: 2008-07-29 12:52:52 -0400 (Tue, 29 Jul 2008)
New Revision: 10173
Modified:
branches/acq-experiment/
branches/acq-experiment/Open-ILS/examples/fm_IDL.xml
branches/acq-experiment/Open-ILS/src/Makefile
branches/acq-experiment/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
branches/acq-experiment/Open-ILS/src/sql/Pg/030.schema.metabib.sql
branches/acq-experiment/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
branches/acq-experiment/Open-ILS/web/opac/locale/en-US/opac.dtd
Log:
Merged revisions 10162,10165,10167,10169-10171 via svnmerge from
svn://svn.open-ils.org/ILS/trunk
........
r10162 | erickson | 2008-07-28 10:57:45 -0400 (Mon, 28 Jul 2008) | 1 line
creating directories for blocked patron list and overdue script output
........
r10165 | miker | 2008-07-28 20:02:08 -0400 (Mon, 28 Jul 2008) | 1 line
removing spurious entityize
........
r10167 | miker | 2008-07-28 22:34:57 -0400 (Mon, 28 Jul 2008) | 1 line
copy-n-paste error -- thanks Dan!
........
r10169 | miker | 2008-07-29 00:42:35 -0400 (Tue, 29 Jul 2008) | 1 line
add date fields for 008/7-14
........
r10170 | miker | 2008-07-29 00:45:42 -0400 (Tue, 29 Jul 2008) | 1 line
Adding date filtering support and automatic/configurable default preferred language code
........
r10171 | erickson | 2008-07-29 09:18:44 -0400 (Tue, 29 Jul 2008) | 1 line
replaced unnecessary nbsp with a space
........
Property changes on: branches/acq-experiment
___________________________________________________________________
Name: svnmerge-integrated
- /trunk:1-10160
+ /trunk:1-10172
Modified: branches/acq-experiment/Open-ILS/examples/fm_IDL.xml
===================================================================
--- branches/acq-experiment/Open-ILS/examples/fm_IDL.xml 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/examples/fm_IDL.xml 2008-07-29 16:52:52 UTC (rev 10173)
@@ -1548,6 +1548,8 @@
<field reporter:label="Bib Record Entry" name="record" oils_obj:array_position="15" oils_persist:virtual="false" reporter:datatype="link"/>
<field reporter:label="TMat" name="type_mat" oils_obj:array_position="16" oils_persist:virtual="false" oils_persist:primitive="string" reporter:datatype="text"/>
<field reporter:label="Video Recording Format" name="vr_format" oils_obj:array_position="17" oils_persist:virtual="false" oils_persist:primitive="string" reporter:datatype="text"/>
+ <field reporter:label="Date1" name="date1" oils_obj:array_position="18" oils_persist:virtual="false" oils_persist:primitive="string" reporter:datatype="text"/>
+ <field reporter:label="Date2" name="date2" oils_obj:array_position="19" oils_persist:virtual="false" oils_persist:primitive="string" reporter:datatype="text"/>
</fields>
<links>
<link field="record" reltype="has_a" key="id" map="" class="bre"/>
Modified: branches/acq-experiment/Open-ILS/src/Makefile
===================================================================
--- branches/acq-experiment/Open-ILS/src/Makefile 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/Makefile 2008-07-29 16:52:52 UTC (rev 10173)
@@ -81,6 +81,7 @@
ln -sf $(ETCDIR)/fm_IDL.xml $(WEBDIR)/reports/
cp ../xul/staff_client/server/admin/adminlib.js $(WEBDIR)/reports/
mkdir -p $(WEBDIR)/opac/extras/slimpac/
+ mkdir -p $(WEBDIR)/standalone/
c_apps:
@@ -111,6 +112,7 @@
mkdir -p $(PERLDIR)
mkdir -p $(DATADIR)
mkdir -p $(BINDIR)
+ mkdir -p $(DATADIR)/overdue/
cp extras/ils_events.xml $(DATADIR)
cp -r perlmods/* $(PERLDIR)
cp ../examples/opensrf.xml.example $(ETCDIR)
Modified: branches/acq-experiment/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js
===================================================================
--- branches/acq-experiment/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/javascript/backend/catalog/biblio_descriptor.js 2008-07-29 16:52:52 UTC (rev 10173)
@@ -22,6 +22,8 @@
environment.result.cat_form( extractFixedField( marcdoc, 'Desc' ) );
environment.result.pub_status( extractFixedField( marcdoc, 'DtSt' ) );
environment.result.item_lang( extractFixedField( marcdoc, 'Lang' ) );
+environment.result.date1( extractFixedField( marcdoc, 'Date1' ) );
+environment.result.date2( extractFixedField( marcdoc, 'Date2' ) );
environment.result.vr_format( videorecordingFormatCode( marcdoc ) );
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -1077,9 +1077,9 @@
my $cn = $self->editor->retrieve_asset_call_number($copy->call_number);
my $default_price = $U->ou_ancestor_setting_value(
- $cn->owning_lib, OILS_SETTING_DEF_ITEM_PRICE, $e) || 0;
+ $cn->owning_lib, OILS_SETTING_DEF_ITEM_PRICE, $self->editor) || 0;
my $charge_on_0 = $U->ou_ancestor_setting_value(
- $cn->owning_lib, OILS_SETTING_CHARGE_LOST_ON_ZERO, $e) || 0;
+ $cn->owning_lib, OILS_SETTING_CHARGE_LOST_ON_ZERO, $self->editor) || 0;
# Find the most appropriate "price" -- same definition as the
# LOST price. See OpenILS::Circ::new_set_circ_lost
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Ingest.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -1088,6 +1088,14 @@
my $res = $rd_script->run || ($log->error( "Descriptor script died! $@" ) && return undef);
$log->debug("Script for biblio descriptor extraction completed successfully");
+ if ($res->{date1} ne ' ') {
+ $res->{date1} =~ tr/ux/00/;
+ }
+
+ if ($res->{date2} ne ' ') {
+ $res->{date2} =~ tr/ux/99/;
+ }
+
return $res;
}
__PACKAGE__->register_method(
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/config.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -118,6 +118,20 @@
__PACKAGE__->columns(Essential => qw/value/);
#-------------------------------------------------------------------------------
+package config::i18n_locale;
+use base qw/config/;
+__PACKAGE__->table('config_i18n_locale');
+__PACKAGE__->columns(Primary => 'code');
+__PACKAGE__->columns(Essential => qw/marc_code name description/);
+#-------------------------------------------------------------------------------
+package config::i18n_core;
+use base qw/config/;
+__PACKAGE__->table('config_i18n_core');
+__PACKAGE__->columns(Primary => 'id');
+__PACKAGE__->columns(Essential => qw/fq_field identity_value translation string/);
+#-------------------------------------------------------------------------------
+
+
1;
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/metabib.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -80,7 +80,7 @@
metabib::record_descriptor->columns( Primary => qw/id/ );
metabib::record_descriptor->columns( Essential => qw/record item_type item_form bib_level
control_type char_encoding enc_level lit_form vr_format
- cat_form pub_status item_lang audience type_mat/ );
+ cat_form pub_status item_lang audience type_mat date1 date2/ );
#-------------------------------------------------------------------------------
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -672,6 +672,17 @@
#-------------------------------------------------------------------------------
+ package config::i18n_locale;
+ config::i18n_locale->table('config.i18n_locale');
+
+ #-------------------------------------------------------------------------------
+
+ package config::i18n_core;
+ config::i18n_core->sequence( 'config.i18n_core_id_seq' );
+ config::i18n_core->table('config.i18n_core');
+
+ #-------------------------------------------------------------------------------
+
package config::item_form_map;
config::item_form_map->table('config.item_form_map');
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -2328,12 +2328,47 @@
cachable => 1,
);
+
+my %locale_map;
+my $default_preferred_language;
+my $default_preferred_language_weight;
+
# XXX factored most of the PG dependant stuff out of here... need to find a way to do "dependants".
sub staged_fts {
my $self = shift;
my $client = shift;
my %args = @_;
-
+
+ if (!$locale_map{COMPLETE}) {
+
+ my @locales = config::i18n_locale->search_where({ code => { '<>' => '' } });
+ for my $locale ( @locales ) {
+ $locale_map{$locale->code} = $locale->marc_code;
+ }
+ $locale_map{COMPLETE} = 1;
+
+ }
+
+ if (!$default_preferred_language) {
+
+ $default_preferred_language = OpenSRF::Utils::SettingsClient
+ ->new
+ ->config_value(
+ apps => 'open-ils.storage' => app_settings => 'default_preferred_language'
+ );
+
+ }
+
+ if (!$default_preferred_language_weight) {
+
+ $default_preferred_language_weight = OpenSRF::Utils::SettingsClient
+ ->new
+ ->config_value(
+ apps => 'open-ils.storage' => app_settings => 'default_preferred_language_weight'
+ );
+
+ }
+
my $ou = $args{org_unit};
my $limit = $args{limit} || 10;
my $offset = $args{offset} || 0;
@@ -2346,8 +2381,17 @@
die "No search arguments were passed to ".$self->api_name;
}
- my (@statuses, at locations, at types, at forms, at lang, at aud, at lit_form, at vformats, at bib_level);
+ my (@between, at statuses, at locations, at types, at forms, at lang, at aud, at lit_form, at vformats, at bib_level);
+ if (!defined($args{preferred_language})) {
+ $args{preferred_language} =
+ $locale_map{ $self->session->session_locale || $default_preferred_language } || 'eng';
+ }
+
+ if (!defined($args{preferred_language_weight})) {
+ $args{preferred_language_weight} = $default_preferred_language_weight || 2;
+ }
+
if ($args{available}) {
@statuses = (0,7,12);
}
@@ -2357,6 +2401,12 @@
@locations = @$s;
}
+ if (my $b = $args{between}) {
+ if (ref($b) && @$b == 2) {
+ @between = @$b;
+ }
+ }
+
if (my $s = $args{statuses}) {
$s = [$s] if (!ref($s));
@statuses = @$s;
@@ -2457,6 +2507,10 @@
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_before = $args{before}; $param_before = 'NULL' unless (defined($param_before) and length($param_before) > 0 );
+ my $param_after = $args{after}; $param_after = 'NULL' unless (defined($param_after) and length($param_after) > 0 );
+ my $param_during = $args{during}; $param_during = 'NULL' unless (defined($param_during) and length($param_during) > 0 );
+ my $param_between = '$${"' . join('","', map { int($_) } @between) . '"}$$';
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.'$$';
@@ -2482,6 +2536,10 @@
$param_forms\:\:TEXT[],
$param_vformats\:\:TEXT[],
$param_bib_level\:\:TEXT[],
+ $param_before\:\:TEXT,
+ $param_after\:\:TEXT,
+ $param_during\:\:TEXT,
+ $param_between\:\:TEXT[],
$param_pref_lang\:\:TEXT,
$param_pref_lang_multiplier\:\:REAL,
$param_sort\:\:TEXT,
Modified: branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2008-07-29 16:52:52 UTC (rev 10173)
@@ -1149,7 +1149,8 @@
# 'text/html'
# );
- print $cgi->header( -type => $feed->type, -charset => 'UTF-8') . entityize($feed->toString) . "\n";
+ #print $cgi->header( -type => $feed->type, -charset => 'UTF-8') . entityize($feed->toString) . "\n";
+ print $cgi->header( -type => $feed->type, -charset => 'UTF-8') . $feed->toString . "\n";
$log->debug("...and feed returned.");
Modified: branches/acq-experiment/Open-ILS/src/sql/Pg/030.schema.metabib.sql
===================================================================
--- branches/acq-experiment/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/sql/Pg/030.schema.metabib.sql 2008-07-29 16:52:52 UTC (rev 10173)
@@ -114,7 +114,9 @@
cat_form TEXT,
pub_status TEXT,
item_lang TEXT,
- vr_format TEXT
+ vr_format TEXT,
+ date1 TEXT,
+ date2 TEXT
);
CREATE INDEX metabib_rec_descriptor_record_idx ON metabib.rec_descriptor (record);
/* We may not need these...
Modified: branches/acq-experiment/Open-ILS/src/sql/Pg/300.schema.staged_search.sql
===================================================================
--- branches/acq-experiment/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/src/sql/Pg/300.schema.staged_search.sql 2008-07-29 16:52:52 UTC (rev 10173)
@@ -57,6 +57,10 @@
param_forms TEXT[],
param_vformats TEXT[],
param_bib_level TEXT[],
+ param_before TEXT,
+ param_after TEXT,
+ param_during TEXT,
+ param_between TEXT[],
param_pref_lang TEXT,
param_pref_lang_multiplier REAL,
param_sort TEXT,
@@ -241,7 +245,7 @@
current_rank := ' CASE WHEN mrd.item_lang = ' || quote_literal( param_pref_lang ) ||
' THEN ' || param_pref_lang_multiplier || '::REAL ELSE 1.0 END ';
- --ranks := array_append( ranks, current_rank );
+ -- ranks := array_append( ranks, current_rank );
END IF;
current_rank := ' AVG( ( (' || array_to_string( ranks, ') + (' ) || ') ) * ' || current_rank || ' ) ';
@@ -254,16 +258,7 @@
tmp_text := '999999';
IF param_sort_desc THEN tmp_text := '0'; END IF;
- current_rank := $$
- ( COALESCE( FIRST ((
- SELECT SUBSTRING(frp.value FROM E'\\d{4}')
- FROM metabib.full_rec frp
- WHERE frp.record = m.source
- AND frp.tag = '260'
- AND frp.subfield = 'c'
- LIMIT 1
- )), $$ || quote_literal(tmp_text) || $$ )::INT )
- $$;
+ current_rank := $$ COALESCE( mrd.date1, $$ || quote_literal(tmp_text) || $$ )::INT ) $$;
ELSIF param_sort = 'title' THEN
@@ -337,6 +332,22 @@
where_clause = where_clause || $$ AND mrd.bib_level IN ('$$ || array_to_string(param_bib_level, $$','$$) || $$') $$;
END IF;
+ IF param_before IS NOT NULL AND param_before <> '' THEN
+ where_clause = where_clause || $$ AND mrd.date1 <= $$ || quote_literal(param_before) || ' ';
+ END IF;
+
+ IF param_after IS NOT NULL AND param_after <> '' THEN
+ where_clause = where_clause || $$ AND mrd.date1 >= $$ || quote_literal(param_after) || ' ';
+ END IF;
+
+ IF param_during IS NOT NULL AND param_during <> '' THEN
+ where_clause = where_clause || $$ AND $$ || quote_literal(param_during) || $$ BETWEEN mrd.date1 AND mrd.date2 $$;
+ END IF;
+
+ IF param_between IS NOT NULL AND array_upper(param_between, 1) > 0 THEN
+ where_clause = where_clause || $$ AND mrd.date1 BETWEEN $$ || array_to_string(param_bib_level, $$' AND '$$) || ' ';
+ 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;
@@ -546,15 +557,6 @@
END;
$func$ LANGUAGE PLPGSQL;
-/*
- param_statuses INT[],
- param_audience TEXT[], x
- param_language TEXT[], x
- param_lit_form TEXT[], x
- param_types TEXT[], x
- param_forms TEXT[], x
- param_vformats TEXT[], x
-*/
CREATE OR REPLACE FUNCTION search.explode_array(anyarray) RETURNS SETOF anyelement AS $BODY$
SELECT ($1)[s] FROM generate_series(1, array_upper($1, 1)) AS s;
Modified: branches/acq-experiment/Open-ILS/web/opac/locale/en-US/opac.dtd
===================================================================
--- branches/acq-experiment/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-07-29 14:01:31 UTC (rev 10172)
+++ branches/acq-experiment/Open-ILS/web/opac/locale/en-US/opac.dtd 2008-07-29 16:52:52 UTC (rev 10173)
@@ -446,7 +446,7 @@
<!ENTITY advanced.item.type "Item Type">
<!ENTITY advanced.link "Advanced">
<!ENTITY advanced.basic.link "Basic">
-<!ENTITY advanced.literary.form "Literary Form">
+<!ENTITY advanced.literary.form "Literary Form">
<!ENTITY advanced.non.fiction "Non Fiction">
<!ENTITY advanced.fiction "Fiction">
<!ENTITY advanced.language "Language">
More information about the open-ils-commits
mailing list