A SharePoint 2010 Sandboxed Solution that adds a Ribbon Button that recycles all items in a Document Library with a single mouse click.
I' have created this miniproject more as an academic exercise in creating a Ribbon Button than for real business value. It can come in handy for development environments sometimes.
![Ribbon Ribbon](/blogs/vandest/Media/Windows-Live-Writer/Delete-All-Items-Ribbon-Button_F4E9/image_9.png)
Installation and activation
Download from here (Ventigrate Codeplex Repository)
Upload the WSP (sandbox solution) to the Site Collection Solution Gallery and activate it
![Solution Gallery Solution Gallery](/blogs/vandest/Media/Windows-Live-Writer/Delete-All-Items-Ribbon-Button_F4E9/image_3.png)
Activate the Site Collection Feature
![Site Collection Features Site Collection Features](/blogs/vandest/Media/Windows-Live-Writer/Delete-All-Items-Ribbon-Button_F4E9/image_6.png)
Final note
Some lessons learned and things worth noting:
- Use a Module to deploy resource files to a folder or library like the Style Library (Sandbox cannot access the Layouts folder)
- The Module will overwrite the existing resource files with a newer version, but will not delete them
- Working with ECMAScript seems to have no effect on resource or resource quota
- Use InPrivate Browsing for testing Ribbon development, this avoids caching of Ribbon resources
-
CustomAction.ScriptSrc points to the Layouts folder when using relative URLs. Use ~SiteCollection if you want to reference a resource in the Site Collection