mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 05:23:14 +00:00
[CST-5308] Migrate OrcidAuthenticationBean
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
*/
|
||||
package org.dspace.eperson;
|
||||
|
||||
import static org.dspace.content.Item.ANY;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
@@ -30,6 +32,7 @@ import org.dspace.authorize.service.ResourcePolicyService;
|
||||
import org.dspace.content.DSpaceObjectServiceImpl;
|
||||
import org.dspace.content.Item;
|
||||
import org.dspace.content.MetadataField;
|
||||
import org.dspace.content.MetadataValue;
|
||||
import org.dspace.content.WorkspaceItem;
|
||||
import org.dspace.content.factory.ContentServiceFactory;
|
||||
import org.dspace.content.service.ItemService;
|
||||
@@ -43,6 +46,7 @@ import org.dspace.eperson.service.EPersonService;
|
||||
import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.eperson.service.SubscribeService;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.util.UUIDUtils;
|
||||
import org.dspace.versioning.Version;
|
||||
import org.dspace.versioning.VersionHistory;
|
||||
import org.dspace.versioning.dao.VersionDAO;
|
||||
@@ -569,4 +573,13 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
||||
public int countTotal(Context context) throws SQLException {
|
||||
return ePersonDAO.countRows(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EPerson findByProfileItem(Context context, Item profile) throws SQLException {
|
||||
List<MetadataValue> crisOwners = itemService.getMetadata(profile, "dspace", "object", "owner", ANY);
|
||||
if (CollectionUtils.isEmpty(crisOwners)) {
|
||||
return null;
|
||||
}
|
||||
return find(context, UUIDUtils.fromString(crisOwners.get(0).getAuthority()));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user