Package org.dspace.identifier.service
Interface DOIService
-
- All Known Implementing Classes:
DOIServiceImpl
public interface DOIServiceService interface class for the DOI object. The implementation of this class is responsible for all business logic calls for the DOI object and is autowired by spring- Author:
- kevinvandevelde at atmire.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DOIcreate(Context context)StringDOIFromExternalFormat(String identifier)StringDOIToExternalForm(String identifier)This method helps to convert a DOI into a URL.DOIfindByDoi(Context context, String doi)DOIfindDOIByDSpaceObject(Context context, DSpaceObject dso)DOIfindDOIByDSpaceObject(Context context, DSpaceObject dso, List<Integer> statusToExclude)StringformatIdentifier(String identifier)Recognize format of DOI and return it with leading doi-Scheme.List<DOI>getDOIsByStatus(Context context, List<Integer> statuses)List<DOI>getSimilarDOIsNotInState(Context context, String doiPattern, List<Integer> statuses, boolean dsoIsNotNull)Find all DOIs that are similar to the specified pattern ant not in the specified states.voidupdate(Context context, DOI doi)
-
-
-
Method Detail
-
update
void update(Context context, DOI doi) throws SQLException
- Throws:
SQLException
-
create
DOI create(Context context) throws SQLException
- Throws:
SQLException
-
findByDoi
DOI findByDoi(Context context, String doi) throws SQLException
- Throws:
SQLException
-
findDOIByDSpaceObject
DOI findDOIByDSpaceObject(Context context, DSpaceObject dso) throws SQLException
- Throws:
SQLException
-
findDOIByDSpaceObject
DOI findDOIByDSpaceObject(Context context, DSpaceObject dso, List<Integer> statusToExclude) throws SQLException
- Throws:
SQLException
-
DOIToExternalForm
String DOIToExternalForm(String identifier) throws IdentifierException
This method helps to convert a DOI into a URL. It takes DOIs in one of the following formats and returns it as URL (f.e. http://dx.doi.org/10.123/456). Allowed formats are:- doi:10.123/456
- 10.123/456
- http://dx.doi.org/10.123/456
- Parameters:
identifier- A DOI that should be returned in external form.- Returns:
- A String containing a URL to the official DOI resolver.
- Throws:
IllegalArgumentException- If identifier is null or an empty String.IdentifierException- If identifier could not be recognized as valid DOI.
-
DOIFromExternalFormat
String DOIFromExternalFormat(String identifier) throws DOIIdentifierException
- Throws:
DOIIdentifierException
-
formatIdentifier
String formatIdentifier(String identifier) throws DOIIdentifierException
Recognize format of DOI and return it with leading doi-Scheme.- Parameters:
identifier- Identifier to format, following format are accepted: f.e. 10.123/456, doi:10.123/456, http://dx.doi.org/10.123/456.- Returns:
- Given Identifier with DOI-Scheme, f.e. doi:10.123/456.
- Throws:
IllegalArgumentException- If identifier is empty or null.DOIIdentifierException- If DOI could not be recognized.
-
getDOIsByStatus
List<DOI> getDOIsByStatus(Context context, List<Integer> statuses) throws SQLException
- Throws:
SQLException
-
getSimilarDOIsNotInState
List<DOI> getSimilarDOIsNotInState(Context context, String doiPattern, List<Integer> statuses, boolean dsoIsNotNull) throws SQLException
Find all DOIs that are similar to the specified pattern ant not in the specified states.- Parameters:
context- DSpace contextdoiPattern- The pattern, e.g. "10.5072/123.%"statuses- The statuses the DOI should not be in, @{link DOIIdentifierProvider.DELETED}.dsoIsNotNull- Boolean whether all DOIs should be excluded where the DSpaceObject is NULL.- Returns:
- null or a list of DOIs
- Throws:
SQLException- if database error
-
-