The Recycle Bin
Let’s start things off with a bang. Here is a fully working utility with full source code. Enjoy.
Overview:
The Recycle Bin prevents users from deleting files directly. Instead of using the Delete command, they can send files to the Recycle Bin state. On the weekend, a utility backs up all the files in the Recycle Bin and deletes them from the Vault.
Requirements:
Vault Workgroup 2010 or Vault Collaboration 2010 or Vault Manufacturing 2010
Introduction:
This is what I will refer to as a “high touch” utility. What I mean by high touch is that the utility doesn’t work entirely on its own. It will only work if the Vault is configured in a special way. In this case, we need to add a Recycle Bin state to the lifecycle definition. We also need to create a specialized user.
Click here to download the application
Click here to download the source code
Configuring the Vault:
First let’s create a Vault to put all our backup files:
- Open the Autodesk Data Management Server Console
- Select the Vaults entry in the left tree
- Select Actions -> Create from the menu
- Create a new Vault with the name BackupVault
- Exit the console
Next let’s create the specialized user:
- Log into Vault as an administrator
- In the menu, select Tools -> Administration
- Select the Users tab
- Click on the Users button
- Click on the New User button
- Fill in “AppRecycleBin” as the UserName, choose a password, and set the role as “Administrator”, “Document Editor (Level 2)” and “Document Manager (Level 2)”. Also, give access to the main Vault and the backup Vault.
- Click OK to create the user.
- [Optional] Create a Group called Automations and add AppRecycleBin to that group. In the future, any other application specific logins can go in this group.
- Close all open windows by clicking OK.
Now let’s configure the lifecycle states. For this example I will use the Flexible Release Process.
- In the menu, select Tools -> Administration
- Select the Behaviors tab
- Click on the Lifecycles button
- Select the Flexible Release Process and click on the Edit button
- Click on the Add button in the Lifecycle Details section
- Create a new state called Recycle Bin
- Click OK to go back to the Lifecycle Definition dialog. You should now see the Recycle Bin state in blue
- Click Apply and the Recycle Bin state should turn black
- Click on the Recycle Bin state and select the Transitions tab
- Select Recycle Bin -> Released then click the Edit button
- Select the Security tab
- Uncheck the No Restrictions checkbox
- Click the Add button and select Everyone
- Give Everyone the Deny permission
- Click OK
- Repeat steps 10-15 for states Recycle Bin -> Quick-Change, Released -> Recycle Bin, and Quick-Change -> Recycle Bin
- In the Lifecycle Definition dialog, select the Security tab for the Recycle Bin state
- Uncheck the No State Based Security checkbox
- Add an entry for Everyone and set the permission to Allow Read.
- Add an entry for AppRecycleBin and set the permission to Allow Read, Write and Delete.
- Update the security on the Work In Progress and For Review states so that Everyone has a Deny Delete setting and Allow for Read and Modify.
- Exit all dialogs by clicking OK.
Now we have our Vault configured properly. The only way to delete a file using the Flexible Release Process is to put it in the Recycle Bin and let the Recycle Bin utility delete it.
Configuring the Recycle Bin Utility:
- Download and unzip the utility
- Create a file called Run.bat in the same directory ast RecycleBinUtil
- Edit Run.bat in a text editor and write out the RecycleBinUtil command. See the readme.txt file for a description of the parameters.
Example: RecycleBinUtil -U AppRecycleBin -P pass -S novdrwxp -V Vault -BV BackupVault -L out.txt - [Optional] Run the bat file to make sure things work
- Go to the Windows Control Panel and select Scheduled Tasks
- Right click and select New->Scheduled Task
- Name the scheduled task. Ex. Empty Vault Recycle Bin
- Right click the task and select Properties
- Go to the Task tab
- Set the Run parameter to the Run.bat file. Set the Start In parameter to be the directory that run.bat lives in.
- Go to the Schedule tab
- Set the task to run once a week at 1:00 AM on Sunday, or whenever you want.
- Click OK and set login info if needed.
Disclaimer:
This application is experimental in nature. It has not been tested in any manner, and Autodesk does not represent that it is reliable, accurate, complete, or otherwise valid. Accordingly, this application is provided “as is” with no warranty of any kind and you use the application at your own risk.


Leave a Reply