Package org.dspace.identifier
Class VersionedDOIIdentifierProvider
- java.lang.Object
-
- org.dspace.identifier.IdentifierProvider
-
- org.dspace.identifier.FilteredIdentifierProvider
-
- org.dspace.identifier.DOIIdentifierProvider
-
- org.dspace.identifier.VersionedDOIIdentifierProvider
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class VersionedDOIIdentifierProvider extends DOIIdentifierProvider implements org.springframework.beans.factory.InitializingBean
- Author:
- Marsa Haoua, Pascal-Nicolas Becker (dspace at pascal dash becker dot de)
-
-
Field Summary
Fields Modifier and Type Field Description protected DOIConnectorconnectorprotected static Stringpatternprotected VersionHistoryServiceversionHistoryServiceprotected VersioningServiceversioningService-
Fields inherited from class org.dspace.identifier.DOIIdentifierProvider
contentServiceFactory, DELETED, DOI_ELEMENT, DOI_QUALIFIER, doiService, IS_REGISTERED, IS_RESERVED, itemService, MD_SCHEMA, MINTED, PENDING, statusText, TO_BE_DELETED, TO_BE_REGISTERED, TO_BE_RESERVED, UPDATE_BEFORE_REGISTRATION, UPDATE_REGISTERED, UPDATE_RESERVED
-
Fields inherited from class org.dspace.identifier.FilteredIdentifierProvider
filter
-
Fields inherited from class org.dspace.identifier.IdentifierProvider
configurationService, parentService
-
-
Constructor Summary
Constructors Constructor Description VersionedDOIIdentifierProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()After all the properties are set check that the versioning is enabledprotected StringgetBareDOI(String identifier)protected StringgetDOIPostfix(String identifier)protected StringmakeIdentifierBasedOnHistory(Context context, DSpaceObject dso, VersionHistory history)protected StringmakeIdentifierBasedOnHistory(Context context, DSpaceObject dso, VersionHistory history, Filter filter)Stringmint(Context context, DSpaceObject dso)Mint a new DOI in DSpace - this is usually the first step of registration Always apply filters if they are configuredStringmint(Context context, DSpaceObject dso, Filter filter)Mint a new DOI in DSpace - this is usually the first step of registrationvoidregister(Context context, DSpaceObject dso, String identifier)Register a specified DOI for a given DSpaceObject, never skipping or ignoring any configured filtervoidregister(Context context, DSpaceObject dso, String identifier, Filter filter)Register a specified DOI for a given DSpaceObjectStringregister(Context context, DSpaceObject dso, Filter filter)Register a new DOI for a given DSpaceObjectvoidsetConfigurationService(ConfigurationService configurationService)voidsetDOIConnector(DOIConnector connector)Set the DOI connector, which is the component that commuincates with the remote registration service (eg.-
Methods inherited from class org.dspace.identifier.DOIIdentifierProvider
checkMintable, checkMintable, delete, delete, deleteOnline, getDOIByObject, getDOIOutOfObject, getNamespaceSeparator, getObjectByDOI, getPrefix, loadOrCreateDOI, loadOrCreateDOI, lookup, register, registerOnline, registerOnline, removeDOIFromObject, reserve, reserve, reserveOnline, reserveOnline, resolve, saveDOIToObject, supports, supports, updateMetadata, updateMetadataOnline
-
Methods inherited from class org.dspace.identifier.FilteredIdentifierProvider
setFilter
-
Methods inherited from class org.dspace.identifier.IdentifierProvider
setParentService
-
-
-
-
Field Detail
-
connector
protected DOIConnector connector
-
pattern
protected static final String pattern
-
versioningService
@Autowired(required=true) protected VersioningService versioningService
-
versionHistoryService
@Autowired(required=true) protected VersionHistoryService versionHistoryService
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws ExceptionAfter all the properties are set check that the versioning is enabled- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception- throws an exception if this isn't the case
-
mint
public String mint(Context context, DSpaceObject dso) throws IdentifierException
Description copied from class:DOIIdentifierProviderMint a new DOI in DSpace - this is usually the first step of registration Always apply filters if they are configured- Overrides:
mintin classDOIIdentifierProvider- Parameters:
context- - DSpace contextdso- - DSpaceObject identified by the new identifier- Returns:
- a String containing the new identifier
- Throws:
IdentifierException- if identifier error
-
mint
public String mint(Context context, DSpaceObject dso, Filter filter) throws IdentifierException
Description copied from class:DOIIdentifierProviderMint a new DOI in DSpace - this is usually the first step of registration- Overrides:
mintin classDOIIdentifierProvider- Parameters:
context- - DSpace contextdso- - DSpaceObject identified by the new identifierfilter- - Logical item filter to determine whether this identifier should be registered- Returns:
- a String containing the new identifier
- Throws:
IdentifierException
-
register
public void register(Context context, DSpaceObject dso, String identifier) throws IdentifierException
Description copied from class:DOIIdentifierProviderRegister a specified DOI for a given DSpaceObject, never skipping or ignoring any configured filter- Overrides:
registerin classDOIIdentifierProvider- Parameters:
context- - DSpace contextdso- - DSpaceObject identified by the new DOIidentifier- - String containing the identifier to register- Throws:
IdentifierException- if identifier error
-
register
public String register(Context context, DSpaceObject dso, Filter filter) throws IdentifierException
Description copied from class:DOIIdentifierProviderRegister a new DOI for a given DSpaceObject- Overrides:
registerin classDOIIdentifierProvider- Parameters:
context- - DSpace contextdso- - DSpaceObject identified by the new DOIfilter- - Logical item filter to determine whether this identifier should be registered- Returns:
- identifier
- Throws:
IdentifierException
-
register
public void register(Context context, DSpaceObject dso, String identifier, Filter filter) throws IdentifierException
Description copied from class:DOIIdentifierProviderRegister a specified DOI for a given DSpaceObject- Overrides:
registerin classDOIIdentifierProvider- Parameters:
context- - DSpace contextdso- - DSpaceObject identified by the new DOIidentifier- - String containing the DOI to registerfilter- - Logical item filter to determine whether this identifier should be registered- Throws:
IdentifierException
-
getBareDOI
protected String getBareDOI(String identifier) throws DOIIdentifierException
- Throws:
DOIIdentifierException
-
getDOIPostfix
protected String getDOIPostfix(String identifier) throws DOIIdentifierException
- Throws:
DOIIdentifierException
-
makeIdentifierBasedOnHistory
protected String makeIdentifierBasedOnHistory(Context context, DSpaceObject dso, VersionHistory history) throws AuthorizeException, SQLException, DOIIdentifierException, IdentifierNotApplicableException
-
makeIdentifierBasedOnHistory
protected String makeIdentifierBasedOnHistory(Context context, DSpaceObject dso, VersionHistory history, Filter filter) throws AuthorizeException, SQLException, DOIIdentifierException, IdentifierNotApplicableException
-
setDOIConnector
@Autowired(required=true) public void setDOIConnector(DOIConnector connector)
Description copied from class:DOIIdentifierProviderSet the DOI connector, which is the component that commuincates with the remote registration service (eg. DataCite, EZID, Crossref) Spring will use this setter to set the DOI connector from the configured property in identifier-services.xml- Overrides:
setDOIConnectorin classDOIIdentifierProvider- Parameters:
connector- a DOIConnector
-
setConfigurationService
@Autowired(required=true) public void setConfigurationService(ConfigurationService configurationService)
- Overrides:
setConfigurationServicein classIdentifierProvider
-
-