public class EZIDIdentifierProvider extends IdentifierProvider
Configuration of this class is is in two parts.
Installation-specific configuration (credentials and the "shoulder" value which forms a prefix of the site's DOIs) is supplied from property files in [DSpace]/config**.
Then there are properties injected using Spring:
| Modifier and Type | Field and Description |
|---|---|
protected ContentServiceFactory |
contentServiceFactory |
protected String |
DATACITE_XML_CROSSWALK |
static String |
DOI_ELEMENT |
static String |
DOI_QUALIFIER |
protected boolean |
GENERATE_DATACITE_XML |
protected ItemService |
itemService |
static String |
MD_SCHEMA |
configurationService, parentService| Constructor and Description |
|---|
EZIDIdentifierProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Context context,
DSpaceObject dso)
Unbind this type of identifier(s) from an object.
|
void |
delete(Context context,
DSpaceObject dso,
String identifier)
Unbind the given identifier from an object.
|
Map<String,String> |
getCrosswalk() |
EZIDRequestFactory |
getRequestFactory() |
String |
lookup(Context context,
DSpaceObject object)
Return the identifier for a DSpaceObject.
|
String |
mint(Context context,
DSpaceObject dso)
Create an identifier for a DSpaceObject.
|
String |
register(Context context,
DSpaceObject dso)
Create and apply an identifier to a DSpaceObject.
|
void |
register(Context context,
DSpaceObject object,
String identifier)
Create a specific identifier and apply it to an object.
|
void |
reserve(Context context,
DSpaceObject dso,
String identifier)
Set an object's identifier.
|
DSpaceObject |
resolve(Context context,
String identifier,
String... attributes)
Find the object named by a given identifier.
|
void |
setCrosswalk(Map<String,String> aCrosswalk)
Provide a map from DSO metadata keys to EZID keys.
|
void |
setCrosswalkTransform(Map<String,Transform> transformMap)
Provide a map from DSO metadata keys to classes which can transform their
values to something acceptable to EZID.
|
void |
setDisseminationCrosswalkName(String DATACITE_XML_CROSSWALK) |
void |
setGenerateDataciteXML(boolean GENERATE_DATACITE_XML) |
protected void |
setItemService(ItemService itemService)
Method should never be used aside from the unit tests where we can cannot autowire this class.
|
void |
setRequestFactory(EZIDRequestFactory aRequestFactory) |
boolean |
supports(Class<? extends Identifier> identifier)
Can this provider provide identifiers of a given type?
|
boolean |
supports(String identifier)
Can this provider provide identifiers of a given type?
|
setConfigurationService, setParentServicepublic static final String MD_SCHEMA
public static final String DOI_ELEMENT
public static final String DOI_QUALIFIER
protected boolean GENERATE_DATACITE_XML
protected String DATACITE_XML_CROSSWALK
@Autowired(required=true) protected ContentServiceFactory contentServiceFactory
@Autowired(required=true) protected ItemService itemService
public boolean supports(Class<? extends Identifier> identifier)
IdentifierProvidersupports in class IdentifierProvideridentifier - requested type.public boolean supports(String identifier)
IdentifierProvidersupports in class IdentifierProvideridentifier - requested type.public String register(Context context, DSpaceObject dso) throws IdentifierException
IdentifierProviderorg.dspace.content.DSpaceObject#resetIdentifiersCache() after its registration. If you register
identifiers directly in this method the IdentifierService will call this method for you.register in class IdentifierProviderdso - object to be named.item if it has one, else a new identifier.IdentifierException - if identifier errorpublic void register(Context context, DSpaceObject object, String identifier)
IdentifierProviderregister in class IdentifierProviderobject - to be identified.identifier - to be created.public void reserve(Context context, DSpaceObject dso, String identifier) throws IdentifierException
IdentifierProviderreserve in class IdentifierProviderdso - object to be identified.identifier - to be set on the object.IdentifierException - if identifier errorpublic String mint(Context context, DSpaceObject dso) throws IdentifierException
IdentifierProvidermint in class IdentifierProviderdso - object to be named.dso if it has one, else a new identifier.IdentifierException - if identifier errorpublic DSpaceObject resolve(Context context, String identifier, String... attributes) throws IdentifierNotFoundException, IdentifierNotResolvableException
IdentifierProviderresolve in class IdentifierProvideridentifier - to be resolved.attributes - additional information for resolving identifier.IdentifierNotFoundException - if identifier not foundIdentifierNotResolvableException - if identifier not resolvablepublic String lookup(Context context, DSpaceObject object) throws IdentifierNotFoundException, IdentifierNotResolvableException
IdentifierProviderlookup in class IdentifierProviderobject - The object to be looked up.object.IdentifierNotFoundException - if identifier not foundIdentifierNotResolvableException - if identifier not resolvablepublic void delete(Context context, DSpaceObject dso) throws IdentifierException
IdentifierProviderdelete in class IdentifierProviderdso - object to lose its identity.IdentifierException - if identifier errorpublic void delete(Context context, DSpaceObject dso, String identifier) throws IdentifierException
IdentifierProviderdelete in class IdentifierProviderdso - object to be de-identified.identifier - to be removed.IdentifierException - if identifier errorpublic void setCrosswalk(Map<String,String> aCrosswalk)
aCrosswalk - public void setCrosswalkTransform(Map<String,Transform> transformMap)
transformMap - public void setGenerateDataciteXML(boolean GENERATE_DATACITE_XML)
public void setDisseminationCrosswalkName(String DATACITE_XML_CROSSWALK)
public void setRequestFactory(EZIDRequestFactory aRequestFactory)
public EZIDRequestFactory getRequestFactory()
protected void setItemService(ItemService itemService)
itemService - Copyright © 2017 DuraSpace. All rights reserved.