Setting and updating autoarchive rules
Use the following Archiving API operations to set autoarchive rules programmatically:
*SubmitJob and UpdateFile
To set archive rules when you use SubmitJob, set one or more elements of ArchiveRule.
To add or update autoarchive rules for an existing file or folder, use the SetArchiveRules, AddArchiveRules, or RemoveArchiveRules suboperations of UpdateFile. Each of these suboperations has an ArchiveRule element.
You can set the following elements of ArchiveRule, described in Table 14‑1.
Table 14‑1 ArchiveRule elements
Element
Description
ArchiveOnExpiration
True if you want to archive the file before the system deletes it.
ExpirationAge
The number of minutes before expiration. If you set ExpirationAge, you cannot set ExpirationTime.
ExpirationTime
The time of day for the expiration. If you set ExpirationTime, you cannot set ExpirationAge.
ExpireDependentFiles
True if dependent files expire with the original file.
FileType
The file type to which the rule applies. To set the rule for a folder and its subfolders, specify Directory.
InheritedFrom
The source of an inherited rule.
IsInherited
True if the item inherits archiving rules. If this element is True, the system ignores all other elements except FileType.
NeverExpire
True if the file does not have an expiration date or expiration age. If this element is True, the system ignores ExpirationAge and ExpirationTime.
*UpdateJobSchedule
Use the SetParameters suboperation to change the autoarchive rules for the job output file. You can change the following archive-related elements of SetParameters, described in Table 14‑2.
Table 14‑2 Archive-related elements of SetParameters
Element
Description
ArchiveOnExpire
True if you want to archive the file before the system deletes it
ArchiveRuleInherited
Indicates whether the job output file inherits archive rules
ExpirationAge
The number of minutes before the output file expires
ExpirationDate
The date on which the output file expires
NeverExpire
True if the file does not have an expiration date or expiration age
*UpdateVolumeProperties
Use the SetAutoArchiveSchedules suboperation to update the autoarchive schedule details for the volume.
Setting default autoarchive rules when creating a folder
Use CreateFolder followed by UpdateFile to set autoarchive rules for a folder when you create the folder. In UpdateFile, set the ArchiveRule element of SetArchiveRules. In the following example, FileType $$$ indicates that the file is a folder. The autoarchive rules you set in the request apply to all file types in the folder except those that already have archive rules. When NeverExpire is False, you must set either an expiration date or an expiration age. Express the expiration age in minutes.
<SOAP-ENV:Body>
<Administrate>
<Transaction>
<CreateFolder>
<FolderName>/Inventory/Timeshares</FolderName>
<IgnoreDup>false</IgnoreDup>
</CreateFolder>
<UpdateFile>
<SetArchiveRules>
<ArchiveRule>
<FileType>$$$</FileType>
<NeverExpire>false</NeverExpire>
<ArchiveOnExpiration>true</ArchiveOnExpiration>
<ExpirationAge>14400</ExpirationAge>
<IsInherited>false</IsInherited>
</ArchiveRule>
</SetArchiveRules>
<Name>/Inventory/Timeshares</Name>
</UpdateFile>
</Transaction>
</Administrate>
</SOAP-ENV:Body>
As with other Administrate operations, the response to this request is empty when the operation succeeds. In the event of failure, the response is an error message.
Setting autoarchive rules when creating a job schedule
Set properties of the ArchiveRule element, as shown in the following example, to set autoarchive rules for a report when you create a schedule for the report. If you set an expiration age, express the age in minutes. For example, to set an expiration age of 30 days, express the age as 43200 minutes. If you want the file to inherit archive rules from a file or folder, set IsInherited to True and use InheritedFrom to show the path to the file or folder from which the file inherits its rules.
<SOAP-ENV:Body>
<SubmitJob>
<JobName>pie</JobName>
<Priority>500</Priority>
<InputFileName>/Inventory/pie.rptdesign</InputFileName>
<RunLatestVersion>true</RunLatestVersion>
<RequestedOutputFile>
<Name>/Inventory/pie.rptdocument</Name>
<ReplaceExisting>false</ReplaceExisting>
<ArchiveRule>
<FileType>rptdocument</FileType>
<ArchiveOnExpiration>true</ArchiveOnExpiration>
<ExpirationAge>43200</ExpirationAge>
<IsInherited>false</IsInherited>
</ArchiveRule>
</SubmitJob>
</SOAP-ENV:Body>
The response to this operation is the JobId if the job succeeds. If the job fails, an error message appears.
Updating autoarchive rules for a file or folder
Use UpdateFile and modify the ArchiveRule property of the SetArchiveRules element to update the autoarchive rules for a file or folder. Express the expiration age in minutes.
<SOAP-ENV:Body>
<Administrate>
<UpdateFile>
<SetArchiveRules>
<ArchiveRule>
<FileType>RPTDESIGN</FileType>
<NeverExpire>false</NeverExpire>
<ArchiveOnExpiration>true</ArchiveOnExpiration><ExpirationAge>28800</ExpirationAge>
</ArchiveRule>
</SetArchiveRules>
<IdList>
<String>4</String>
</IdList>
</UpdateFile>
</Administrate>
</SOAP-ENV:Body>
As with other Administrate operations, the response to this request is empty when the operation succeeds. In the event of failure, the response is an error message.
Updating autoarchive rules for a job output file
Use UpdateJobSchedule to change autoarchive rules for the output of a job when you update the job schedule. For example, you can change rules about using the inherited archive policy for the document’s file type, about deleting the output, or about archiving the document before deletion. The following example updates the autoarchive rules for inheritance, expiration age, and whether to archive the file at expiration:
<SOAP-ENV:Body>
<Administrate>
<UpdateJobSchedule>
<SetAttributes>
<RunLatestVersion>false</RunLatestVersion>
<InputFileName>/detail.rptdesign; 2</InputFileName>
</SetAttributes>
<SetParameters>
<OutputMaxVersion>0</OutputMaxVersion>
<RetryOption>VolumeDefault</RetryOption>
<ArchiveRuleInherited>false</ArchiveRuleInherited>
<ExpirationAge>86400</ExpirationAge>
<ArchiveOnExpire>true</ArchiveOnExpire>
</SetParameters>
<SetParameterValues>
<ParameterValue>
<Group>Office Parameters</Group>
<Name>DataSource::offices_city</Name>
</ParameterValue>
</SetParameterValues>
<Id>13</Id>
</UpdateJobSchedule>
</Administrate>
</SOAP-ENV:Body>
As with other Administrate operations, the response to this request is empty when the operation succeeds. In the event of failure, the response is an error message.
Updating the autoarchive rules for a file type in a folder or volume
Use UpdateFile to change the default autoarchive rules for a file type in a folder or volume. Indicate the file type in the ArchiveRule element. In the NameList element, specify the folder to which the new rules apply. In the following example, the new rules apply to all files with the .rpt extension in the Inventory folder, unless individual files of that type already have autoarchive rules. Express the expiration age in minutes.
<SOAP-ENV:Body>
<Administrate>
<UpdateFile>
<SetArchiveRules>
<ArchiveRule>
<FileType>rpt</FileType>
<NeverExpire>false</NeverExpire>
<ArchiveOnExpiration>true</ArchiveOnExpiration>
<ExpirationAge>2880</ExpirationAge>
</ArchiveRule>
</SetArchiveRules>
<NameList>
<String>/Inventory</String>
</NameList>
</UpdateFile>
</Administrate>
</SOAP-ENV:Body>
As with other Administrate operations, the response to this request is empty when the operation succeeds. If the request fails, the response is an error message.
Setting an autoarchive schedule when updating a volume
Use UpdateVolumeProperties and change properties of SetAutoArchiveSchedules to change a volume’s autoarchive schedule.
<SOAP-ENV:Body>
<Administrate>
<UpdateVolumeProperties>
<SetAutoArchiveSchedules><SetSchedules>
<TimeZoneName>PST</TimeZoneName>
<ScheduleDetails>
<JobScheduleDetail>
<ScheduleType>Daily</ScheduleType>
<ScheduleStartDate>2008-12-12
</ScheduleStartDate>
<ScheduleEndDate>2008-12-28</ScheduleEndDate>
<DatesExcluded>
<Date>2008-12-25</Date>
</DatesExcluded>
<DurationInSeconds>1800</DurationInSeconds>
<Daily>
<FrequencyInDays>1</FrequencyInDays>
<OnceADay>07:00:00</OnceADay>
</Daily>
</JobScheduleDetail>
</ScheduleDetails>
</SetSchedules>
</SetAutoArchiveSchedules>
</UpdateVolumeProperties>
</Administrate>
</SOAP-ENV:Body>
As with other Administrate operations, the response to this request is empty when the operation succeeds. If the request fails, the response is an error message.