Log in |
Move Objects Between FoldersThere are many reasons you might want to move objects between folders using a Python Script. You might, for example, want to archive older instances.Assume the following directory structure:
Archive We want to move older items from Current to Archive when some trigger event happens. To do so, we can create a Python Script in Items/Current called archive_old which contains the lines:
You can verify the Script by testing it on a known ID. To make it more useful, create a DTML method to step through the Current directory, determine which Items need archival, and call archive_old, passing it a list of IDs as a parameter. |