Better native support for consortia

Details

Description

VuFind is currently in use by several library consortia, but they rely on local modifications. We should try to get some consortium-oriented functionality into the base code so that it requires less work to get VuFind up and running in a consortial environment.

Some example features:

- Ability to filter to a single library or show all libraries' holdings (perhaps a new generic faceting mechanism could be added that inserts a drop-down list into the UI and remembers the setting of the drop-down across all pages).

- Ability to show holdings differently depending on currently selected home library.

Activity

Based on vufind-tech conversations, a proposed algorithm for determining the current user's home library. Note that this is untested code and probably needs some extra details added to validate values; however, it should demonstrate the basic idea.

function getHomeLibrary()
{
// Is home library already determined in the session? (This may be a cached value from
// the logic below, or it may have been set by the user via a UI control). If so, send it back:
if (isset($_SESSION['homeLibrary'])) {
return $_SESSION['homeLibrary'] ;
// Home library may be specified via GET/POST or cookie -- all show up in $_REQUEST;
// this allows flexibility in how different sites set up location-specific instances of VuFind.
// You can set persistent cookies on machines at particular locations, or you can create
// custom search forms or links from certain places.
} else if (isset($_REQUEST['homeLibrary'])) {
$_SESSION['homeLibrary'] = $_REQUEST['homeLibrary'];
// If setting did not come from a cookie, we should store one so the setting will remain
// in $_REQUEST even if $_SESSION gets cleared (for example, by a user logging out)
// and the GET/POST parameter is no longer present.
if (!isset($_COOKIE['homeLibrary'])) {
setcookie('homeLibrary', $_SESSION['homeLibrary']);
}
// If no home library was found in the session or the request, default to all available libraries:
} else {
$_SESSION['homeLibrary'] = 'All Libraries';
return $_SESSION['homeLibrary'];
}
}

Notes:

1.) It would be theoretically possible to add IP detection and mapping between the $_REQUEST case and the default case if we wanted to allow home library to be determined by IP range. However, since there is no current demand for such a feature, it was left out of the prototype code above.

2.) There was some discussion of using a user's home library (as defined by ILS) to determine their setting after they have logged in. However, it could be very confusing for users if logging in caused their search results to suddenly change (due to different location-specific filtering). If we want logging in to affect the home library setting, it would only really make sense as some kind of "opt-in" setting, and that seems of marginal value at best. We're omitting the whole possibility for now.

Demian Katz
added a comment - 26/Mar/10 1:25 PM Based on vufind-tech conversations, a proposed algorithm for determining the current user's home library. Note that this is untested code and probably needs some extra details added to validate values; however, it should demonstrate the basic idea.
function getHomeLibrary()
{
// Is home library already determined in the session? (This may be a cached value from
// the logic below, or it may have been set by the user via a UI control). If so, send it back:
if (isset($_SESSION['homeLibrary'])) {
return $_SESSION['homeLibrary'] ;
// Home library may be specified via GET/POST or cookie -- all show up in $_REQUEST;
// this allows flexibility in how different sites set up location-specific instances of VuFind.
// You can set persistent cookies on machines at particular locations, or you can create
// custom search forms or links from certain places.
} else if (isset($_REQUEST['homeLibrary'])) {
$_SESSION['homeLibrary'] = $_REQUEST['homeLibrary'];
// If setting did not come from a cookie, we should store one so the setting will remain
// in $_REQUEST even if $_SESSION gets cleared (for example, by a user logging out)
// and the GET/POST parameter is no longer present.
if (!isset($_COOKIE['homeLibrary'])) {
setcookie('homeLibrary', $_SESSION['homeLibrary']);
}
// If no home library was found in the session or the request, default to all available libraries:
} else {
$_SESSION['homeLibrary'] = 'All Libraries';
return $_SESSION['homeLibrary'];
}
}
Notes:
1.) It would be theoretically possible to add IP detection and mapping between the $_REQUEST case and the default case if we wanted to allow home library to be determined by IP range. However, since there is no current demand for such a feature, it was left out of the prototype code above.
2.) There was some discussion of using a user's home library (as defined by ILS) to determine their setting after they have logged in. However, it could be very confusing for users if logging in caused their search results to suddenly change (due to different location-specific filtering). If we want logging in to affect the home library setting, it would only really make sense as some kind of "opt-in" setting, and that seems of marginal value at best. We're omitting the whole possibility for now.

Demian Katz
added a comment - 12/Apr/12 8:44 AM It's probably easier to keep track of components if we assign each a separate ticket. We can link issues together, so each component can become a sub-issue of this one.

Sounds good. We're working on an implementation proposal for consortia in VuFind 2. We'll bring that general proposal to the community, refine the points based on the feedback, and then split up the issues from there.

Benjamin Mosior
added a comment - 18/Apr/12 8:25 AM Sounds good. We're working on an implementation proposal for consortia in VuFind 2. We'll bring that general proposal to the community, refine the points based on the feedback, and then split up the issues from there.

I've expanded on the current library patch. One thing I noticed is that the autocomplete would return snippets that did not belong to the selected library. I also applied the $_COOKIE['location'] code to initBrowseScreen. I've attached the updated patch for Solr.php.

Alan Rykhus
added a comment - 20/Apr/12 10:48 AM I've expanded on the current library patch. One thing I noticed is that the autocomplete would return snippets that did not belong to the selected library. I also applied the $_COOKIE['location'] code to initBrowseScreen. I've attached the updated patch for Solr.php.

We've been looking into getting a well-established method for a consortial implementation in place. We'd like to stimulate more discussion and take a look at what needs to be done to make this a possibility.

Benjamin Mosior
added a comment - 14/May/12 4:31 PM We've been looking into getting a well-established method for a consortial implementation in place. We'd like to stimulate more discussion and take a look at what needs to be done to make this a possibility.
Here's our first look (thanks to Demian for the help): https://docs.google.com/document/d/1R6zhj1JgTCzwP_1zwYk5BNnlkPCexqWhoxf944jeGjA/edit#bookmark=id.2utbhhmuouii