Capture all alternative titles

With the addition of bib browse, the alternative title index definition
was made to point at the 740 (ind2 != 2), which contains non-analytic
alternative titles /and/ non-filing indicator info.  It used to capture
both the 246 and (appropriate) 740's.  Allow either to match the XPath.

Signed-off-by: Mike Rylander <mrylander@gmail.com>
Replace inappropriate browse reingest with ...

... attempt at reingest across browse/facets/search but limited to
the alternative title index.

Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Stamping upgrade 0839: alternative title index fix

Signed-off-by: Dan Wells <dbw2@calvin.edu>
lp1193487 Circulation Policy Column Picker not saving configuration.

The circulation policy column picker is not saving its configuration
because ui.grid_columns.conify.config.circ_matrix_matchpoint is not
defined in the config.usr_setting_type table.  This updates the sql
to populate the table.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Wrap upgrade script for 0840 circulation column picker.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Set config.metabib_field_id_seq to 1000 in 950.data.seed-values.sql.

Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>

Boosted to 1000 as suggested by Dan Scott and seconded by Bill
Erickson.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Documentation: Update links in installation instructions.

Addresses these bugs reported in launchpad:
https://bugs.launchpad.net/evergreen/+bug/1237781
https://bugs.launchpad.net/evergreen/+bug/1237785

Signed-off-by: Robert Soulliere <robert.soulliere@mohawkcollege.ca>
Documentation: Update EG upgrade instructions to 2.5 beta1

Also added Debian Wheezy references and updated links.

Signed-off-by: Robert Soulliere <robert.soulliere@mohawkcollege.ca>
Make some FK constraints on config.metabib_field.id deferrable

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Upgrade script for config.metabib_field sequence redo

[LFW: s/DROP FUNCTION/DROP FUNCTION IF EXISTS/]

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Stamping 0841: make space in config.metabib_field sequence

Signed-off-by: Dan Wells <dbw2@calvin.edu>
tests against stock test data and live Evergreen

I'm running these on a machine where Evergreen has been installed with the stock
test data.  Repeat invocations of the tests will cause test failures, as they
don't completely cleanup after themselves (the goal long-term is to rely on
complete database wipes between invocations).

Manual cleanup right now could include doing the following in psql:
DELETE FROM actor.workstation WHERE name ~ '.t$';

and paying the bills on the admin user (otherwise, once a Max Fines penalty is
generated, checkout tests will fail).

opensrf@dev141:~/git/Evergreen/Open-ILS/src/perlmods (livetests)$ make livecheck 2> /dev/null
perl Build.PL --destdir  || make -s build-perl-fail
Creating new 'MYMETA.yml' with configuration results
Creating new 'Build' script for 'OpenILS' version '2.4'
./Build test --test_files live_t || make -s build-perl-fail
live_t/00-simple.t ..................... ok
live_t/01-auth.t ....................... ok
live_t/02-simple_circ.t ................ ok
live_t/03-overdue_circ.t ............... ok
live_t/04-overdue_with_closed_dates.t .. ok
All tests successful.
Files=5, Tests=62, 11 wallclock secs ( 0.25 usr  0.16 sys +  3.52 cusr  0.63 csys =  4.56 CPU)
Result: PASS

and

opensrf@dev141:~/git/Evergreen/Open-ILS/src/perlmods (livetests)$ prove -v live_t/
live_t/00-simple.t .....................
1..2
 # Simple tests against the open-ils.storage service and the stock test data.
ok 1 - open-ils.storage.direct.actor.user.retrieve returned aou object
ok 2 - User with id = 1 is admin user
ok
live_t/01-auth.t .......................
1..4
 # Simple tests against the open-ils.auth service, memcached, and the stock test data.
 # authtime is 7200, authtoken is a3f2d06775fb670284450ad1f1d6ea00
ok 1 - Have an authtoken
ok 2 - Default authtime for staff login is 7200 seconds
ok 3 - Can retrieve authtoken from memcached
ok 4 - Authtoken is removed from memcached after logout
ok
live_t/02-simple_circ.t ................
1..14
 # Test circulation of item CONC70000345 against the admin user.
ok 1 - open-ils.storage.direct.actor.user.retrieve returned aou object
ok 2 - User with id = 1 is admin user
ok 3 - open-ils.storage.direct.asset.copy.retrieve returned acp object
ok 4 - Item with id = 310 has barcode CONC70000345
ok 5 - Item with id = 310 has status of Reshelving or Available
 # authtime is 7200, authtoken is f7c9ae35165ec74ab5e8ce5b84673da8
ok 6 - Have an authtoken
ok 7 - Registered a new workstation
 # authtime is 7200, authtoken is f7c9ae35165ec74ab5e8ce5b84673da8
ok 8 - Have an authtoken associated with the workstation
ok 9 - Checkout request returned a HASH
ok 10 - Checkout returned a SUCCESS event
ok 11 - Item with id = 310 has status of Checked Out after fresh Storage request
ok 12 - Checkin request returned a HASH
ok 13 - Checkin returned a SUCCESS event
ok 14 - Item with id = 310 has status of Reshelving or Available after fresh Storage request
ok
live_t/03-overdue_circ.t ...............
1..20
 # Test fine generation on checkin against the admin user.
ok 1 - open-ils.storage.direct.actor.user.retrieve returned aou object
ok 2 - User with id = 1 is admin user
ok 3 - open-ils.storage.direct.asset.copy.retrieve returned acp object
ok 4 - Item with id = 810 has barcode CONC71000345
ok 5 - Item with id = 810 has status of Reshelving or Available
 # authtime is 7200, authtoken is 5ab4ae5b9a09c7fd04b4eb0dabf19da5
ok 6 - Have an authtoken
ok 7 - Registered a new workstation
 # authtime is 7200, authtoken is 5ab4ae5b9a09c7fd04b4eb0dabf19da5
ok 8 - Have an authtoken associated with the workstation
ok 9 - Checkout request returned a HASH
ok 10 - Checkout returned a SUCCESS event
ok 11 - Checkout response object has payload object
ok 12 - Payload object has circ object
ok 13 - Circ objection has loan duration of "7 days"
ok 14 - Item with id = 810 has status of Checked Out after fresh Storage request
ok 15 - Zero bills associated with circulation
ok 16 - rewrote circ to have happened 20 days ago
ok 17 - Checkin request returned a HASH
ok 18 - Checkin returned a SUCCESS event
ok 19 - Item with id = 810 has status of Reshelving or Available after fresh Storage request
ok 20 - Thirteen bills associated with circulation
ok
live_t/04-overdue_with_closed_dates.t ..
1..22
 # Test fine generation with closed date on checkin against the admin user.
ok 1 - open-ils.storage.direct.actor.user.retrieve returned aou object
ok 2 - User with id = 1 is admin user
ok 3 - open-ils.storage.direct.asset.copy.retrieve returned acp object
ok 4 - Item with id = 1310 has barcode CONC72000345
ok 5 - Item with id = 1310 has status of Reshelving or Available
 # authtime is 7200, authtoken is dd4b533f677dd5ec6d177312eca2e86b
ok 6 - Have an authtoken
ok 7 - Registered a new workstation
 # authtime is 7200, authtoken is dd4b533f677dd5ec6d177312eca2e86b
ok 8 - Have an authtoken associated with the workstation
ok 9 - Created a closed date for 10 days ago
ok 10 - Checkout request returned a HASH
ok 11 - Checkout returned a SUCCESS event
ok 12 - Checkout response object has payload object
ok 13 - Payload object has circ object
ok 14 - Circ objection has loan duration of "7 days"
ok 15 - Item with id = 1310 has status of Checked Out after fresh Storage request
ok 16 - Zero bills associated with circulation
ok 17 - rewrote circ to have happened 20 days ago
ok 18 - Checkin request returned a HASH
ok 19 - Checkin returned a SUCCESS event
ok 20 - Item with id = 1310 has status of Reshelving or Available after fresh Storage request
ok 21 - Twelve bills associated with circulation (instead of 13, thanks to closed date)
ok 22 - Removed closed date
ok
All tests successful.
Files=5, Tests=62, 10 wallclock secs ( 0.06 usr  0.04 sys +  3.29 cusr  0.50 csys =  3.89 CPU)
Result: PASS

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
test bill payment

./05-pay_bills.t ..................
1..10
 # Test bill payment against the admin user.
ok 1 - open-ils.storage.direct.actor.user.retrieve returned aou object
ok 2 - User with id = 1 is admin user
 # authtime is 7200, authtoken is b039320a72bbd06c30f0918d1aeeb07a
ok 3 - Have an authtoken
ok 4 - Registered a new workstation
 # authtime is 7200, authtoken is b039320a72bbd06c30f0918d1aeeb07a
ok 5 - Have an authtoken associated with the workstation
ok 6 - Two billable xacts for admin user from previous tests
ok 7 - Both transactions combined have a balance owed of 1.25
ok 8 - Payment attempt returned HASH
ok 9 - Payment response included two payment ids
ok 10 - Zero billable xacts for admin user after payment
ok

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Add a TestUtils library for live tests

Package commonly used live test calls in a new Perl module to they can
be shared by different test scripts.

Based it off of Cronscript.  Added a cache method to Cronscript for getting at
memcached.  TestUtils currently has methods for checkin, checkout, and
workstation registration.

Ported existing live tests to use TestUtils.

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Adding 0842, 0843 to help with 0841 deficiencies

A clean backport of 0841 was not possible due to partial schema
differences in the upgrade.  While we may have planned ahead better,
add 0842 just for 2_3 upgraders which ends up being a no-op for
2_4, and adds ON UPDATE CASCADE for 2_5.

Also, for similar but additional reasons, add 0843, which serves two
purposes:
  1) add ON UPDATE CASCADE to the rest for those upgrading 2_5/master
  2) alter config.z3950_index_field_map for those upgrading from 2_4
     and previous (other lines are no-ops in this case)

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Remington Steed <rjs7@calvin.edu>
Fix LP1118245: Name Subject facet ordering change

Where Name Subject facet shows subfields in order "cad" and Personal
Author shows subfields in order "acd".  This change makes the Name
Subject show the subfields in the same order as in record view and the
Personal Author facet.

Signed-off-by: Pasi Kallinen <pasi.kallinen@pttk.fi>

NOTE: We are purposely ignoring similar changes to MODS33, pending
a discussion of how best to handle EG specific MODS changes overall.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Tweak MODS32 stylesheet for titles

<titleNonfiling> was added to help certain search cases, but trailing
punctuation makes it unsuitable for display.  <titleInfo>, on the other
hand, chops all trailing punctuation out, which helps the trailing case
but actually makes display of subtitle information worse.  Let's split
the difference and simplify at the same time by building the whole
title, then trimming extra punctuation.

While the above was done to help in browse display, it turns out that
<titleNonfiling> is not able to generate correct browse data.  We want
the display as corrected above, but we also need to preserve the
<nonSort> tag for proper browse sorting.

Rather than complicate the metabib logic, we'll add another special-
purpose field to the MODS called <titleBrowse>. This field is a hybrid
of <titleInfo> and <titleNonfiling>, which will give us a preformatted
string (for preserving needed punctuation) but also keep the <nonSort>
stuff in a separate field (for sorting).

NOTE: We are purposely ignoring similar changes to MODS33, pending
a discussion of how best to handle EG specific MODS changes overall.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Add new MODS <titleBrowse> to the default config

Now that we have a field which will both display and sort how we
want it, use it.

Also, remove the browse info from the 'Title Proper' row (id = 6).

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Upgrade script for better MODS browse and Name Subject facets

This upgrade covers the three previous commits:

  * Add new MODS <titleBrowse> to the default config
  * Tweak MODS32 stylesheet for titles
  * Fix LP1118245: Name Subject facet ordering change

Since these all deal with the in-db MODS xsl, it made sense to lump
the upgrades together.

NOTE: We are purposely ignoring similar changes to MODS33, pending
a discussion of how best to handle EG specific MODS changes overall.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Don't index browse extracts as search terms unless needed

In previous releases, we didn't have any major config.metabib_field
rows which had 'browse_field = true' but 'search_field = false'.  Now
that we have one (for title browse), make sure we honor the
'search_field = false' by not creating rows in the
metabib.xxxxxx_field_entry tables.

This gets us back to where we started as far as what gets into the
search index tables, but we should consider going a step further and
*not* adding the glommed row to the search tables if we are already
adding separate rows for search+browse.

Signed-off-by: Dan Wells <dbw2@calvin.edu>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>