Posts in the "Introduction to SharePoint 2010 SandBox Solutions" series
- Introduction to SharePoint 2010 SandBox Solutions for Site Collection Owners
If you have been reading about exciting new features of SharePoint 2010 you probably heard about something called SandBox Solutions. In this post I will try to explain what SandBox Solutions are and how you, as Site Collection Owner / End User / Non Developer type, can benefit from these solutions.
In a nutshell, SandBoxed solutions allow you to:
- Deploy custom code you have developed or downloaded from the Internet
- Such custom code you deploy cannot jeopardize the stability of your farm
- Solutions are being deployed via web interface
- If you are running SharePoint in a hosted environment you will be deploy SandBoxed solutions there as well
SandBox Solutions support the following SharePoint item types:
- List definitions
- List instances
- Content Types/Fields
- Web Parts derived from WebPart
- Event receivers
- Custom Workflow Actions
For full list check SharePoint Dev Wiki.
Hello World Web Part
So let’s try to deploy our first custom SandBoxed solution web part. I have developed one for you. It comes with two simple web parts.
To deploy it:
- Download the solution package to your computer
- Open your SharePoint 2010 site collection
- Go to Site Actions > Site Settings > Galleries > Solutions
- Click Upload Solution from Solutions ribbon
- Once uploaded make sure you have Activated the solution
To insert this custom web part go to a web part page, choose Edit, then Insert a web part. Web parts you just deployed will be in the Custom group.
Insert the Hello World web part to your page. It will render as something like this:
Yes you could do that, but in next few articles I will show you some stuff you cannot do. The other important benefit is the ability to download/purchase 3rd party web parts and deploy these without any risk.
Very bad Web Part
So let’s do something you shouldn’t do at home :). In the solution package you just deployed there is another web part named Very Bad WebPart. This one is going to try to write „Romeo loves Juliet“ for indefinite number of times on a web part page. But don’t you worry, if it is deployed as SandBox Solution there is no way it can put your farm in any kind of danger.
Once deployed to a web part page it is going to be rendered as:
SharePoint 2010 SandBoxed solutions run as isolated and monitored process. In case unusual operation like the one above is detected the process will finalize its execution.
Monitoring SandBox Solutions
As Site Collection administrator you can monitor resource usage of SandBox solutions via Site Actions > Site Settings > Galleries > Solutions. The simple dashboard shows how much resources have been consumed by deployed solutions. To learn more about SharePoint resource usage configuration click here.
Interested in SandBox Solutions? Stay tuned as I will be posting some interesting samples in next few posts.