mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 12:03:09 +00:00
[CSTPER-221] Handle Providers enhanced for Communities and Collections
This commit is contained in:
@@ -37,6 +37,8 @@ import org.dspace.core.LogManager;
|
||||
import org.dspace.eperson.Group;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.identifier.IdentifierException;
|
||||
import org.dspace.identifier.service.IdentifierService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
@@ -69,6 +71,8 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
protected BitstreamService bitstreamService;
|
||||
@Autowired(required = true)
|
||||
protected SiteService siteService;
|
||||
@Autowired(required = true)
|
||||
protected IdentifierService identifierService;
|
||||
|
||||
protected CommunityServiceImpl() {
|
||||
super();
|
||||
@@ -92,13 +96,12 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
|
||||
try {
|
||||
if (handle == null) {
|
||||
handleService.createHandle(context, newCommunity);
|
||||
identifierService.register(context, newCommunity);
|
||||
} else {
|
||||
handleService.createHandle(context, newCommunity, handle);
|
||||
identifierService.register(context, newCommunity, handle);
|
||||
}
|
||||
} catch (IllegalStateException ie) {
|
||||
//If an IllegalStateException is thrown, then an existing object is already using this handle
|
||||
throw ie;
|
||||
} catch (IdentifierException e) {
|
||||
throw new RuntimeException("Can't create an Identifier!");
|
||||
}
|
||||
|
||||
if (parent != null) {
|
||||
|
Reference in New Issue
Block a user