-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Item Counts (webui.strengths) by refactoring ItemCounter and ItemCountDAO to act like other Spring beans #9583
Conversation
… Also ensure they do not cache a Context object.
Hi @tdonohue, I've started testing phase. I've noticed that when item is withdrawn, the counter still include it. I've done some small fix for that. Can I push it directly to your branch? |
@damian-joz : If GitHub allows you to push to my branch, then please feel free. If it doesn't allow you, then you could send me a PR to my branch (by creating at PR against my GitHub account: https://github.com/tdonohue/DSpace), or send me the code. Thanks for testing & for finding a fix to the issue you discovered! |
…em model (discoverable, archived, withdrawn)
@tdonohue I've created a PR to your branch. I've also tested a few scenarios:
both for cache(Solr) and non cache solution(Database query) and it works fine. Sometimes it required the refresh of the UI. Just one thing worth to mention, when we will map item to another collection we end up with something like this: |
…em model (discoverable, archived, withdrawn)
…ctor_item_counter
…ctor_item_counter
…ctor_item_counter
Refactor item counter fixes after review
I've merged the improvements that @damian-joz made in tdonohue#15 to this branch. Those are now included in this PR. As @damian-joz has given approval (thanks!), I'll give this another test on my end to make sure everything still works well (after this most recent update). Assuming everything is working well, I'll get this merged for 8.0 and backported to 7.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Retested this again today and verified that @damian-joz 's changes work well. Non-discoverable items are no longer included in counts. Additionally, withdrawn items are no longer included in counts. When withdrawing an Item or making it undiscoverable, the counts for parent collections/communities update almost immediately.
So, I think this all looks good! Merging for 8.0 and backporting to 7.x
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin dspace-7_x
git worktree add -d .worktree/backport-9583-to-dspace-7_x origin/dspace-7_x
cd .worktree/backport-9583-to-dspace-7_x
git switch --create backport-9583-to-dspace-7_x
git cherry-pick -x 78f1e4190e0f48bc707416968033578d6ce12b9c d07aab6025a4e23be767146e03bc1964169c8a30 a4c297c94728d17081260e60cb0bc498d7f92a8d 01be5eee419b9d79192ed55a927a4b271a094bb0 |
References
Description
This PR refactors the
ItemCounter
andItemCountDAO
to be Spring beans defined incore-services.xml
. This fixes issues with Item Counts not reloading & issues where it was not possible to use live, database-based counts (viawebui.strengths.cache=false
).This refactor involved the following:
ItemCounter
andItemCountDAO
as beans incore-services.xml
ItemCountDAO
configuration fromdspace.cfg
as it is now configured viacore-services.xml
Context
object inItemCountDAO
. This resulted in database connection errors when the Context was outdatedcountArchivedItems()
methods fromCommunity
andCollection
as these were just wrappers around the same methods inCommunityService
andCollectionService
.ItemCountDAOFactory
andItemCountException
(the exception handling was updated to use log.error as otherwise item counting exceptions would crash the UI).Instructions for Reviewers
webui.strengths.show = true
andwebui.strengths.cache=true
on the backend. This tells the backend to use Solr for all Item Countswebui.strengths.show = true
andwebui.strengths.cache=false
on the backend. This tells the backend to use the Database for all Item counts.main
anddspace-7_x
they will throw errors as described in the ticket)