Merged revisions 9912,9914,9918-9919,9925,9931,9934 via svnmerge from
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Jun 2008 14:01:03 +0000 (14:01 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 26 Jun 2008 14:01:03 +0000 (14:01 +0000)
svn://svn.open-ils.org/ILS/trunk

........
  r9912 | dbs | 2008-06-22 23:04:30 -0400 (Sun, 22 Jun 2008) | 2 lines

  Another constraint that needs to be DEFERRED INITIALLY DEFERRED
........
  r9914 | miker | 2008-06-22 23:25:17 -0400 (Sun, 22 Jun 2008) | 1 line

  explicit casts to support pg 8.3
........
  r9918 | dbs | 2008-06-24 11:25:20 -0400 (Tue, 24 Jun 2008) | 2 lines

  Add libmemcache and ncurses dependencies on CentOS/RHEL
........
  r9919 | dbs | 2008-06-24 14:35:31 -0400 (Tue, 24 Jun 2008) | 3 lines

  Add /usr/local/lib to ldconfig on CentOS/RHEL if not already there;
  avoids "missing rpl_malloc" error which is rather difficult to debug
........
  r9925 | miker | 2008-06-25 12:33:42 -0400 (Wed, 25 Jun 2008) | 1 line

  add item and feed ids where appropriate
........
  r9931 | miker | 2008-06-25 20:55:58 -0400 (Wed, 25 Jun 2008) | 1 line

  proper support for counting short-duration overdue circs
........
  r9934 | miker | 2008-06-26 08:47:09 -0400 (Thu, 26 Jun 2008) | 1 line

  array_accum defined in the new aggregate function file
........

git-svn-id: svn://svn.open-ils.org/ILS/branches/acq-experiment@9936 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/src/extras/import/quick_metarecord_map.sql
Open-ILS/src/extras/Makefile.install
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/actor.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/metabib.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Open-ILS/src/perlmods/OpenILS/WWW/SuperCat/Feed.pm
Open-ILS/src/sql/Pg/020.schema.functions.sql

index 89a8364..01075b5 100644 (file)
@@ -18,7 +18,7 @@ INSERT INTO metabib.metarecord_source_map (metarecord,source)
          FROM  biblio.record_entry b
                JOIN metabib.metarecord m ON (m.fingerprint = b.fingerprint);
 
-ALTER TABLE metabib.metarecord_source_map ADD CONSTRAINT metabib_metarecord_source_map_metarecord_fkey FOREIGN KEY (metarecord) REFERENCES metabib.metarecord (id);
+ALTER TABLE metabib.metarecord_source_map ADD CONSTRAINT metabib_metarecord_source_map_metarecord_fkey FOREIGN KEY (metarecord) REFERENCES metabib.metarecord (id) DEFERRABLE INITIALLY DEFERRED;
 
 COMMIT;
 
index 5c6dbca..26dd7e6 100644 (file)
@@ -58,6 +58,10 @@ EJABBERD_VER=2.0.1
 EJABBERD_PKG=ejabberd-2.0.1_2-linux-x86-installer.bin
 EJABBERD_HOST=http://www.process-one.net/downloads/ejabberd
 
+# libmemcache is not packaged on CentOS/RHEL
+LIBMEMCACHE=libmemcache-1.4.0.rc2
+LIBMEMCACHE_HOST=http://people.freebsd.org/~seanc/libmemcache/
+
 # Business::OnlinePayment is not packaged on CentOS/RHEL
 PAY_ONLINE=Business-OnlinePayment-3.00_08.tar.gz
 PAY_ONLINE_HOST=http://ftp.perl.org/pub/CPAN/authors/id/I/IV/IVAN/
@@ -150,6 +154,8 @@ CENTOS = \
        make \
        mod_perl \
        mod_ssl \
+       ncurses \
+       ncurses-devel \
        ntp \
        perl-DBD-Pg \
        perl-DBI \
@@ -304,7 +310,8 @@ all:
 # these should be the same for any distro
 install: install_yaz install_cpan install_js_sm install_libdbi 
 
-centos: install_centos_pgsql install_centos_rpms install_ejabberd install install_libxml2 install_libxslt install_centos_perl 
+centos: install_centos_pgsql install_centos_rpms install_ejabberd install_libmemcache install install_libxml2 install_libxslt install_centos_perl create_ld_local
+
 debian: install_pgsql_debian install_debs install debian_sys_config
 
 gentoo: install_gentoos install_gentoo_rc install_gentoo_perl install
@@ -327,6 +334,12 @@ install_ejabberd:
        chmod u+x $(EJABBERD_PKG).gz
        ./$(EJABBERD_PKG) --mode unattended --prefix /opt/ejabberd --adminpw evergreen
 
+# Install libmemcache from the official project source
+install_libmemcache:
+       if [ ! -d $(LIBMEMCACHE) ]; then wget $(LIBMEMCACHE_HOST)/$(LIBMEMCACHE).tar.bz2; fi;
+       tar xjf $(LIBMEMCACHE).tar.bz2
+       cd $(LIBMEMCACHE) && ./configure && make && make install
+
 # Install a newer version of libxslt
 install_libxslt:    
        if [ ! -d $(XSLT) ]; then wget $(XSLT_HOST)/$(XSLT).tar.gz; fi;
@@ -431,3 +444,10 @@ install_centos_perl:
        for m in $(CENTOS_PERL_NOTEST); do perl -MCPAN -e "CPAN::Shell->notest('install', \"$$m\";"; done
        for m in $(CENTOS_PERL_LOCAL); do LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib perl -MCPAN -e "install \"$$m\";"; done
 
+# We need to add /usr/local/lib to the ldconfig list of directories on CentOS,
+# if it is not already there
+create_ld_local:
+       if [ "$$(ldconfig -v 2> /dev/null | grep '^/usr/local/lib' | wc -l)" -eq 0 ]; then \
+               echo '/usr/local/lib' > /etc/ld.so.conf.d/local.conf; \
+               ldconfig; \
+       fi;
index cc1d3ec..8cd9f24 100644 (file)
@@ -56,6 +56,12 @@ sub usr_breakdown_out {
                        SELECT  id
                          FROM  action.circulation
                          WHERE usr = ? AND checkin_time IS NULL AND due_date >= 'today' AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
+                         WHERE usr = ?
+                    AND checkin_time IS NULL
+                    AND (  (fine_interval >= '1 day' AND due_date >= 'today')
+                        OR (fine_interval < '1 day'  AND due_date > 'now'   ))
+                    AND (stop_fines IS NULL
+                        OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
        SQL
 
        my $out = actor::user->db_Main->selectcol_arrayref($out_sql, {}, $usr);
@@ -63,7 +69,12 @@ sub usr_breakdown_out {
        my $od_sql = <<"        SQL";
                        SELECT  id
                          FROM  action.circulation
-                         WHERE usr = ? AND checkin_time IS NULL AND due_date < 'today' AND (stop_fines IS NULL OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
+                         WHERE usr = ?
+                    AND checkin_time IS NULL
+                    AND (  (fine_interval >= '1 day' AND due_date < 'today')
+                        OR (fine_interval < '1 day'  AND due_date < 'now'  ))
+                    AND (stop_fines IS NULL
+                        OR stop_fines NOT IN ('LOST','CLAIMSRETURNED','LONGOVERDUE'))
        SQL
 
        my $od = actor::user->db_Main->selectcol_arrayref($od_sql, {}, $usr);
index c095160..859bd09 100644 (file)
@@ -2470,27 +2470,27 @@ sub staged_fts {
        my $sth = metabib::metarecord_source_map->db_Main->prepare(<<"    SQL");
         SELECT  *
           FROM  search.staged_fts(
-                    $param_search_ou,
-                    $param_depth,
-                    $param_searches,
-                    $param_statuses,
-                    $param_locations,
-                    $param_audience,
-                    $param_language,
-                    $param_lit_form,
-                    $param_types,
-                    $param_forms,
-                    $param_vformats,
-                    $param_bib_level,
-                    $param_pref_lang,
-                    $param_pref_lang_multiplier,
-                    $param_sort,
-                    $param_sort_desc,
-                    $metarecord,
-                    $staff,
-                    $param_rel_limit,
-                    $param_chk_limit,
-                    $param_skip_chk
+                    $param_search_ou\:\:INT,
+                    $param_depth\:\:INT,
+                    $param_searches\:\:TEXT,
+                    $param_statuses\:\:INT[],
+                    $param_locations\:\:INT[],
+                    $param_audience\:\:TEXT[],
+                    $param_language\:\:TEXT[],
+                    $param_lit_form\:\:TEXT[],
+                    $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,
+                    $param_sort_desc\:\:BOOL,
+                    $metarecord\:\:BOOL,
+                    $staff\:\:BOOL,
+                    $param_rel_limit\:\:INT,
+                    $param_chk_limit\:\:INT,
+                    $param_skip_chk\:\:INT
                 );
     SQL
 
index f5918a8..a348336 100644 (file)
@@ -741,6 +741,7 @@ sub bookbag_feed {
                $flesh_feed
        );
        $feed->root($root);
+       $feed->id($bucket_tag);
 
        $feed->title("Items in Book Bag [".$bucket->name."]");
        $feed->creator($host);
@@ -1209,7 +1210,7 @@ sub create_record_feed {
                        $node->add_holdings($xml);
                }
 
-               $node->id($item_tag) if ($flesh);
+               $node->id($item_tag);
                #$node->update_ts(clense_ISO8601($record->edit_date));
                $node->link(alternate => $feed->unapi . "?id=$item_tag&format=htmlholdings-full" => 'text/html') if ($flesh);
                $node->link(opac => $feed->unapi . "?id=$item_tag&format=opac") if ($flesh);
index 6d382a3..ba9d3cc 100644 (file)
@@ -281,7 +281,7 @@ sub id {
        my $self = shift;
        my $id = shift;
 
-       $self->_create_node( '/atom:feed', 'http://www.w3.org/2005/Atom', 'id', $id );
+       $self->_create_node( $self->{item_xpath}, 'http://www.w3.org/2005/Atom', 'id', $id );
 }
 
 package OpenILS::WWW::SuperCat::Feed::atom::item;
@@ -350,6 +350,13 @@ sub link {
        );
 }
 
+sub id {
+       my $self = shift;
+       my $id = shift;
+
+       $self->_create_node($self->{item_xpath}, undef,'guid', $id);
+}
+
 package OpenILS::WWW::SuperCat::Feed::rss2::item;
 use base 'OpenILS::WWW::SuperCat::Feed::rss2';
 
index 9ea4e8d..efc253d 100644 (file)
@@ -112,7 +112,7 @@ $$ LANGUAGE PLPERLU;
 CREATE OR REPLACE FUNCTION public.call_number_dewey( TEXT ) RETURNS TEXT AS $$
        my $txt = shift;
        $txt =~ s/^\s+//o;
-       $txt =~ s/[\[\]\{\}\(\)`'"#<>\*\?\-\+\$\\]+//o;
+       $txt =~ s/[\[\]\{\}\(\)`'"#<>\*\?\-\+\$\\]+//og;
        $txt =~ s/\s+$//o;
        if ($txt =~ /(\d{3}(?:\.\d+)?)/o) {
                return $1;
@@ -206,10 +206,4 @@ CREATE OR REPLACE FUNCTION actor.org_unit_proximity ( INT, INT ) RETURNS INT AS
        ) z;
 $$ LANGUAGE SQL STABLE;
 
-CREATE AGGREGATE array_accum (
-       sfunc = array_append,
-       basetype = anyelement,
-       stype = anyarray,
-       initcond = '{}'
-);