New England Code Camp 13 Slide Decks and Code Samples
April 12, 2010 Leave a comment
The 13th New England Code Camp was a great event, and I am glad I had the chance to participate. This was my first code camp that I had the opportunity to present. It was definitely a different experience than the SharePoint Saturday events that I am usually presenting at and organizing, but a worthwhile experience. I cannot wait for the next one to come along!
Chris Bowen and Chris Piels did an excellent job organizing the event. Thanks to you both! And thank you to all who expressed interest in the Boston Area SharePoint Users Group, as well as attending my two sessions.
I presented two sessions back-to-back, first being What’s New For Developers in SharePoint 2010, and the second being Creating Custom Actions within SharePoint. Below, you will find my slide decks and code samples from each session.
What’s New For Developers in SharePoint 2010
Abstract: SharePoint 2010 offers developers a unique and well deserved set of tools to aid in the development of SharePoint 2010 solutions. In this session we’ll cover improvements in the UI and the toolsets themselves, from PowerShell as a powerful scripting interface to the API, the Developer Dashboard, the SharePoint Toolkit in Visual Studio 2010, and more.
Code Samples
PowerShell commands to enable the Developer Dashboard
1: [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings.DisplayLevel='OnDemand';
2: [Microsoft.SharePoint.Administration.SPWebService]::ContentService.DeveloperDashboardSettings.Update();
3:
4:
PowerShell command to get a listing of the URL, Author, and Title of a Web
1: Get-SPweb -site http://whatsnewin2010.dev.grace-hunt.com | ft Url, Title, Author
2:
3:
PowerShell command to get the Title of all of the lists within a Web
1: Get-SPweb -site http://whatsnewin2010.dev.grace-hunt.com | foreach { $_.Lists | ft $_.Url, Title }
2:
3:
PowerShell command to get the listing of all of the Resource settings for the User Code service (Sandbox Solutions)
1: [Microsoft.SharePoint.Administration.SPUserCodeService]::Local.ResourceMeasures
2:
3:
PowerShell commands to enable the User Code service to run on a Domain Controller (local image development for Sandbox Solutions)
1: $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName
2: $person = [System.Security.Principal.NTAccount]"Users"
3: $access = [System.Security.AccessControl.RegistryRights]::FullControl
4: $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit"
5: $propagation = [System.Security.AccessControl.PropagationFlags]::None
6: $type = [System.Security.AccessControl.AccessControlType]::Allow
7: $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type)
8: $acl.AddAccessRule($rule)
9: Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl
10:
11:
PowerShell commands to view the Property Bag of a Web
1: $web = get-spweb -site http://whatsnewin2010.dev.grace-hunt.com
2: $web.AllProperties | ft
3:
4:
Also, more information on SharePoint Server 2010 can be seen on my blog under the categories of SharePoint 2010 Beta 2, SharePoint Designer 2010, and SharePoint 2010.
Creating Custom Actions within SharePoint
Abstract: Custom Actions control features in SharePoint such as the Edit Control Block, the Site Actions menu, toolbars, and the links within the Site Settings page. Learn how to leverage Custom Actions to extend the SharePoint User Interface. This session will describe the basics of Custom Actions, a demonstration to build one or more and apply them to a site in SharePoint, as well as provide resources for additional information.
Code Samples
-
Demo #1 – Creating a Simple Custom Action
-
Screencast: http://www.vimeo.com/9728285
-
SPS.SiteActionsSolutionManagement
-
This was the link to the Solution Management page within SharePoint Central Administration off of the Site Actions menu. This is hard-linked however to my local system, to: http://litwareserver:9999, you will need to modify this within the solution, and rebuild the WSP to use for your CA URL and port.
-
Download: SPS.SiteActionsSolutionManagement.zip
-
-
-
SPS.SiteRecycleBin
-
This was the second deployment I quickly ran through, which added a Site Recycle Bin link to the Site Actions page under the Site Administration Custom Action Group
-
Download: SPS.SiteRecycleBin.zip
-
-
SPSDC.SiteActionsRecycleBin
-
This is the solution that I walked through during the first demonstration. This will add links to both the current site recycle bin, as well as the site collection recycle bin to the Site Actions menu.
-
Download: SPSDC.SiteActionsRecycleBin.zip
-
Demo #2 – Creating a Slightly More Complex Custom Action
-
Screencast: http://www.vimeo.com/9728320
-
SPS.CompleteTask
-
This is the solution from the second demonstration. This solution will add Complete Task links to the Tasks and Gantt Tasks (Project Tasks) lists shown in the Edit Control Block. This will allow you to set the task Status field to Completed, and the Percent Complete field to 100% for the given task.
-
Download: SPS.CompleteTask.zip
-
Demo #3 – Hiding Custom Actions
-
Screencast: http://www.vimeo.com/9728353
-
SPS.HideCustomAction
-
This solution hides the custom action on the Site Settings page under Site Administration for ‘Delete This Site’. There is a README.txt within the solution as well, which gives direction on the STSADM commands that need to be run to activate and deactivate this feature, as we have it hidden from the Site Features page, and it can only be activated by using STSADM.
-
Download: SPS.HideCustomAction.zip
-
Additional Resource: http://gvaro.spaces.live.com/blog/cns!B06529FD3FC75473!415.entry
-
Demo #4 – Custom Action Groups
-
Screencast: http://www.vimeo.com/9759410
-
SPS.CustomActionGroup
-
-
This solution creates a Custom Action Group within the Site Settings page, that links to a few Custom Action resources on MSDN.
-
Download: SPS.CustomActionGroup.zip
-