This session will cover what you can and can’t do in sandboxed environments such as Office 365 or an on premise sandboxed environment. This session is not about SharePoint designer customizations , it’s will cover code instead !
Topics covered include: sandboxed solutions, client object model, web services and how to configure a development environment for testing.
3. Who am I SharePoint 2010 MCM SharePoint MVP Microsoft Virtual Technical Solutions Professional Co-organiser of Melbourne SharePoint User Group (MSPUG) @laneyvb on Twitter Blog at http://laneyvb.blogspot.com/
6. Design Process for Customisation High Level Design (HLD) – approval Follow design guidelines http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18128 Verify/Submit with MSOCAFhttps://caf.sharepoint.microsoftonline.com/Default.aspx
9. Setup Development Environment Enable Microsoft SharePoint Foundation Sandboxed Code Service via CA Download power toolshttp://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-4549-9e95-f3700344b0d9 Download Silverlight toolkithttp://www.microsoft.com/web/gallery/install.aspx?appid=silverlight4tools;silverlight4toolkit;riaservicestoolkit
10. Sandbox Execution FRONT END BACK END User Code Service (SPUCHostService.exe) Execution Manager(Inside Application Pool) Sandbox Worker Process (SPUCWorkerProcess.exe) IIS(WPW3.EXE) Web.config / CAS Policies Untrusted Code SP Object Model Subset Subset-Model Request Sandbox Worker Proxy Process (SPUCWorkerProcessProxy.exe) Access restricted by CAS policy Full SP Object Model
12. API Scope Subset of Microsoft.SharePoint Scoped to SPSite/Site Collection and below Site Columns Content Types List Definitions List Instances Web Parts Workflows Custom Actions SharePoint Designer workflow activities Event Receivers Modules/Files
13. CAS Policy wss_usercode.config %ProgramFiles%ommon Filesicrosoft Sharedeb server extensions4ONFIG SharePointPermission.ObjectModel SecurityPermission.Execution AspNetHostingPermission = Minimal WebPermission.Connect
14. Unsupported Features Anything above the site collection Access to External Code/Data Creation of SPWeb/SPSite outside of context SPSecurity BCS
16. Solution Monitoring Protects Site Collection from resource intensive solutions Resource Points measure resource consumption Site Collection Quota limits resource consumption per day Absolute Limit limits resources consumed by a solution
20. Solution Validation [GuidAttribute("34805697-1FC4-4b66-AF09-AB48AC0F9D97")] public class PublisherValidator: SPSolutionValidator{ [Persisted] List<string> _allowedPublishers; public override void ValidateSolution( SPSolutionValidationProperties properties){ } public override void ValidateAssembly( SPSolutionValidationProperties properties, SPSolutionFile assembly){ } }
21. Full trust proxy Operations in class that inherits Microsoft.SharePoint.Usercode.SPProxyOperation Arguments in serializable class that inherits Microsoft.SharePoint.Usercode.SPProxyOperationArgs Register full trust proxy Recycle user code service Consume via SPUtility.ExecuteRegisteredProxyOperation
22. Load Balancing Sandboxed solutions can be run in two modes: Local Mode: Execute code on WFE Low administration overhead Lower scalability Remote Mode: Execute on dedicated SharePoint servers Load balanced distribution of code execution requests
27. Client-Object Model New APIs for interacting with SharePoint sites Supported platforms .NET 3.5 (and below) Silverlight 2.0 (and above) JavaScript/Jscript Provides a means to call services outside SharePoint Online
28. Equivalent Objects Member names mostly the same from server to client (e. g., SPWeb.QuickLaunchEnabled = Web.QuickLaunchEnabled)
29. Architecture/Execution ECMAScriptControlsand Logic Browser Client.svc Server OM JSON Response ECMAScript OM XML Request Proxy XML Request Contentdatabase Proxy JSON Response Managed OM Managed Client Managed Controls and Logic SharePoint Server
Evolving storyPainful start slow, but don’t discount the whole ideaLots of concepts that have good merit and the practise of moving towards architecting solutions that can run on tightly governed sharepoint platforms regardless of location is where many believe the industry will be heading.
HLD – preapproved solutions still require HLD, before any custom code.Design guidelines:Specific structureEfficient codehttp://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18128
HLD – preapproved solutions still require HLD, before any custom code.Design guidelines:Specific structureEfficient codehttp://www.microsoft.com/download/en/details.aspx?displaylang=en&id=18128
Error handlingCross site collection and/or different permissions
UploadUploaded to Solution GalleryRequires Site Collection adminActivationActually deploys files, registers Event Receivers, etc.Site Collection features activatedSite features must be activated manuallyDeactivationDisables capabilitiesDeletionRemoves the solutionUpgradeUse the same solution ID, different nameFeatures are compared, new features activated
Protects Site Collection from resource intensive solutionsResource Points measure resource consumptionResourceMeasure is what is measuredResourcePerPoint is how points are calculatedSite Collection Quota limits resource consumption per daySummed across all solutionsAll solutions are deactivatedAbsolute Limit limits resources consumed by a solutionHard limit of resources consumed in a requestRestarts worker process
SharePoint 2010 allows customizations to be deployed and maintained at the site collection level. Increasing agility while releasing burden on IT.Of course there is still IT involvement, but mainly when things go wrong (such as excessive resource usage).
Create sandbox visualwebpartAdd bad code, compileAdd good code , compileUpload to solution galleryActivate and useChange code, rename and try again
Code can either be executed locally on the machine that receives the request, or on a load-balanced back-end server. The User Code Service needs to run on the machine executing the request.
Develop and debug on-premisesVisual Studio 2010F5 DebuggingConfirm solution in staging site collectionDedicated site collection to dev teamUpload *.wspAcceptance testingDeploy *.wsp uploaded to Solution Gallery
New APIs for interacting with SharePoint sitesEasier than SharePoint Web Services, more efficientConsistent with Microsoft.SharePoint namespaceScoped to site collection, scoped for downloadSupported platforms.NET 3.5 (and below)Silverlight 2.0 (and above)JavaScript/JscriptProvides a means to call services outside SharePoint Online