Skip to content

Commit

Permalink
Save publication after repair event (#326)
Browse files Browse the repository at this point in the history
* Save publication after repair event
* Removed unused import
  • Loading branch information
fluetze authored Sep 14, 2023
1 parent c84f119 commit e64299e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.mycore.ubo.publication;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
Expand All @@ -19,6 +20,7 @@
import org.mycore.common.config.MCRConfigurationException;
import org.mycore.common.events.MCREvent;
import org.mycore.common.events.MCREventHandlerBase;
import org.mycore.datamodel.common.MCRXMLMetadataManager;
import org.mycore.datamodel.metadata.MCRObject;
import org.mycore.ubo.matcher.MCRUserMatcher;
import org.mycore.ubo.matcher.MCRUserMatcherDTO;
Expand Down Expand Up @@ -142,6 +144,7 @@ protected void handleObjectUpdated(MCREvent evt, MCRObject obj) {
@Override
protected void handleObjectRepaired(MCREvent evt, MCRObject obj) {
handlePublication(obj);
MCRXMLMetadataManager.instance().update(obj.getId(), obj.createXML(), new Date());
}

protected void handlePublication(MCRObject obj) {
Expand Down Expand Up @@ -198,7 +201,7 @@ protected void handlePublication(MCRObject obj) {
} else {
Optional<Element> leadId = modsNameElement.getChildren("nameIdentifier", MCRConstants.MODS_NAMESPACE)
.stream()
.filter(element -> element.getAttributeValue("type").equals(leadIDName))
.filter(element -> leadIDName.equals(element.getAttributeValue("type")))
.findFirst();

if(leadId.isPresent()) {
Expand Down

0 comments on commit e64299e

Please sign in to comment.