CAROUSELS - OTHER ADMINISTRATIVE FEATURES

New Staff Permissions

Includes new staff permissions:

  • ADMIN_CAROUSEL_TYPES - allows users to create, edit, or delete carousel types
  • ADMIN_CAROUSELS - allows users to create, edit, or delete carousels
  • REFRESH_CAROUSEL - allows users to perform a manual refresh of carousels

New Database Tables

A new table was added to the database to specify the carousel and how it is to be populated, including the name, owning library, details about the most recent refresh, and a link to the Record Bucket and its contents.

Another new table defines carousel types and includes the name, whether the carousel is manually or automatically maintained, and a link to the QStore query specifying the foundation database query used to populate the carousel.

A third new table defines the set of organizational units at which the carousel is visible and the display order in which carousels should be listed at each organizational unit.

OPAC Templates

Carousels display on the public catalog home page by default. Administrators can modify the public catalog templates to display carousels where desired.

A new Template Toolkit macro called “carousels” allows the Evergreen administrator to inject the contents of one or more carousels into any point in the OPAC. The macro will accept the following parameters:

  • carousel_id
  • dynamic (Boolean, default value false)
  • image_size (small, medium, or large)
  • width (number of titles to display on a “pane” of the carousel)
  • animated (Boolean to specify whether the carousel should automatically cycle through its panes)
  • animation_interval (the interval (in seconds) to wait before advancing to the next pane)

If the carousel_id parameter is supplied, the carousel with that ID will be displayed. If carousel_id is not supplied, all carousels visible to the public catalog’s physical_loc organizational unit is displayed.

The dynamic parameter controls whether the entire contents of the carousel should be written in HTML (dynamic set to false) or if the contents of the carousel should be asynchronously fetched using JavaScript.

A set of CSS classes for the carousels and their contents will be exposed in style.css.tt2. Lightweight JavaScript was used for navigating the carousels, based either on jQuery or native JavaScript. The carousels are responsive.

Accessibility Features

  • Users can advance through the carousel using only a keyboard
  • Users can navigate to a title from the carousel using only a keyboard
  • Users pause animated carousels
  • Changes in the state of the carousel are announced to screen readers.

OpenSRF

Several Evergreen APIs are used to support the following operations:

  • refreshing the contents of an individual carousel
  • refreshing the contents of all automatically-maintained carousels that are overdue for refresh
  • retrieving the names and contents of a carousel or all visible ones
  • creating a carousel by copying and existing record bucket

The retrieval APIs allow for anonymous access to permit Evergreen admins to create alternative implementation of the carousel display or to share the carousels with other systems. [h]

Cron Job

The carousels feature includes a cronjob added to the example crontab to perform automatic carousel refreshes. It is implemented as a srfsh script that invokes open-ils.storage.carousel.refresh_all.