archive: Archive an object on a Member Node or Coordinating Node,...

Description Usage Arguments Details Value See Also Examples

Description

This method provides the ability to archive a data or metadata object on the Member Node provided in the 'mnode' parameter. Archiving removes the object from DataONE search functions, thereby making it more difficult to find without completely removing the object. Archive is intended for objects that should not be used by current researchers, but for which there is a desire to maintain a historical record, such as when journal articles might cite the object. Users can still obtain the contents of archived objects if they have the identifier, but will not discover it through searches.

Usage

1
2
3
4
archive(x, ...)

## S4 method for signature 'D1Node'
archive(x, pid)

Arguments

x

The MNode or CNode instance on which the object will be created

...

(Not yet used)

pid

The identifier of the object to be created

Details

This operation requires an X.509 certificate to be present in the default location of the file system. This certificate provides authentication credentials from CILogon https://cilogon.org/?skin=DataONE. See CertificateManager for details. For DataONE Version 2.0, an authentication token can also be used for authentication. Also, administrator privilege is required to run archive() on a DataONE Coordinating Node.

Value

The pid that was archived if successful, otherwise NULL

See Also

D1Node class description.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
## Not run: 
library(dataone)
library(uuid)
library(digest)
library(datapack)
# First create a new object
cn <- CNode("STAGING")
mn <- getMNode(cn, "urn:node:mnStageUCSB2")
testdf <- data.frame(x=1:10,y=11:20)
csvfile <- paste(tempfile(), ".csv", sep="")
write.csv(testdf, csvfile, row.names=FALSE)
\dontrun{
newid <- generateIdentifier(mn, "UUID")
}
# Create an identifier manually
newid <- paste("urn:uuid:", UUIDgenerate(), sep="") 
format <- "text/csv"
size <- file.info(csvfile)$size
sha1 <- digest(csvfile, algo="sha1", serialize=FALSE, file=TRUE)
sysmeta <- new("SystemMetadata", identifier=newid, formatId=format, size=size, checksum=sha1)
sysmeta <- addAccessRule(sysmeta, "public", "read")
# Create (upload) the object to DataONE (requires authentication)
\dontrun{
create(mn, newid, csvfile, sysmeta)
# Now for demonstration purposes, archive the object
# Archive the object (requires authentication)
archivedId <- archive(mn, newid)
}

## End(Not run)

dataone documentation built on July 2, 2018, 1:02 a.m.