Windows Command Bindings for Revolver
So, you may have guessed that I lean towards the *nix way of doing things with the command bindings in Revolver. I prefer ls over dir. But if you’re writing code for Sitecore you’re definatly working in a Windows environment and probably not so comfortable with the *nix commands.
I’ve written Revolver to be extensible and also to allow the rebinding of the core commands to different monikers. This allows the user to bind the commands to whatever they want. Maybe I want a more verbose command name like listchildren instead of ls or dir. Or maybe I want a really short command name like “l”.
So for those of us that are more comfortable with the Windows world of things, here is a short script to rebind the core commands to Windows equivalents in Revolver.
bind List dir bind CopyItem copy bind MoveItem move bind CreateItem create bind DeleteItem delete bind PurgeVersions purge bind JobManager jobs bind CopyItemToLanguage copylang
So what do I do with this script? Copy it to your clipboard then open the core database of your Sitecore system. Open the content editor and navigate to /sitecore/system/modules/revolver/scripts/startup and create a new script item. Paste the above script contents into the “script” field. Now if you’d like this script to be executed upon startup so all your sessions use the above monikers, then navigate to /sitecore/system/modules/revolver/startup and create a new “user script” item which you can use to map this script to a particular user or role to execute on startup. Just make sure to add the users and roles with the domain in the format <domain>/<user> or <domain>/<role>.