LP#1427287: MARC tag-table service
authorGalen Charlton <gmc@esilibrary.com>
Mon, 2 Mar 2015 17:14:30 +0000 (17:14 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 17 Aug 2015 22:40:44 +0000 (22:40 +0000)
commitfb95366553c0d92a9a7c0ea6092a5e3e50ae0512
tree1c05fcffca3d9910dffc85cb27eaa6707ed3103f
parent6d53ac9b3b6927dbdf25488f5d6234540f0af0fc
LP#1427287: MARC tag-table service

This patch teaches the Evergreen database how to store
information about MARC fields, subfields, and values that
can be associated with subfields.  The initial application
of the tag-table service is supplying the webstaff MARC editor
with data for context menus for selecting valid tag, indicator
value, subfield code, and subfield values.

A record attribute's coded value map can be associated with a
MARC subfield and returned by the tag-table service.  This is for
supporting the use of controlled vocabularies for subfield values in
the MARC editor.

Database schema
---------------
Tables:

* config.marc_format:   list of MARC formats; at present, however,
                        only MARC21 is supported
* config.marc_field:    list of fields recognized by the Evergreen
                        database.
* config.marc_subfield: list of subfields recognized by Evergreen

Views:

* config.marc_field_for_ou
* config.marc_subfield_for_ou

These two views assist in the process of determining the set of
MARC fields and subfields are meant to be in force at a particular
OU.  These are generally not meant to be queried directly, in
favor of the config.ou_marc_{sub}fields() functions.

Functions:

* config.ou_marc_fields(marc_format, marc_record_type, ou)
* config.ou_marc_subfields(marc_format, marc_record_type, ou)

These functions return the authoritative set of fields or
subfields in force at a given OU.

OpenSRF methods
---------------
This patch adds methods to open-ils.cat for
retrieving either the entire tag table or just the list
of MARC fields, either from the stock MARC format
seed definition or as potentially customized for the user's
workstation OU:

open-ils.cat.tag_table.all.retrieve.stock
open-ils.cat.tag_table.all.retrieve.local
open-ils.cat.tag_table.field_list.retrieve.stock
open-ils.cat.tag_table.field_list.retrieve.local

To use these methods, the user must have UPDATE_MARC permission.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Cat.pm
Open-ILS/src/sql/Pg/002.schema.config.sql
Open-ILS/src/sql/Pg/500.view.cross-schema.sql
Open-ILS/src/sql/Pg/800.fkeys.sql
Open-ILS/src/sql/Pg/upgrade/lp1427287_1of3.schema.marc-tag-tables.sql [new file with mode: 0644]