Koha/installer/data/mysql/mandatory
Julian Maurice 4978f3d562 Bug 11083: Add ability to generate authority summary using XSLT
This patch only affects authority search results in the staff interface.
It adds a new system preference AuthorityXSLTResultsDisplay. If set,
each authority search result MARCXML will be transformed using the XSLT
at the given filename or URL. The output will be displayed in place of
the default summary.
If errors occur, the XSLT is ignored and the default summary is
displayed.

The syspref value can contain {langcode} and {authtypecode} which will
be replaced by the appropriate value (resp. current language and
authority type code)

Test plan:
1. Apply patch and run updatedatabase
2. Verify that authority search results are not affected yet.
3. Create an XSLT file (for instance in
/home/koha/xslt/en/GEOGR_NAME.xsl)
4. Set AuthorityXSLTResultsDisplay syspref value to
/home/koha/xslt/{langcode}/{authtypecode}.xsl
5. Do an authority search that returns GEOGR_NAME results. Verify that
the summary matches what you expect from your XSLT
6. Do an authority search that returns authorities of other types.
Verify that the default summary is displayed.

Example of a minimal XSLT:

<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:marc="http://www.loc.gov/MARC21/slim"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output omit-xml-declaration="yes"/>
  <xsl:template match="marc:record">
    <xsl:element name="div">
      <xsl:attribute name="class">
        <xsl:text>authority-summary</xsl:text>
      </xsl:attribute>
      <xsl:value-of
        select="marc:datafield[@tag='151']/marc:subfield[@code='a']"/>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2022-04-08 15:49:15 +02:00
..
account_credit_types.sql
account_debit_types.sql Bug 27946: (QA follow-up) Remove 'scan' terminology, requests may not be scans 2022-01-28 11:09:07 -10:00
audio_alerts.sql
auth_val_cat.sql
keyboard_shortcuts.sql
message_transport_types.sql
sample_notices_message_attributes.sql Bug 29586: Fix typos in installer files 2021-12-13 15:52:29 -10:00
sample_notices_message_transports.sql Bug 29586: Fix typos in installer files 2021-12-13 15:52:29 -10:00
subtag_registry.sql Bug 29596: Add Yiddish language 2022-02-01 21:39:39 -10:00
sysprefs.sql Bug 11083: Add ability to generate authority summary using XSLT 2022-04-08 15:49:15 +02:00
userflags.sql Bug 19532: Database and installer stuff 2022-03-14 22:45:50 -10:00
userpermissions.sql Bug 19532: Database and installer stuff 2022-03-14 22:45:50 -10:00