We may want to keep some or all of this functionality of publish_update when we switch over to using dataone::uploadDataPackage. We should consider the following:
- consider having a function to easily create file names based on the title like
arcticdatauitls::reformat_file_name to make sure we have meaningful file names as noted in issue 248 in arctic-data
- edits the distribution, system and packageId for the user:
|
# Update the metadata |
|
|
|
# Replace packageId |
|
doc$packageId <- metadata_updated_pid |
|
|
|
# Add landing page |
|
if (use_doi == T){ |
|
doc$dataset$distribution$offline <- NULL |
|
doc$dataset$distribution$online$url <- paste0("http://doi.org/", metadata_updated_pid) |
|
} |
|
else if (use_doi == F & mn@identifier == "urn:node:ARCTIC"){ |
|
doc$dataset$distribution$offline <- NULL |
|
doc$dataset$distribution$online$url <- list(url = paste0("http://arcticdata.io/catalog/view/", metadata_updated_pid), |
|
`function` = "information") |
|
} |
|
else if (use_doi == F & mn@identifier == "urn:node:KNB"){ |
|
doc$dataset$distribution$offline <- NULL |
|
doc$dataset$distribution$online$url <- list(url = paste0("http://knb.ecoinformatics.org/view/", metadata_updated_pid), |
|
`function` = "information") |
|
} |
|
else if (use_doi == F & mn@identifier == "urn:node:mnTestARCTIC"){ |
|
doc$dataset$distribution$offline <- NULL |
|
doc$dataset$distribution$online$url <- list(url = paste0("http://test.arcticdata.io/view/", metadata_updated_pid), |
|
`function` = "information") |
|
} |
|
|
|
|
|
|
|
# Replace system |
|
doc$system <- get_system_uri(doc$packageId) |
- look into if the above can be generalized to the dataone package instead
We may want to keep some or all of this functionality of
publish_updatewhen we switch over to usingdataone::uploadDataPackage. We should consider the following:arcticdatauitls::reformat_file_nameto make sure we have meaningful file names as noted in issue 248 in arctic-dataarcticdatautils/R/editing.R
Lines 445 to 474 in eb633eb