Package org.dspace.orcid.service
Interface OrcidSynchronizationService
- All Known Implementing Classes:
OrcidSynchronizationServiceImpl
public interface OrcidSynchronizationService
Service that handle the the synchronization between a DSpace profile and the
relative ORCID profile, if any.
- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
Method Summary
Modifier and TypeMethodDescriptionfindProfilesByOrcid(Context context, String orcid) Returns all the profiles with the given orcid id.Returns the configuration ORCID profile's disconnection mode.getEntityPreference(Item profile, OrcidEntityType entityType) Returns the ORCID synchronization preference related to the given entity type configured for the given profile item.getProfilePreferences(Item profile) Returns the ORCID synchronization preferences related to the profile itself configured for the given profile item.getSynchronizationMode(Item profile) Returns the ORCID synchronization mode configured for the given profile item.booleanisLinkedToOrcid(Context context, Item item) Check if the given item is linked to an ORCID profile.booleanisSynchronizationAllowed(Item profile, Item item) Check if the given researcher profile item is configured to synchronize the given item with ORCID.voidlinkProfile(Context context, Item profile, OrcidTokenResponseDTO token) Configure the given profile with the data present in the given ORCID token.booleansetEntityPreference(Context context, Item profile, OrcidEntityType entityType, OrcidEntitySyncPreference value) Set the synchronization preference for the given profile related to the given ORCID entity type.booleansetProfilePreference(Context context, Item profile, List<OrcidProfileSyncPreference> values) Update the profile's synchronization preference for the given profile.booleansetSynchronizationMode(Context context, Item profile, OrcidSynchronizationMode value) Set the ORCID synchronization mode for the given profile.voidunlinkProfile(Context context, Item profile) Disconnect the given profile from ORCID.
-
Method Details
-
isLinkedToOrcid
Check if the given item is linked to an ORCID profile.- Parameters:
context- the relevant DSpace Context.item- the item to check- Returns:
- true if the given item is linked to ORCID
-
linkProfile
Configure the given profile with the data present in the given ORCID token. This action is required to synchronize profile and related entities with ORCID. No security check is done, it is therefore the caller's responsibility to verify for example that the current user has permission to connect the profile to ORCID (if necessary).- Parameters:
context- the relevant DSpace Context.profile- the profile to configuretoken- the ORCID token- Throws:
SQLException- if a SQL error occurs during the profile update
-
unlinkProfile
Disconnect the given profile from ORCID.- Parameters:
context- the relevant DSpace Context.profile- the profile to disconnect- Throws:
SQLException- if a SQL error occurs during the profile update
-
setEntityPreference
boolean setEntityPreference(Context context, Item profile, OrcidEntityType entityType, OrcidEntitySyncPreference value) throws SQLException Set the synchronization preference for the given profile related to the given ORCID entity type.- Parameters:
context- the relevant DSpace Context.profile- the researcher profile to updateentityType- the orcid entity typevalue- the new synchronization preference value- Returns:
- true if the value has actually been updated, false if the value to be set is the same as the one already configured
- Throws:
SQLException- if a SQL error occurs during the profile updateIllegalArgumentException- if the given researcher profile is no linked with an ORCID account
-
setProfilePreference
boolean setProfilePreference(Context context, Item profile, List<OrcidProfileSyncPreference> values) throws SQLException Update the profile's synchronization preference for the given profile.- Parameters:
context- the relevant DSpace Context.profile- the researcher profile to updatevalues- the new synchronization preference values- Returns:
- true if the value has actually been updated, false if the value to be set is the same as the one already configured
- Throws:
SQLException- if a SQL error occurs during the profile updateIllegalArgumentException- if the given researcher profile is no linked with an ORCID account
-
setSynchronizationMode
boolean setSynchronizationMode(Context context, Item profile, OrcidSynchronizationMode value) throws SQLException Set the ORCID synchronization mode for the given profile.- Parameters:
context- the relevant DSpace Context.profile- the researcher profile to updatevalue- the new synchronization mode value- Returns:
- true if the value has actually been updated, false if the value to be set is the same as the one already configured
- Throws:
SQLException- if a SQL error occurs during the profile update
-
isSynchronizationAllowed
Check if the given researcher profile item is configured to synchronize the given item with ORCID.- Parameters:
profile- the researcher profile itemitem- the entity type to check- Returns:
- true if the given entity type can be synchronize with ORCID, false otherwise
-
getSynchronizationMode
Returns the ORCID synchronization mode configured for the given profile item.- Parameters:
profile- the researcher profile item- Returns:
- the synchronization mode
-
getEntityPreference
Returns the ORCID synchronization preference related to the given entity type configured for the given profile item.- Parameters:
profile- the researcher profile itementityType- the orcid entity type- Returns:
- the configured preference
-
getProfilePreferences
Returns the ORCID synchronization preferences related to the profile itself configured for the given profile item.- Parameters:
profile- the researcher profile item- Returns:
- the synchronization mode
-
getDisconnectionMode
OrcidProfileDisconnectionMode getDisconnectionMode()Returns the configuration ORCID profile's disconnection mode. If that mode is not configured or the configuration is wrong, the value DISABLED is returned.- Returns:
- the disconnection mode
-
findProfilesByOrcid
Returns all the profiles with the given orcid id.- Parameters:
context- the relevant DSpace Context.orcid- the orcid id to search for- Returns:
- the found profile items
-