05-20-2012 06:16 AM
// Location of log file report
var dest = companyhome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Reports") ;
// Create new log file and add heading
logFile = dest.createFile("log.txt") ;
logFile.content = "Record of which files failed transformation" + "\r\n" ;
// Start iterating over all files in Drafts folder and transform each, one by one
var draftfolder = companyhome.childByNamePath("Sites/myoffice/documentLibrary/AURC Space/DEO/Drafts") ;
var childfiles = draftfolder.children ;
var filenumb = childfiles.length ;
var count = 0 ;
// Go through each file, one by one
for ( i = 0 ; i < filenumb ; i++ )
{
var docu = childfiles[i] ;
var newtxtNode ;
try
{
newtxtNode = docu.transformDocument("text/plain") ;
newtxtNode.save() ;
}
catch (e)
{
logFile.content += ++count + " Error in transformation: " + docu.name ;
}
} // end of for loop
logFile.save() ;
05-20-2012 04:02 PM
05-20-2012 08:29 PM
Or another option could be to queue actions to do the transformations asynchronously. That's possibly a much better approach.
05-20-2012 10:46 PM
05-27-2012 09:39 PM
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.