mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-15 14:03:17 +00:00
[CST-5669] Added OrcidToken entity to store orcid access token
This commit is contained in:
@@ -26,6 +26,8 @@ import java.util.stream.Stream;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.dspace.app.orcid.OrcidToken;
|
||||
import org.dspace.app.orcid.service.OrcidTokenService;
|
||||
import org.dspace.app.util.AuthorizeUtil;
|
||||
import org.dspace.authorize.AuthorizeConfiguration;
|
||||
import org.dspace.authorize.AuthorizeException;
|
||||
@@ -120,6 +122,9 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
@Autowired(required = true)
|
||||
private RelationshipMetadataService relationshipMetadataService;
|
||||
|
||||
@Autowired
|
||||
private OrcidTokenService orcidTokenService;
|
||||
|
||||
protected ItemServiceImpl() {
|
||||
super();
|
||||
}
|
||||
@@ -744,6 +749,11 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
harvestedItemService.delete(context, hi);
|
||||
}
|
||||
|
||||
OrcidToken orcidToken = orcidTokenService.findByProfileItem(context, item);
|
||||
if (orcidToken != null) {
|
||||
orcidToken.setProfileItem(null);
|
||||
}
|
||||
|
||||
//Only clear collections after we have removed everything else from the item
|
||||
item.clearCollections();
|
||||
item.setOwningCollection(null);
|
||||
|
Reference in New Issue
Block a user