SharePoint 2010 ECM Code Sample: Document Sets Ribbon and Export
Use this SharePoint 2010 code sample to add a custom button to the document sets ribbon and add functionality to it, and learn how to export document sets for download as a ZIP file.
Applies to: SharePoint Server 2010
The Document Sets Ribbon and Export code sample in the DocumentSetRibbonAndExport.zip file is located in the path C:\Program Files\Microsoft SDKs\SharePoint 2010\Samples folder. The sample shows how to add a new custom button to the Manage tab of the document sets ribbon, how to add functionality to the button, and how to export document sets so that they can be downloaded as a single ZIP file.
Download the SharePoint 2010 sample code described in this topic from Code Gallery.
Building and Running the Document Sets Ribbon and Export Sample
Test this project on your development or test site.
Building the Sample
In Microsoft Visual Studio 2010, open the *.sln file.
On the Properties pane, change the Site URL value to be the absolute address of your development test site. For example, http://MyDevServer/. Ensure that you include the closing forward slash.
Running the Sample
Before you run this sample, set it up for deployment by building the project, adding the assembly to the global assembly cache (GAC), modifying the web.config file, copying image files, and installing and activating features.
To deploy the sample
Build the DocsetRibbonDelegate project.
Add the DocsetRibbonDelegate DLL file to the global assembly cache.
Add the control to the safecontrols list in the application web.config file.
<SafeControl Assembly="DocsetRibbonDelegate, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fd6371d40a0070d2" Namespace="MyRibbonDelegate" TypeName="MyRibbonDelegateClass" />
Copy both features (addzipribbon and addzipdelegate) to the layouts\features folder.
Copy both image files (zipfile16x and zipfile32x) to the layouts\images folder.
Install and activate both features.
stsadm -o installfeature -filename addzipribbon\feature.xml stsadm -o activatefeature -filename addzipribbon\feature.xml -url https://localhost stsadm -o installfeature -filename addzipdelegate\feature.xml stsadm -o activatefeature -filename addzipdelegate\feature.xml -url https://localhost IISRESET
See Also
Tasks
How to: Customize the Document Set Ribbon in SharePoint Server 2010 (ECM)
Concepts
Document Sets in SharePoint Server 2010 (ECM)