mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 15:03:18 +00:00
[CSTPER-221] Minor changes and cleanup
This commit is contained in:
@@ -142,8 +142,8 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
|
||||
} else {
|
||||
identifierService.register(context, newCollection, handle);
|
||||
}
|
||||
} catch (IdentifierException e) {
|
||||
throw new RuntimeException("Can't create an Identifier!");
|
||||
} catch (IllegalStateException | IdentifierException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
|
||||
// create the default authorization policy for collections
|
||||
|
@@ -100,10 +100,11 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
|
||||
} else {
|
||||
identifierService.register(context, newCommunity, handle);
|
||||
}
|
||||
} catch (IdentifierException e) {
|
||||
throw new RuntimeException("Can't create an Identifier!");
|
||||
} catch (IllegalStateException | IdentifierException ex) {
|
||||
throw new IllegalStateException(ex);
|
||||
}
|
||||
|
||||
|
||||
if (parent != null) {
|
||||
parent.addSubCommunity(newCommunity);
|
||||
newCommunity.addParentCommunity(parent);
|
||||
|
@@ -170,6 +170,7 @@ public class DOIIdentifierProvider
|
||||
public String register(Context context, DSpaceObject dso)
|
||||
throws IdentifierException {
|
||||
if (!(dso instanceof Item)) {
|
||||
// DOI are currently assigned only to Item
|
||||
return null;
|
||||
}
|
||||
String doi = mint(context, dso);
|
||||
@@ -183,6 +184,7 @@ public class DOIIdentifierProvider
|
||||
public void register(Context context, DSpaceObject dso, String identifier)
|
||||
throws IdentifierException {
|
||||
if (!(dso instanceof Item)) {
|
||||
// DOI are currently assigned only to Item
|
||||
return;
|
||||
}
|
||||
String doi = doiService.formatIdentifier(identifier);
|
||||
|
@@ -149,6 +149,7 @@ public class EZIDIdentifierProvider
|
||||
log.debug("register {}", dso);
|
||||
|
||||
if (!(dso instanceof Item)) {
|
||||
// DOI are currently assigned only to Item
|
||||
return null;
|
||||
}
|
||||
DSpaceObjectService<DSpaceObject> dsoService = contentServiceFactory.getDSpaceObjectService(dso);
|
||||
@@ -175,6 +176,7 @@ public class EZIDIdentifierProvider
|
||||
log.debug("register {} as {}", object, identifier);
|
||||
|
||||
if (!(object instanceof Item)) {
|
||||
// DOI are currently assigned only to Item
|
||||
return;
|
||||
}
|
||||
EZIDResponse response;
|
||||
|
@@ -236,11 +236,6 @@ public class CollectionRestRepository extends DSpaceObjectRestRepository<Collect
|
||||
throw new UnprocessableEntityException("Error parsing request body.", e1);
|
||||
}
|
||||
|
||||
if (collectionRest.getMetadata().getMap().containsKey("dc.identifier.uri")) {
|
||||
throw new UnprocessableEntityException("Handle identifier cannot be passed "
|
||||
+ "as metadata during collection creation.");
|
||||
}
|
||||
|
||||
Collection collection;
|
||||
try {
|
||||
Community parent = communityService.find(context, id);
|
||||
|
@@ -135,11 +135,6 @@ public class CommunityRestRepository extends DSpaceObjectRestRepository<Communit
|
||||
throw new UnprocessableEntityException("Error parsing request body.", e1);
|
||||
}
|
||||
|
||||
if (communityRest.getMetadata().getMap().containsKey("dc.identifier.uri")) {
|
||||
throw new UnprocessableEntityException("Handle identifier cannot be passed "
|
||||
+ "as metadata during community creation.");
|
||||
}
|
||||
|
||||
Community community;
|
||||
|
||||
try {
|
||||
|
Reference in New Issue
Block a user