Skip to content

Commit

Permalink
#390 manage DOI & HTTP relations as resources
Browse files Browse the repository at this point in the history
eblondel committed Jun 11, 2024

Verified

This commit was signed with the committer’s verified signature.
adityasingh-anyline Aditya Singh
1 parent 9b08855 commit ae7ccda
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions inst/actions/metadataeditr_create_project.R
Original file line number Diff line number Diff line change
@@ -350,6 +350,33 @@ function(action, entity, config){
}
}

#DOI resource
if(!is.null(entity$identifiers[["doi"]])){
metadataeditr::resources_add(
idno = entity$identifiers[["id"]],
dctype = "web",
title = "DOI",
description = "Digital Object Identifier",
file_path = paste0("http://dx.doi.org/", entity$identifiers[["doi"]])
)
}

#entity HTTP(S) resources
if(length(entity$relations)>0){
http_relations <- entity$relations[sapply(entity$relations, function(x){
x$key %in% c("ftp","http", "download") | any(startsWith(x$key, c("wfs", "wms", "wcs", "csw")))
})]
for(http_relation in http_relations){
metadataeditr::resources_add(
idno = entity$identifiers[["id"]],
dctype = "web",
title = http_relation$name,
description = http_relation$description,
file_path = http_relation$link
)
}
}

#files
if(depositWithFiles){
#data

0 comments on commit ae7ccda

Please sign in to comment.