As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
////////////////////////////////////////////////////// // File Name: move_version.js // // Purpose : Move a file from a folder to a target // folder (which must be actually parent folder). If file // already exists in target folder it uses versioning to // replace file and increase version number. // // Author: Julien Bonjean (julien@bonjean.info) // // Creation Date: 2009-02-10 // Last Modified: 2009-02-10 16:26:10 -0500 ////////////////////////////////////////////////////// var sourceFile = document; var sourceFolder = document.parent; var targetFolder = space.parent; var targetFile = targetFolder.childByNamePath(document.name); if(targetFile == null) { sourceFile.move(targetFolder); } else { var targetFileWorkingCopy = targetFile.checkout(); targetFileWorkingCopy.content = sourceFile.content; targetFileWorkingCopy.checkin("",false); sourceFile.remove(); }