publish_object: Publish an object on a Member Node

View source: R/editing.R

publish_objectR Documentation

Publish an object on a Member Node

Description

Use sensible defaults to publish an object on a Member Node. If identifier is provided, use it, otherwise generate a UUID. If clone_id is provided, then retrieve the system metadata for that identifier and use it to provide rightsHolder, accessPolicy, and replicationPolicy metadata. Note that this function only uploads the object to the Member Node, and does not add it to a data package, which can be done separately.

Usage

publish_object(
  mn,
  path,
  format_id = NULL,
  pid = NULL,
  sid = NULL,
  clone_pid = NULL,
  public = TRUE
)

Arguments

mn

(MNode) The Member Node to publish the object to.

path

(character) The path to the file to be published.

format_id

(character) Optional. The format ID to set for the object. When not set, guess_format_id() will be used to guess the format ID. Should be a DataONE format ID.

pid

(character) Optional. The PID to use with the object.

sid

(character) Optional. The SID to use with the new object.

clone_pid

(character) PID of object to clone System Metadata from.

public

(logical) Whether object should be given public read access.

Value

pid (character) The PID of the published object.

Examples

## Not run: 
cn <- CNode("STAGING2")
mn <- getMNode(cn,"urn:node:mnTestKNB")
my_path <- "/home/Documents/myfile.csv"
pid <- publish_object(mn, path = my_path, format_id = "text/csv", public = FALSE)

## End(Not run)

NCEAS/arcticdatautils documentation built on Aug. 28, 2023, 12:10 p.m.