Skip to content
Ere Maijala edited this page Oct 29, 2021 · 4 revisions

Record Drivers

Many RecordManager functions are based on record drivers that abstract many aspects of different formats. All record drivers are derived from the abstract \RecordManager\Base\Record\Base class, which documents the required functionality. If deduplication or component part handling is not required, there are only a couple of methods that need to be implemented. See the BaseRecord.php file for comments, and other classes for examples.

Customizing a Record Driver

The base drivers in RecordManager are built to mimic VuFind's indexing features. The Finna namespace contains extensions specific to Finna. The idea is that there is a record driver for each format, and the drivers provide the necessary transformations to the Solr schema, whatever it is. There is, for instance, a \RecordManager\Base\Record\Dc class and in it a toSolrArray method that does the mapping from Dublin Core to the Solr schema. Alternatively it is possible to create an XSL transformation to do the job instead of PHP code (you can configure the transformation to be used by setting solrTransformation in datasources.ini), but it's quite a bit slower to run.

The format setting in datasources.ini specifies the record driver to be used. For example

format = dc

makes RecordManager use Dc class for the format.

For customization it is recommended to create a custom module and add the record driver in your own namespace, e.g. \RecordManager\Custom\Record\Dc. This makes updating RecordManager easier and provides a clear separation of your own extensions from the base code. Use the module configuration to specify the record drivers to use for each format.