MCR-3388 Duplicate Detection and handling - #1484
Open
sebhofmann wants to merge 4 commits into
Open
Conversation
Intercept the metadata import before the editor opens, check for possible duplicates via the mycore-dedup component and require explicit confirmation before continuing. MIRImportServlet builds the imported object, caches it in the session and runs dedup:duplicates-for-session. When duplicates are found the duplicatecheck.xsl page shows them using the search result display (basketContent mode). The editor then loads the cached object from the session. Adds the mycore-dedup dependency, allows the mir.import. session key prefix and the i18n keys mir.import.dedup.* for de and en.
When the user confirms that none of the presented objects is a duplicate, the imported object has no id yet, so the confirmation cannot be stored as a no-duplicate marking. Instead one service flag per confirmed object id is added to the cached object, using the flag type configured by MCR.DeDup.NoDuplicateFlagType. MCRDeDupNoDuplicateFlagEventHandler turns those flags into markings once the object is stored. The confirmed ids are kept in the session instead of being passed through the url, so that only objects this servlet has presented can be marked. The session key of the imported object is now checked against its prefix before it is passed on to the editor.
Link the duplicate management provided by mycore-dedup-gui from the content admin group of the user menu. The entry is only shown to editors and administrators: navigation items are filtered by the read permission of their webpage id. Grants the manage-deduplication permission checked by MCRDeDupVueServlet and read access to webpage:/dedup/ in both access systems, so the rules are in place for new installations via cli and wizard as well.
The page listing the possible duplicates gave no clue that it belongs to an import the user started before. It now names the publication that is about to be imported (title and identifier, taken from the object built by the servlet, which is not stored yet and therefore cannot be rendered like the duplicates below) and says so in title and intro text. The buttons name the import as well, so that "continue" cannot be mistaken for anything else. The mir.import.dedup.* keys were also sorted into the right place in both message files.
sebhofmann
marked this pull request as ready for review
August 11, 2026 14:00
yagee-de
self-requested a review
August 18, 2026 11:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to jira.
Uses the new
mycore-dedupandmycore-dedup-guicomponents in MIR. Counterpart of MyCoRe-Org/mycore#3096, which has to be merged first.There is no MIR ticket yet, so the branch and the commits carry the MyCoRe ticket.
What this does
Duplicate check during import (
MIRImportServlet,xslt/duplicatecheck.xsl)content/publish/index.xml,content/publish/importPPN.xml) submit toMIRImportServletinstead of opening the editor directly.mycoreobjectfrom the imported metadata, caches it in the session and asksdedup:duplicates-for-session:{key}for existing objects sharing a deduplication key.session:{key}.MCR.DeDup.NoDuplicateFlagType. The flags survive the editor and are turned into permanent no-duplicate markings byMCRDeDupNoDuplicateFlagEventHandleronce the object is stored and has an id. The ids come from the session, not from the request, so only objects that were actually presented can be marked.Duplicate management in the navigation
/dedup/added to thecontentadmingroup ofnavigation.xml.rules/rules-dedup.xml) grantmanage-deduplicationand read access towebpage:/dedup/to editors and administrators,rules-webpage.xmlexcludes the path from the public catch-all.manage-deduplicationinmir-cli/.../acl/permissions.xml, the webpage rule inwebacl-commands.txtand in the wizard commands.Notes