public class DataCiteConnector extends Object implements DOIConnector
| Modifier and Type | Class and Description |
|---|---|
protected class |
DataCiteConnector.DataCiteResponse |
| Modifier and Type | Field and Description |
|---|---|
protected ConfigurationService |
configurationService |
protected String |
CROSSWALK_NAME
Name of crosswalk to convert metadata into DataCite Metadata Scheme.
|
protected String |
DOI_PATH
Path on the DataCite server used to generate DOIs.
|
protected String |
HOST
Stores the hostname of the DataCite server.
|
protected String |
METADATA_PATH
Path on the DataCite server used to register metadata.
|
protected String |
PASSWORD |
protected String |
SCHEME
Stores the scheme used to connect to the DataCite server.
|
protected String |
USERNAME |
protected DisseminationCrosswalk |
xwalk
DisseminationCrosswalk to map local metadata into DataCite metadata.
|
| Constructor and Description |
|---|
DataCiteConnector() |
| Modifier and Type | Method and Description |
|---|---|
protected org.jdom.Element |
addDOI(String doi,
org.jdom.Element root) |
void |
deleteDOI(Context context,
String doi)
Sends the DELETE-Request to the DOI registry.
|
protected String |
extractAlternateIdentifier(Context context,
String content) |
protected String |
extractDOI(org.jdom.Element root) |
protected String |
getPassword() |
protected String |
getUsername() |
boolean |
isDOIRegistered(Context context,
DSpaceObject dso,
String doi) |
boolean |
isDOIRegistered(Context context,
String doi) |
boolean |
isDOIReserved(Context context,
DSpaceObject dso,
String doi) |
boolean |
isDOIReserved(Context context,
String doi) |
protected void |
prepareXwalk() |
void |
registerDOI(Context context,
DSpaceObject dso,
String doi)
Sends a request to the DOI registry to register a DOI.
|
void |
reserveDOI(Context context,
DSpaceObject dso,
String doi)
Sends a request to the DOI registry to reserve a DOI.
|
protected DataCiteConnector.DataCiteResponse |
sendDOIGetRequest(String doi) |
protected DataCiteConnector.DataCiteResponse |
sendDOIPostRequest(String doi,
String url) |
protected DataCiteConnector.DataCiteResponse |
sendGetRequest(String doi,
String path) |
protected DataCiteConnector.DataCiteResponse |
sendHttpRequest(org.apache.http.client.methods.HttpUriRequest req,
String doi) |
protected DataCiteConnector.DataCiteResponse |
sendMetadataDeleteRequest(String doi) |
protected DataCiteConnector.DataCiteResponse |
sendMetadataGetRequest(String doi) |
protected DataCiteConnector.DataCiteResponse |
sendMetadataPostRequest(String doi,
org.jdom.Element metadataRoot) |
protected DataCiteConnector.DataCiteResponse |
sendMetadataPostRequest(String doi,
String metadata) |
void |
setConfigurationService(ConfigurationService configurationService) |
void |
setDATACITE_DOI_PATH(String DATACITE_DOI_PATH)
Set the path on the DataCite server to register DOIs.
|
void |
setDATACITE_HOST(String DATACITE_HOST)
Set the hostname of the DataCite server.
|
void |
setDATACITE_METADATA_PATH(String DATACITE_METADATA_PATH)
Set the path to register metadata on DataCite server.
|
void |
setDATACITE_SCHEME(String DATACITE_SCHEME)
Used to set the scheme to connect the DataCite server.
|
void |
setDisseminationCrosswalkName(String CROSSWALK_NAME)
Set the name of the dissemination crosswalk used to convert the metadata
into DataCite Metadata Schema.
|
void |
updateMetadata(Context context,
DSpaceObject dso,
String doi)
Sends a request to the DOI registry to update metadata for a DOI.
|
protected String SCHEME
protected String HOST
protected String DOI_PATH
protected String METADATA_PATH
protected String CROSSWALK_NAME
protected DisseminationCrosswalk xwalk
setDisseminationCrosswalk which
instantiates the crosswalk.protected ConfigurationService configurationService
protected String USERNAME
protected String PASSWORD
public void setDATACITE_SCHEME(String DATACITE_SCHEME)
DATACITE_SCHEME - Probably https or http.public void setDATACITE_HOST(String DATACITE_HOST)
DATACITE_HOST - Hostname to connect to register DOIs (f.e. test.datacite.org).public void setDATACITE_DOI_PATH(String DATACITE_DOI_PATH)
DATACITE_DOI_PATH - Path to register DOIs, f.e. /doi.public void setDATACITE_METADATA_PATH(String DATACITE_METADATA_PATH)
DATACITE_METADATA_PATH - Path to register metadata, f.e. /mds.@Autowired public void setConfigurationService(ConfigurationService configurationService)
public void setDisseminationCrosswalkName(String CROSSWALK_NAME)
CROSSWALK_NAME - The name of the dissemination crosswalk to use. This
crosswalk must be configured in dspace.cfg.protected void prepareXwalk()
protected String getUsername()
protected String getPassword()
public boolean isDOIReserved(Context context, String doi) throws DOIIdentifierException
isDOIReserved in interface DOIConnectorDOIIdentifierExceptionpublic boolean isDOIReserved(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
isDOIReserved in interface DOIConnectorDOIIdentifierExceptionpublic boolean isDOIRegistered(Context context, String doi) throws DOIIdentifierException
isDOIRegistered in interface DOIConnectorDOIIdentifierExceptionpublic boolean isDOIRegistered(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
isDOIRegistered in interface DOIConnectorDOIIdentifierExceptionpublic void deleteDOI(Context context, String doi) throws DOIIdentifierException
DOIConnectorThis method sends a request to "delete" a DOI. As DOIs are persistent identifiers they should never be deleted. For example, if you send a HTTP DELETE request to the DataCite Metadata API directly, it will set the DOI to inactive.
deleteDOI in interface DOIConnectorDOIIdentifierExceptionpublic void reserveDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
DOIConnectorDOIIdentifierException and set the error code to DOIIdentifierException.DOI_ALREADY_EXISTS.reserveDOI in interface DOIConnectorDOIIdentifierExceptionpublic void registerDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
DOIConnectorDOIIdentifierException.RESERVE_FIRST.registerDOI in interface DOIConnectorDOIIdentifierExceptionpublic void updateMetadata(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
DOIConnectorupdateMetadata in interface DOIConnectorDOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendDOIPostRequest(String doi, String url) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendMetadataDeleteRequest(String doi) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendDOIGetRequest(String doi) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendMetadataGetRequest(String doi) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendGetRequest(String doi, String path) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendMetadataPostRequest(String doi, org.jdom.Element metadataRoot) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendMetadataPostRequest(String doi, String metadata) throws DOIIdentifierException
DOIIdentifierExceptionprotected DataCiteConnector.DataCiteResponse sendHttpRequest(org.apache.http.client.methods.HttpUriRequest req, String doi) throws DOIIdentifierException
req - doi - DOIIdentifierExceptionprotected String extractAlternateIdentifier(Context context, String content) throws SQLException, DOIIdentifierException
SQLExceptionDOIIdentifierExceptionprotected String extractDOI(org.jdom.Element root)
protected org.jdom.Element addDOI(String doi, org.jdom.Element root)
Copyright © 2014 DuraSpace. All Rights Reserved.