Summary: | Authority search result display in staff interface should be XSLT driven | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize <martin.renvoize> |
Component: | MARC Authority data support | Assignee: | Julian Maurice <julian.maurice> |
Status: | RESOLVED FIXED | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, david, dcook, e.betemps, fridolin.somers, gveranis, julian.maurice, kyle, m.de.rooy, marie-luce.laflamme, marjorie.barry-vila, mspinney, philippe.blouin, vitorfernandes87 |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30036 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35305 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Caroline Cyr La Rose | Documentation submission: | https://gitlab.com/koha-community/koha-manual/-/merge_requests/575 |
Text to go in the release notes: |
This enhancement enables customising the authority search results summary in the staff interface using XSLT (for MARC21 and UNIMARC).
Key features;
- Use the new system preference AuthorityXSLTResultsDisplay to set the location of the XSLT file, either the full path to a file on the Koha server or a URL.
- The system preference value can contain {langcode} and {authtypecode} which will be replaced by the appropriate value.
- If errors occur, the custom XSLT file is ignored and the default summary is displayed.
|
Version(s) released in: |
22.05.00
|
Bug Depends on: | |||
Bug Blocks: | 30554, 32726, 21330 | ||
Attachments: |
Bug 11083: Add ability to generate authority summary using XSLT
Bug 11083: Add sample XSLT for UNIMARC authorities Bug 11083: Add ability to generate authority summary using XSLT Bug 11083: Add sample XSLT for UNIMARC authorities Bug 11083: Add ability to generate authority summary using XSLT Bug 11083: Add sample XSLT for UNIMARC authorities |
Description
Martin Renvoize
2013-10-20 16:16:58 UTC
This would be a great feature for Koha next version. In my opinion authorities search results and authorities details should also be XSLT driven. With this feature, we can have full control of the visualization of the following entities: - OPAC - biblio records search results and details - Staff client - biblio records client search results and details - OPAC - authorities results and details - Staff client - authorities search results and details I also think that ISBD views sould be XSLT driven (bug 20406). Created attachment 121537 [details] [review] 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> I wonder sometimes if we should be getting away from using the XSLTs as they seem slow. I really like the idea of this as currently there is no way to customize the result lists. Julian - will you provide a sample file for UNIMARC? Created attachment 128913 [details] [review] Bug 11083: Add sample XSLT for UNIMARC authorities (In reply to Katrin Fischer from comment #5) > Julian - will you provide a sample file for UNIMARC? It took 6 months, but here it is ;) Created attachment 130051 [details] [review] 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> Created attachment 130052 [details] [review] Bug 11083: Add sample XSLT for UNIMARC authorities Signed-off-by: David Nind <david@davidnind.com> Testing notes (koha-testing-docker): - Tested using provided example XSLT files for MARC21 and UNIMARC. - Visual differences in the authority search results that I noticed: . MARC21: removes the summary text . UNIMARC: adds bullet points in front of the summary text Nice release notes :) I notice that unlike other prefs the new pref has no "default" option that prefills the input field although there is a UNIMARC file submitted with this patch. Should we add one with a note that this is currently for UNIMARC only? But not a blocker for me. I think this works nicely and gives a good base for more improvements later. Do you plan to also make this available for the OPAC? Created attachment 132269 [details] [review] 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> Created attachment 132270 [details] [review] Bug 11083: Add sample XSLT for UNIMARC authorities Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Pushed to master for 22.05, thanks to everybody involved 🦄 Since the 22.05 version + , Koha does not display the 100$e relator term in an authority search. Can you add 100$e in the XSLT? 1. Authority search in authorities-home.pl 1.1 Find an authority personal-name record (e.g. Rowling, J. K. ) 1.2 Add a 100$e relator term (e.g. author or editor) 1.3 Then, search for your authority 1.4 Check names in the results page --> In v21.05 Koha used to show 100$a, 100$b followed by 100$e - relator term --> In 22.05 and master, Koha doesn't display the 100$e anymore 2. Authority search within a bibliographic record (auth_finder.pl) 2.1 Find and edit bibliographic record 2.2 In the 100$a, search for your authority (step 1.1) 2.3 Check names in the results page --> In v21.05 Koha used to show 100$a, 100$b followed by 100$e - relator term --> In 22.05 and master, Koha doesn't display the 100$e anymore Marius has created Bug 32726 to follow up on that. Adds a new system preference, so needs to go into the manual. Ah but the koha-manual merge requests is closed (In reply to Fridolin Somers from comment #18) > Ah but the koha-manual merge requests is closed And you are correct :) |