10-07-2015 12:06 PM
// find the backup folder - create if not already exists
var currentTime = new Date();
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
];
var CurrentDayFolder = "Store -" + monthNames[month] + " " + year;
var backupFolder = space.childByNamePath(CurrentDayFolder);
if (backupFolder == null && space.hasPermission("CreateChildren"))
{
// create the folder for the first time
backupFolder = space.createFolder(CurrentDayFolder);
}
if (backupFolder != null && backupFolder.hasPermission("CreateChildren"))
{
// copy the doc into the backup folder
var copy = document.copy(backupFolder);
if (copy != null)
{
// change the name so we know it's a backup
var backupName = "Backup of " + copy.name;
copy.name = backupName;
copy.save();
}
// record the time of the backup to a log file
var logFile = backupFolder.childByNamePath("audit.txt");
if (logFile == null)
{
logFile = backupFolder.createFile("backuplog.txt");
}
if (logFile != null)
{
logFile.content += "File: " + backupName + CurrentDayFolder +
"\tDate: " + new Date().toGMTString() +
"\tSize: " + copy.size + "\r\n";
}
}
var dest = companyhome.childByNamePath("Sites/psn/documentLibrary/test1");
document.move(dest);
10-08-2015 07:51 AM
10-08-2015 12:01 PM
10-09-2015 01:17 AM
10-09-2015 09:54 AM
10-09-2015 10:20 AM
10-10-2015 11:00 AM
var folder = companyhome .childByNamePath("****");
10-13-2015 04:46 AM
10-14-2015 01:10 AM
document.childByNamePath("Sites/Test/DocumentLibrary/MoveTo");
var folder = = companyhome.childByNamePath("Sites/Test/DocumentLibrary/MoveTo");
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.