As of right now, the authority hierarchy code works only with UNIMARC. There is, however, no reason why it should not also work with MARC21, and we propose to add support for MARC21 to the authority hierarchy code.
Created attachment 11360 [details] [review] Bug 8523: Display auth hierarchies w/all marcflavours This commit adds support for displaying authority hierarchies for all flavours of MARC, not just UNIMARC. Display now uses the jQuery jstree plugin, selected with the help of Owen Leonard, resulting in a much faster experience for users. Be aware that the jstree file uses tabs rather than 4-space indentation, which I left as-is so as to make it easier to integrate upstream releases in the future. To test: 1) Enable the AuthDisplayHierarchy syspref 2) Create authority records with a hierarchy of see also fields (in MARC21/NORMARC, you'll be using 5xx fields for this, with a subfield $w=g for broader terms and subfield $w=h for narrower terms) 3) View the authorities in the OPAC, noting the hierarchical view at the top of the page.
I can't sign-off before the end of August. But I have 2 libraries using the authority hierarchy display with UNIMARC. So I really want to confirm that this patch doesn't imply any regression before it is pushed.
(In reply to comment #2) > I can't sign-off before the end of August. But I have 2 libraries using the > authority hierarchy display with UNIMARC. So I really want to confirm that > this patch doesn't imply any regression before it is pushed. This was one of my major concerns when writing the code, and I believe there are not any. However, I had limited UNIMARC authority data to test with. If you would be willing to send me more examples of hierarchical UNIMARC authorities, I would love to test the code against those, and fix any problems I find.
Hi Jared, I really like the new hiearchy view! I found 2 smaller problems testing this: 1) There is a doubled up )) in the database update message. 2) I created a topical subject B with a wider term A. The hierarchy shows nicely when I am on the lowest level. When I click on the higher level term A the lower hierarchies vanish from the tree view. Hope that is an understandable description :) 3) Suggestion: It took me a moment to figure out that the tree had clickable links, maybe a hover effect like we have on other links would make it clearer.
(In reply to comment #4) > Hi Jared, I really like the new hiearchy view! I found 2 smaller problems > testing this: > > 1) There is a doubled up )) in the database update message. Fixed. > 2) I created a topical subject B with a wider term A. The hierarchy shows > nicely when I am on the lowest level. When I click on the higher level term > A the lower hierarchies vanish from the tree view. Hope that is an > understandable description :) It is. However, this is the way the feature currently works with UNIMARC (which requires bidirectional links). Rather than make too large a change at once, I propose starting with my revised patch, which will still have this problem, and then, once it's working I'll do a follow-up adding a cron job to generate bidirectional links from the unidirectional links that are endemic to MARC21. Does this sound fair? > 3) Suggestion: It took me a moment to figure out that the tree had clickable > links, maybe a hover effect like we have on other links would make it > clearer. I changed the way links appear. Let me know what you think.
Created attachment 11885 [details] [review] Bug 8523: Display auth hierarchies w/all marcflavours This commit adds support for displaying authority hierarchies for all flavours of MARC, not just UNIMARC. Display now uses the jQuery jstree plugin, selected with the help of Owen Leonard, resulting in a much faster experience for users. Be aware that the jstree file uses tabs rather than 4-space indentation, which I left as-is so as to make it easier to integrate upstream releases in the future. To test: 1) Enable the AuthDisplayHierarchy syspref 2) Create authority records with a hierarchy of see also fields (in MARC21/NORMARC, you'll be using 5xx fields for this, with a subfield $w=g for broader terms and subfield $w=h for narrower terms) 3) View the authorities in the OPAC, noting the hierarchical view at the top of the page. This initial patch does not create bidirection linkages from unidirectional links in MARC21 authorities. This means that when moving up the authority hierarchy, lower levels will disappear. This is intentional, as the first patch is intended merely to ensure that AuthDisplayHierarchy functions the same for all marcflavours. A future patch will add a cron job to generate the bidirectional linkages, once we are sure that the hierarchy functionality for UNIMARC and MARC21/NORMARC coexists peaceably.
Created attachment 12083 [details] [review] Bug 8523 follow-up: support NORMARC, too Thanks to Katrin for pointing out that the original patch left NORMARC a second-class citizen.
Created attachment 12084 [details] [review] Bug 8523: fix translatability The translator script was unable to handle arrayrefs in TT, so this patch modifies the way the hierarchy generator recurses to avoid the need for them.
Created attachment 12086 [details] [review] Bug 8523 follow-up: always regenerate non-UNIMARC hierarchies
Created attachment 12089 [details] [review] Bug 8523 follow-up: sanitize HTML in template
Created attachment 12092 [details] [review] Bug 8523 follow-up: correctly handle leaves
Jared, this works almost perfectly now - one small issue: should the tree show me the authority I am currently looking at? For me the tree always shows the highest level when I open an authority from the result list 'details' link and after a refresh of the page.
Created attachment 12097 [details] screenshot For better illustration on how this works and looks like, I am adding a screenshot. It looks nice!
Frederic and Paul: I am testing this feature and I have created a UNIMARC installation using the sample database from the sandboxes. If you can give me some hints about how to catalogue the authorities correctly, I can try repeating my tests for UNIMARC.
Created attachment 12100 [details] [review] Bug 8523 follow-up: quiet warning
(In reply to comment #12) > Jared, this works almost perfectly now - one small issue: should the tree > show me the authority I am currently looking at? For me the tree always > shows the highest level when I open an authority from the result list > 'details' link and after a refresh of the page. Could you take a screenshot of what you see right when you refresh? When I refresh, the hierarchy is automatically open to the current node.
(In reply to comment #16) > Could you take a screenshot of what you see right when you refresh? When I > refresh, the hierarchy is automatically open to the current node. Never mind. Additional information over IRC has clarified the problem. Patch forthcoming.
Created attachment 12101 [details] [review] Bug 8523 follow-up: always open tree to current node
Created attachment 12125 [details] [review] [SIGNED-OFF] Bug 8523: Display auth hierarchies w/all marcflavours This commit adds support for displaying authority hierarchies for all flavours of MARC, not just UNIMARC. Display now uses the jQuery jstree plugin, selected with the help of Owen Leonard, resulting in a much faster experience for users. Be aware that the jstree file uses tabs rather than 4-space indentation, which I left as-is so as to make it easier to integrate upstream releases in the future. To test: 1) Enable the AuthDisplayHierarchy syspref 2) Create authority records with a hierarchy of see also fields (in MARC21/NORMARC, you'll be using 5xx fields for this, with a subfield $w=g for broader terms and subfield $w=h for narrower terms) 3) View the authorities in the OPAC, noting the hierarchical view at the top of the page. This initial patch does not create bidirection linkages from unidirectional links in MARC21 authorities. This means that when moving up the authority hierarchy, lower levels will disappear. This is intentional, as the first patch is intended merely to ensure that AuthDisplayHierarchy functions the same for all marcflavours. A future patch will add a cron job to generate the bidirectional linkages, once we are sure that the hierarchy functionality for UNIMARC and MARC21/NORMARC coexists peaceably. Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Resolved conflicts in updatedatabase.pl, sysprefs.sql and in one of the CSS files. Test plan: 1) Run t/AuthoritiesMarc.t New tests complete without any errors. 2) Make sure updatedatabase works correctly. Update works nicely, new system preference is also added to syspref.sql 3) Make sure new terms are translatable. Created new po files for de-DE and checked for new terms. All translations appear correctly. 4) Make sure everything works with AuthDisplayHieararchy OFF - Add authority - Edit authority - Delete authority 5) Test feature with AuthDisplayHieararchy ON - Add authority - Edit authority - Delete authority 6) Add a couple of hierarchically linked authorities Note: links have to be created in both directions Example: 151 $aGermany 551 $a Baden-Württemberg $w h 151 $aBaden-Württemberg 551 $a Konstanz $w h 551 $a Germany $w g 151 $aKonstanz 551 $a Baden-Württemberg $w g 551 $a Fürstenberg $w h 551 $a Paradies $w h 151 $a Fürstenberg 551 $a Konstanz $w g 151 $a Paradies 551 $a Konstanz $w g Tree shows up nicely above the authority record - in staff - in OPAC - on the normal view tab - on the MARC view tab 7) Checking the logs for warnings - no Javascript errors or warnings - no warnings or errors in log files
This is a very cool feature *nudge*
QA comment: * passes koha-qa.pl * switch from something UNIMARC specific to MARC agnostic, plus introduce a more modern (& probably robust) way to handle/display hierarchies 2 small glitches, that are not worth failing QA but should be improved later: my authorities where 250$a Jardinage 250 $aJardinage$xLégumes 550$5b$aJardinage 550$5h$aJardinage bio The hierarchy is: Jardinage + Jardinage légumes + Jardinage bio BUT, as the "Legumes" is in $x and we display only the $a in the hierarchy, we see: Jardinage + Jardinage + Jardinage bio It's not the most common case in UNIMARC, but it happens. * the authority-detail still show Broader term & Narrower term when the hierarchy is ON. Maybe we could remove them ? (see screenshot) Overall = passed QA
Patch pushed to master with some followup: * one for perlcritic C4/AuthoritiesMarc.pm * one for adding needed css for ccsr theme
Created attachment 12565 [details] looks different I'm trying to document this feature and have an authority with 500s on it (and I have the authorities for those 500s) but I'm not seeing anything but the one heading. Can you please give me an example of what to enter (a link to a LOC authority is fine) to see this in action on my system in Marc21? Nicole
After conversation with Frédéric, it sounds like this patch really is more of a bugfix than an enhancement, since auth hierarchy support is definitely missing from MARC21/NORMARC, and this also improves the situation for UNIMARC installs (particularly in terms of performance). As such, this could be a candidate for 3.8.x.
I'm not against pushing this patch in 3.8, but just want to point that it changes some things in the display. This may trouble some users.
(En réponse au commentaire 25) > I'm not against pushing this patch in 3.8, but just want to point that it > changes some things in the display. This may trouble some users. It won't change that much for libraries using non-hierarchical authorities. For libraries having a thesaurus (authorities with semantic relations), the authorities are broken in 3.8 (bug 8870), and this bug (8523) is required to fix 8870.
Released in 3.10.0