mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
Merge branch 'main' into CST-7754
# Conflicts: # dspace-api/src/main/java/org/dspace/content/InstallItemServiceImpl.java
This commit is contained in:
@@ -10,9 +10,14 @@ package org.dspace.content;
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.logic.Filter;
|
||||
import org.dspace.content.logic.FilterUtils;
|
||||
import org.dspace.content.service.CollectionService;
|
||||
import org.dspace.content.service.InstallItemService;
|
||||
import org.dspace.content.service.ItemService;
|
||||
@@ -20,6 +25,7 @@ import org.dspace.core.Constants;
|
||||
import org.dspace.core.Context;
|
||||
import org.dspace.embargo.service.EmbargoService;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.identifier.Identifier;
|
||||
import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.dspace.supervision.SupervisionOrder;
|
||||
@@ -46,9 +52,11 @@ public class InstallItemServiceImpl implements InstallItemService {
|
||||
protected ItemService itemService;
|
||||
@Autowired(required = true)
|
||||
protected SupervisionOrderService supervisionOrderService;
|
||||
@Autowired(required = false)
|
||||
|
||||
Logger log = LogManager.getLogger(InstallItemServiceImpl.class);
|
||||
|
||||
protected InstallItemServiceImpl() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,10 +71,14 @@ public class InstallItemServiceImpl implements InstallItemService {
|
||||
AuthorizeException {
|
||||
Item item = is.getItem();
|
||||
Collection collection = is.getCollection();
|
||||
// Get map of filters to use for identifier types.
|
||||
Map<Class<? extends Identifier>, Filter> filters = FilterUtils.getIdentifierFilters(false);
|
||||
try {
|
||||
if (suppliedHandle == null) {
|
||||
identifierService.register(c, item);
|
||||
// Register with the filters we've set up
|
||||
identifierService.register(c, item, filters);
|
||||
} else {
|
||||
// This will register the handle but a pending DOI won't be compatible and so won't be registered
|
||||
identifierService.register(c, item, suppliedHandle);
|
||||
}
|
||||
} catch (IdentifierException e) {
|
||||
|
Reference in New Issue
Block a user