Package org.dspace.identifier
Class EZIDIdentifierProvider
java.lang.Object
org.dspace.identifier.IdentifierProvider
org.dspace.identifier.EZIDIdentifierProvider
Provide service for DOIs through DataCite using the EZID service.
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**.
- identifier.doi.ezid.shoulder
- base of the site's DOIs. Example: 10.5072/FK2
- identifier.doi.ezid.user
- EZID username.
- identifier.doi.ezid.password
- EZID password.
- identifier.doi.ezid.publisher
- A default publisher, for Items not previously published. EZID requires a publisher.
Then there are properties injected using Spring:
- There is a Map (with the property name "crosswalk") from EZID metadata field names into DSpace field names, injected by Spring. Specify the fully-qualified names of all metadata fields to be looked up on a DSpace object and their values set on mapped fully-qualified names in the object's DataCite metadata.
- A second map ("crosswalkTransform") provides Transform instances mapped from EZID metadata field names. This allows the crosswalk to rewrite field values where the form maintained by DSpace is not directly usable in EZID metadata.
- Optional: A boolean property ("generateDataciteXML") that controls the creation and inclusion of DataCite xml schema during the metadata crosswalking. The default "DataCite" dissemination plugin uses DIM2DataCite.xsl for crosswalking. Default value: false.
- Optional: A string property ("disseminationCrosswalkName") that can be used to set the name of the dissemination crosswalk plugin for metadata crosswalking. Default value: "DataCite".
- Author:
- mwood
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentServiceFactoryprotected Stringstatic final Stringstatic final Stringprotected booleanprotected ItemServicestatic final StringFields inherited from class org.dspace.identifier.IdentifierProvider
configurationService, parentService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete(Context context, DSpaceObject dso) Unbind this type of identifier(s) from an object.voiddelete(Context context, DSpaceObject dso, String identifier) Unbind the given identifier from an object.lookup(Context context, DSpaceObject object) Return the identifier for a DSpaceObject.mint(Context context, DSpaceObject dso) Create an identifier for a DSpaceObject.register(Context context, DSpaceObject dso) Create and apply an identifier to a DSpaceObject.voidregister(Context context, DSpaceObject object, String identifier) Create a specific identifier and apply it to an object.voidreserve(Context context, DSpaceObject dso, String identifier) Set an object's identifier.Find the object named by a given identifier.voidsetCrosswalk(Map<String, String> aCrosswalk) Provide a map from DSO metadata keys to EZID keys.voidsetCrosswalkTransform(Map<String, Transform> transformMap) Provide a map from DSO metadata keys to classes which can transform their values to something acceptable to EZID.voidsetDisseminationCrosswalkName(String DATACITE_XML_CROSSWALK) voidsetGenerateDataciteXML(boolean GENERATE_DATACITE_XML) protected voidsetItemService(ItemService itemService) Method should never be used aside from the unit tests where we can cannot autowire this class.voidsetRequestFactory(EZIDRequestFactory aRequestFactory) booleansupports(Class<? extends Identifier> identifier) Can this provider provide identifiers of a given type?booleanCan this provider provide identifiers of a given type?Methods inherited from class org.dspace.identifier.IdentifierProvider
setConfigurationService, setParentService
-
Field Details
-
MD_SCHEMA
- See Also:
-
DOI_ELEMENT
- See Also:
-
DOI_QUALIFIER
-
GENERATE_DATACITE_XML
protected boolean GENERATE_DATACITE_XML -
DATACITE_XML_CROSSWALK
-
contentServiceFactory
-
itemService
-
-
Constructor Details
-
EZIDIdentifierProvider
public EZIDIdentifierProvider()
-
-
Method Details
-
supports
Description copied from class:IdentifierProviderCan this provider provide identifiers of a given type?- Specified by:
supportsin classIdentifierProvider- Parameters:
identifier- requested type.- Returns:
- true if the given type is assignable from this provider's type.
-
supports
Description copied from class:IdentifierProviderCan this provider provide identifiers of a given type?- Specified by:
supportsin classIdentifierProvider- Parameters:
identifier- requested type.- Returns:
- true if this provider can provide the named type of identifier.
-
register
Description copied from class:IdentifierProviderCreate and apply an identifier to a DSpaceObject.- Specified by:
registerin classIdentifierProvider- Parameters:
context- The relevant DSpace Context.dso- object to be named.- Returns:
- existing identifier of
itemif it has one, else a new identifier. - Throws:
IdentifierException- if identifier error
-
register
Description copied from class:IdentifierProviderCreate a specific identifier and apply it to an object.- Specified by:
registerin classIdentifierProvider- Parameters:
context- The relevant DSpace Context.object- to be identified.identifier- to be created.
-
reserve
public void reserve(Context context, DSpaceObject dso, String identifier) throws IdentifierException Description copied from class:IdentifierProviderSet an object's identifier.- Specified by:
reservein classIdentifierProvider- Parameters:
context- The relevant DSpace Context.dso- object to be identified.identifier- to be set on the object.- Throws:
IdentifierException- if identifier error
-
mint
Description copied from class:IdentifierProviderCreate an identifier for a DSpaceObject.- Specified by:
mintin classIdentifierProvider- Parameters:
context- The relevant DSpace Context.dso- object to be named.- Returns:
- existing identifier of
dsoif it has one, else a new identifier. - Throws:
IdentifierException- if identifier error
-
resolve
public DSpaceObject resolve(Context context, String identifier, String... attributes) throws IdentifierNotFoundException, IdentifierNotResolvableException Description copied from class:IdentifierProviderFind the object named by a given identifier.- Specified by:
resolvein classIdentifierProvider- Parameters:
context- The relevant DSpace Context.identifier- to be resolved.attributes- additional information for resolvingidentifier.- Returns:
- the named object.
- Throws:
IdentifierNotFoundException- if identifier not foundIdentifierNotResolvableException- if identifier not resolvable
-
lookup
public String lookup(Context context, DSpaceObject object) throws IdentifierNotFoundException, IdentifierNotResolvableException Description copied from class:IdentifierProviderReturn the identifier for a DSpaceObject.- Specified by:
lookupin classIdentifierProvider- Parameters:
context- The relevant DSpace Context.object- The object to be looked up.- Returns:
- identifier for
object. - Throws:
IdentifierNotFoundException- if identifier not foundIdentifierNotResolvableException- if identifier not resolvable
-
delete
Description copied from class:IdentifierProviderUnbind this type of identifier(s) from an object.- Specified by:
deletein classIdentifierProvider- Parameters:
context- The relevant DSpace Context.dso- object to lose its identity.- Throws:
IdentifierException- if identifier error
-
delete
Description copied from class:IdentifierProviderUnbind the given identifier from an object.- Specified by:
deletein classIdentifierProvider- Parameters:
context- The relevant DSpace Context.dso- object to be de-identified.identifier- to be removed.- Throws:
IdentifierException- if identifier error
-
setCrosswalk
Provide a map from DSO metadata keys to EZID keys. This will drive the generation of EZID metadata for the minting of new identifiers.- Parameters:
aCrosswalk- map of metadata fields to EZID keys
-
getCrosswalk
-
setCrosswalkTransform
Provide a map from DSO metadata keys to classes which can transform their values to something acceptable to EZID.- Parameters:
transformMap- map of metadata fields to EZID transformation classes
-
setGenerateDataciteXML
public void setGenerateDataciteXML(boolean GENERATE_DATACITE_XML) -
setDisseminationCrosswalkName
-
setRequestFactory
-
getRequestFactory
-
setItemService
Method should never be used aside from the unit tests where we can cannot autowire this class.- Parameters:
itemService- itemService instance
-