Package org.dspace.orcid.model.factory
Class OrcidFactoryUtils
java.lang.Object
org.dspace.orcid.model.factory.OrcidFactoryUtils
Utility class for Orcid factory classes. This is used to parse the
configuration of ORCID entities defined in orcid.cfg (for example see
contributors and external ids configuration).
- Author:
- Luca Giamminonni (luca.giamminonni at 4science.it)
-
Method Summary
Modifier and TypeMethodDescriptionparseConfigurations(String configurations) Parse the given configurations value and returns a map with metadata fields as keys and types/sources as values.retrieveAccessToken(String clientId, String clientSecret, String oauthUrl) Retrieve access token from ORCID, given a client ID, client secret and OAuth URL
-
Method Details
-
parseConfigurations
Parse the given configurations value and returns a map with metadata fields as keys and types/sources as values. The expected configuration syntax is a list of values field::type separated by commas.- Parameters:
configurations- the configurations to parse- Returns:
- the configurations parsing result as map
-
retrieveAccessToken
public static Optional<String> retrieveAccessToken(String clientId, String clientSecret, String oauthUrl) throws IOException Retrieve access token from ORCID, given a client ID, client secret and OAuth URL- Parameters:
clientId- ORCID client IDclientSecret- ORCID client secretoauthUrl- ORCID oauth redirect URL- Returns:
- response object as Optional string
- Throws:
IOException- if any errors are encountered making the connection or reading a response
-