Skip to main content

%Archive.Content

Class %Archive.Content Extends %RegisteredObject [ System = 4 ]

An Archive Content is an object of source or target of Archive operations (cf. %Archive.Session)

Sample script that creates an Archive Content object for a (source) file or files to be archived: Set ContentOref = ##class(%Archive.Content).%New() Set ContentOref.Name = "File" // description of the content Set ContentOref.RetentionSpec = 0 // a retention period or class name Set Status = ContentOref.AddSource(SourceFilePath1,"Test File 1") // path of the source file and a brief description ("tagname") // and if there are more files to store (as a single content) -- Set Status = ContentOref.AddSource(SourceFilePath2,"Test File 2") // and so on Sample script that creates an Archive Content object for a file or files as the target of a retrieval: Set ContentOref = ##class(%Archive.Content).%New() Set Status = ContentOref.DataSink.Insert(TargetFilePath1) // and if the content contains more than one file -- Set Status = ContentOref.DataSink.Insert(TargetFilePath2) // and so on

Properties

Name

Property Name As %String;

An optional, descriptive name for the content

RetentionSpec

Property RetentionSpec As %String;

Either a retention period, specified as a number (consisting of only digits) in seconds, or a retention class name

Attribute

Property Attribute As array Of %String;

Optional attributes of the content, in pairs of AttributeName and AttributeValue

DataSource

Property DataSource As %String [ MultiDimensional ];

for storing content to server

  • DataSource = DataSourceCount
  • DataSource(DataSourceID,"TagName") = TagName
  • DataSource(DataSourceID,"Source") = Output source (file path, %Stream, etc.)

DataSink

Property DataSink As list Of %String;

a list of targets (file path, %Stream, etc.) for retrieving content from server

Methods

AddSource

Method AddSource(DataSource As %RegisteredObject, TagName As %String) As %Status

Specify a data source to export to server