Class ZenodoExporter
java.lang.Object
org.gcube.common.software.processor.SoftwareArtifactProcessor
org.gcube.common.software.processor.zenodo.ZenodoExporter
- Author:
- Luca Frosini (ISTI - CNR)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classClient Request Filter to automatically add headers to all requestsprotected static classWrapper class to hold both client and builder for proper resource managementstatic classClient Response Filter to automatically apply rate limiting after each response -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected com.fasterxml.jackson.databind.JsonNodestatic final Stringprotected URLprotected StringFields inherited from class org.gcube.common.software.processor.SoftwareArtifactProcessor
availableProcessors, exportFileNameExtension, first, globalConfig, last, outputDirectory, processorConfig, softwareArtifactMetadata -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddFilesToDeposition(List<File> files) protected voidvoidcreate()protected Stringprotected voiddeletePreviousFiles(com.fasterxml.jackson.databind.JsonNode jsonNode) Remove previous depositionFilesvoidexport()protected voidprotected Stringprotected jakarta.ws.rs.client.ClientgetJerseyClientWithAutoHeaders(String baseUrl) Creates a Jersey Client with automatic header injection and rate limitingprotected com.fasterxml.jackson.databind.node.ObjectNodeprotected voidprotected StringgetZenodoIDFromDOIURL(String doiURL) protected StringgetZenodoIDFromDOIURL(URL doiURL) protected ZenodoExporter.ClientAndBuilderAlternative method that returns both client and builder for manual resource managementvoidvoidupdate()protected voidprotected voidwriteObjectNodeToFile(com.fasterxml.jackson.databind.node.ObjectNode toBeExported, File file) Methods inherited from class org.gcube.common.software.processor.SoftwareArtifactProcessor
getAvailableProcessors, getGlobalConfig, getProcessorConfig, getSoftwareArtifactConfig, setFirst, setGlobalConfig, setLast, setOutputDirectory, setProcessorConfig, setSoftwareArtifactConfig
-
Field Details
-
EXPORT_FILENAME_EXTENSION
- See Also:
-
GUCBE_ZENODO_SOFTWARE_DEPOSIT
- See Also:
-
HTML_DESCRIPTION_CONFIG_FIELD_NAME
- See Also:
-
ADDITIONAL_HTML_DESCRIPTION_CONFIG_FIELD_NAME
- See Also:
-
SKIP_GRANTS_CONFIG_FIELD_NAME
- See Also:
-
METADATA_FIELD_NAME
- See Also:
-
COMMUNITIES_FIELD_NAME
- See Also:
-
DEPOSITIONS_COLLECTION_PATH
- See Also:
-
DEPOSITION_PATH
- See Also:
-
RECORD_PATH
- See Also:
-
DEPOSTION_FILES_PATH
- See Also:
-
DEPOSTION_NEW_VERSION_PATH
- See Also:
-
DEPOSTION_EDIT_PATH
- See Also:
-
DEPOSTION_PUBLISH_PATH
- See Also:
-
zenodoBaseURL
-
accessToken
-
zenodoID
-
response
protected com.fasterxml.jackson.databind.JsonNode response -
doiBaseURL
-
-
Constructor Details
-
ZenodoExporter
public ZenodoExporter()
-
-
Method Details
-
getZenodoIDFromDOIURL
-
getZenodoIDFromDOIURL
-
addFilesToDeposition
- Throws:
Exception
-
getJerseyClientWithAutoHeaders
Creates a Jersey Client with automatic header injection and rate limiting- Parameters:
baseUrl- the base URL for the API- Returns:
- configured Jersey Client instance with automatic headers and rate limiting
-
getZenodoRequestBuilderWithClient
Alternative method that returns both client and builder for manual resource management- Parameters:
path- the API endpoint path- Returns:
- ClientAndBuilder wrapper containing both client and builder
-
updateMetadata
- Throws:
Exception
-
commitVersion
- Throws:
Exception
-
finalizeProcessing
- Throws:
Exception
-
createZenodoDOIURLFromID
- Throws:
MalformedURLException
-
create
- Throws:
Exception
-
update
- Throws:
Exception
-
deletePreviousFiles
protected void deletePreviousFiles(com.fasterxml.jackson.databind.JsonNode jsonNode) throws Exception Remove previous depositionFiles- Throws:
Exception
-
newVersion
- Throws:
Exception
-
getConfig
- Throws:
Exception
-
getZenodoConnectionConfig
- Throws:
Exception
-
export
- Specified by:
exportin classSoftwareArtifactProcessor- Throws:
Exception
-
getObjectNode
- Throws:
Exception
-
writeObjectNodeToFile
protected void writeObjectNodeToFile(com.fasterxml.jackson.databind.node.ObjectNode toBeExported, File file) throws Exception - Throws:
Exception
-
getOutputFile
- Overrides:
getOutputFilein classSoftwareArtifactProcessor- Throws:
Exception
-