Package org.mycore.pi.doi
Class MCRDOIBaseService
- Direct Known Subclasses:
MCRCrossrefService
,MCRDOIService
A doi Base Service which contains common DOI registration code.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mycore.pi.MCRPIJobService
MCRPIJobService.PiJobAction
-
Field Summary
Fields inherited from class org.mycore.pi.MCRPIJobService
CREATION_PREDICATE, JOB_API_USER_PROPERTY, REGISTRATION_PREDICATE
Fields inherited from class org.mycore.pi.MCRPIService
GENERATOR_CONFIG_PREFIX, GENERATOR_PROPERTY_KEY, METADATA_SERVICE_CONFIG_PREFIX, METADATA_SERVICE_PROPERTY_KEY, PI_FLAG, REGISTRATION_CONFIG_PREFIX, TRANSLATE_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
checkJobValid
(String mycoreID, MCRPIJobService.PiJobAction action) protected abstract String
getJobInformation
(Map<String, String> contextParameters) Result of this will be passed toMCRJobAction.name()
protected MCRContentTransformer
protected void
insertIdentifierToDatabase
(MCRBase obj, String additional, MCRDigitalObjectIdentifier identifier) protected Date
provideRegisterDate
(MCRBase obj, String additional) static Schema
resolveSchema
(String schemaURLString) void
setPassword
(String password) void
void
setTransformerID
(String transformerID) void
setUsername
(String username) protected void
startRegisterJob
(MCRBase obj, MCRDigitalObjectIdentifier newDOI) protected abstract Document
void
update
(MCRDigitalObjectIdentifier doi, MCRBase obj, String additional) Should handle updates of a Object with the PI.protected void
validateDocument
(String id, Document resultDocument) Methods inherited from class org.mycore.pi.MCRPIJobService
addDeleteJob, addRegisterJob, addUpdateJob, checkConfiguration, deleteJob, getAction, getRegistrationCondition, parseIdentifier, registerJob, rollbackDeleteJob, rollbackRegisterJob, rollbackUpdateJob, runAsJobUser, updateJob, updateRegistrationDate, updateStartRegistrationDate, validateJobUserRights
Methods inherited from class org.mycore.pi.MCRPIService
addFlagToObject, delete, getCreationPredicate, getGenerator, getGson, getMetadataService, getNewIdentifier, getPredicateInstance, getProperties, getRegistrationPredicate, getServiceID, getTableEntry, getType, hasFlag, hasFlag, hasRegistrationStarted, init, isCreated, isRegistered, onDelete, onUpdate, register, register, register, registerIdentifier, removeFlagFromObject, requireNotEmptyProperty, setProperties, updateFlag, updateFlagsInDatabase, validateAlreadyCreated, validatePermission, validateRegistration, validateRegistration
-
Field Details
-
CONTEXT_OBJ
- See Also:
-
CONTEXT_DOI
- See Also:
-
-
Constructor Details
-
MCRDOIBaseService
public MCRDOIBaseService()
-
-
Method Details
-
initCommonProperties
protected void initCommonProperties() -
resolveSchema
-
getDefaultSchemaPath
-
getJobInformation
Description copied from class:MCRPIJobService
Result of this will be passed toMCRJobAction.name()
- Specified by:
getJobInformation
in classMCRPIJobService<MCRDigitalObjectIdentifier>
- Parameters:
contextParameters
- the parameters of the job- Returns:
- Some Information what this job will do or just
Optional.empty()
, then a default message is generated.
-
checkJobValid
-
update
public void update(MCRDigitalObjectIdentifier doi, MCRBase obj, String additional) throws MCRPersistentIdentifierException Description copied from class:MCRPIService
Should handle updates of a Object with the PI. E.g. TheMCRDOIService
sends the updated metadata to the Datacite datacentre.- Specified by:
update
in classMCRPIService<MCRDigitalObjectIdentifier>
- Parameters:
doi
- the Identifierobj
- the deleted object- Throws:
MCRPersistentIdentifierException
- to abort update of the object or if something went wrong.
-
insertIdentifierToDatabase
public MCRPI insertIdentifierToDatabase(MCRBase obj, String additional, MCRDigitalObjectIdentifier identifier) - Overrides:
insertIdentifierToDatabase
in classMCRPIService<MCRDigitalObjectIdentifier>
-
startRegisterJob
-
getTransformer
-
validateDocument
protected void validateDocument(String id, Document resultDocument) throws MCRPersistentIdentifierException - Throws:
MCRPersistentIdentifierException
-
provideRegisterDate
- Overrides:
provideRegisterDate
in classMCRPIService<MCRDigitalObjectIdentifier>
-
transform
protected abstract Document transform(MCRBase obj, String pi) throws MCRPersistentIdentifierException - Throws:
MCRPersistentIdentifierException
-
getUsername
-
setUsername
-
getPassword
-
setPassword
-
getSchema
-
setSchema
-
getTransformerID
-
setTransformerID
-