Skip to content

Commit 357d0f4

Browse files
committed
Change add_other_entities to set_other_entities
I think this makes the intent more clear.
1 parent 545f8e7 commit 357d0f4

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ export(add_access_rules)
44
export(add_additional_identifiers)
55
export(add_admin_group_access)
66
export(add_methods_step)
7-
export(add_other_entities)
87
export(add_string_to_title)
98
export(change_eml_name)
109
export(clear_methods)
@@ -76,6 +75,7 @@ export(replace_package_id)
7675
export(replace_subject)
7776
export(set_access)
7877
export(set_file_name)
78+
export(set_other_entities)
7979
export(set_public_read)
8080
export(set_rights_and_access)
8181
export(set_rights_holder)

R/editing.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,13 @@ publish_update <- function(mn,
322322
}
323323

324324
# Write out the document to disk. We do this in part because
325-
# add_other_entities takes a path to the doc.
325+
# set_other_entities takes a path to the doc.
326326
eml_path <- tempfile()
327327
EML::write_eml(eml, eml_path)
328328

329329
# Add other entity fields (if appropriate)
330330
if (!is.null(data_pids) && !skip_other_entities) {
331-
eml <- add_other_entities(mn, eml_path, data_pids)
331+
eml <- set_other_entities(mn, eml_path, data_pids)
332332
}
333333

334334
if (skip_other_entities) {

R/eml.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ sysmeta_to_entity <- function(sysmeta) {
9494
}
9595

9696

97-
#' Creates and adds EML otherEntity elements to an existing EML document.
97+
#' Creates and sets EML otherEntity elements to an existing EML document.
9898
#'
9999
#' This function isn't that smart. It will remove existing otherEntity elements
100100
#' if what's in their 'id' attribute isn't `pids`. It will then go on to add
@@ -112,7 +112,7 @@ sysmeta_to_entity <- function(sysmeta) {
112112
#' @export
113113
#'
114114
#' @examples
115-
add_other_entities <- function(mn, path, pids) {
115+
set_other_entities <- function(mn, path, pids) {
116116
stopifnot(class(mn) == "MNode")
117117
stopifnot(file.exists(path))
118118
stopifnot(all(is.character(pids)),
@@ -127,7 +127,7 @@ add_other_entities <- function(mn, path, pids) {
127127
doc <- EML::read_eml(path)
128128
stopifnot(class(doc) == "eml")
129129

130-
message("Adding EML otherEntity elements...")
130+
message("Setting EML otherEntity elements. This can take a while if there are lots of PIDs...")
131131

132132
current_entity_pids <- vapply(doc@dataset@otherEntity, function(x) x@id, "", USE.NAMES = FALSE)
133133

R/helpers.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ create_dummy_metadata <- function(mn, data_pids=NULL) {
2121

2222
# Add otherEntity elements if needed
2323
if (!is.null(data_pids)) {
24-
metadata_file <- add_other_entities(mn, metadata_file, data_pids)
24+
metadata_file <- set_other_entities(mn, metadata_file, data_pids)
2525
}
2626

2727
sysmeta <- new("SystemMetadata",
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)