SharePoint Saturday - Sandbox development

  • 1,204 views
Uploaded on

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 , …

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.

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,204
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
26
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide
  • 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

Transcript

  • 1. Developing in the Sandbox
    Elaine van BergenOBS
  • 2.
  • 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/
  • 4.
  • 5. 3 Types
    On-premise sandbox
    SharePoint online
    SharePoint online dedicated
  • 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
  • 7. MSOCAF
    Developing in the Sandbox
  • 8. 3 Types
    On-premise sandbox
    SharePoint online
    SharePoint online dedicated
  • 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
  • 11. Sandboxed Solutions Support
  • 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%Common FilesMicrosoft Sharedweb server extensions14CONFIG
    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
  • 15. Sandbox Deployment
  • 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
  • 17. Monitored Resources
  • 18. SharePoint 2010 Approach
    Developers build custom solutions
    Administrators leverage resource monitors to check site collection usage
    Site collection owners deploy, activate and implement the customizations
  • 19. On-Premise Sandbox
    Developing in the Sandbox
  • 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
  • 23. 3 Types
    On-premise sandbox
    SharePoint online
    SharePoint online dedicated
  • 24. Limited web services
    http://msdn.microsoft.com/en-us/library/gg454740.aspx
  • 25. Development Process
    dev.spo.contoso.com
    spo.contoso.com
    *.wsp
    Develop/ Debug
    *.wsp
    F5
    Upload/ Activate/ Deactivate
    *.wsp
    local.contoso.com
  • 26. Getting to data
  • 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
  • 30. SharePoint ONLINE
    Developing in the Sandbox
  • 31. Authentication
  • 32. Authentication
    Claims + Federation + Multiple Authentication Providers
    FedAuth cookie with HTTP Only Flag = WinInet.dll
    http://msdn.microsoft.com/en-us/library/hh147177.aspx
  • 33. Question and Answerhttp://laneyvb.blogspot.com