SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East

2,209 views

Published on

By

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,209
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • InfoPath consists of three different components:A Form DesignerA Form Filler And InfoPath Forms Services - InfoPath Forms Services is part of the SharePoint platform and allows our forms to be render in a browserWhat kind of capabilities do our forms have?Obviously we give you control over the visual representation of the actual formWe also make it easy to define form behavior through either declarative rules or writing managed code.And third, we allow you to connect InfoPath forms to a wide range of data sources.
  • An incoming request comes in for a page with a Web Part from a partial trust assembly.   This is delegated to a Web Part proxy.  The Web Part proxy then in turn calls the worker process manager, and tells it to execute the Web Part. The worker process manager queries the configuration database to figure out which machine and process it should send the request to. The worker process then sends the request to the user code manager on that machine. The user code manager needs to ensure that the assembly backing the Web Part is locally deployed.  To do this, it reaches back into the Web Part solution package, extracts the assembly, and places it into the assembly cache. Now, the SPUserCodeManager (SPUserCodeHostService.exe) delegates the request to execute the code to SPUserCodeWorkerProcess.exe. The full trust Web Part wrapper works with the instantiated process to simulate the Web Part lifecycle.  The Web Part itself calls into the SharePoint OM to retrieve some set of data. The resulting HTML and viewstate changes are bubbled back to the hosting process, which has been synchronously waiting for this infrastructure to complete. The resulting page is sent back to the user.Rendered results sent back to the requester.
  • SharePoint Sandboxed Solutions and InfoPath - TechEd Middle East

    1. 1. 8 – 10 March 2011 | Dubai, UAE
    2. 2. SESSION CODE: OSP305 8 – 10 March 2011 | Dubai, UAE SharePoint Sandboxed Solutions and InfoPath Ayman El-Hattab Mohamed Yehia Microsoft MVP TSP, Microsoft
    3. 3. Ayman El-Hattab• Technology Specialist• Contributor Author – SharePoint 2010 Unleashed www.aymanelhattab.com @aymanelhattab v-ayele@microsoft.com
    4. 4. Mohamed Yehia• Technology Specialist – Microsoft• SharePoint friend since 2004 www.mohamedyehia.net @mohdyehia v-myehia@microsoft.com facebook.com/mohdyehia
    5. 5. AgendaCreating Forms with InfoPath 2010 Demo: Order FormsDeveloping Sandbox Solutions Demo: Integrating Sandbox with InfoPathSummary
    6. 6. NEED TO HAVE SHIRTS FORTECHED SPEAKERS
    7. 7. What is InfoPath? Form Designer & Filler Browser and Client forms Visual Layout Form Logic Data Connection
    8. 8. InfoPath Vs. ASP.NET
    9. 9. Building UniformOrder FormDemo
    10. 10. SANDBOX SOLUTIONS
    11. 11. Outline•Challenges•What are Sandbox Solutions?•How do they work?•What can I do them Sandbox Solutions?•How can they be managed?
    12. 12. Challenges•Dev, Admin Fight! •Change production farm to Full  •Memory Leaks •Update web.config files •Bad code that eats up farm resources •Deploy everything to the GAC•Admins have some control using CAS •Difficult to implement •Difficult to get right•Largest cause of SharePoint Support cases
    13. 13. Overview of the Sandbox•Allows a subset of the full capabilities in the SharePoint API•Secure – enforcing the sandbox •Execute in a partially trusted environment •Code executes in a special service process •Subject to CAS •Validation framework • Provides way to do custom farm wide validation for the deployed packages •Each solution is isolated to its site collection
    14. 14. AspNetHostingPermission, Level=Minimal SharePointPermission, ObjectModel=true Sandbox SecurityPermission, Flags=Execution My.dll User CodeOther.dll System DLL wss_usercode.config SharePoint Framework Code DLL Full Trust SharePoint OM Subset OM
    15. 15. Sandboxed Solutions Process Root SPWeb of SPSite Per-WFE AssemblyCache 1 Solution gallery 2 5 <siteguid>company.WebParts.wsp intranet.webpart.wsp Web Part gallery foo.dll 6 4 Sandboxed Worker 3 Process 7
    16. 16. Sandboxed Solution LifecycleInstallation• Upload into Solution Gallery Activation • Auto-activates features Deactivation • Inert operation, extended by developer • Web Parts no longer execute Deletion
    17. 17. Developing aSandbox SolutionDemo
    18. 18. Types of Sandboxed Solutions Sandboxed Solutions Support Event/Feature• Sandboxed solutions offer Non-Visual Web Parts Receivers developers a subset of the SharePoint API available fully trusted solutions Feature Activation Custom Workflow • Site collection and Events Actions site scoped Features • Many XML constructs available: Modules, Lists, ContentTypes, etc. InfoPath Forms Services List Definitions• Client technologies to access external data – JavaScript, Custom Actions Site Pages Silverlight etc. • Offloading resource usage and Site Columns Content Types access handling to client
    19. 19. Sandbox Boundaries •No SPSecurity •No SPSite constructor •Off-box connections, http, web services, etc •ADO.net •Enterprise features (Search, BCS, etc.) •Threading •P-Invoke •IO •Other sites
    20. 20. SANDBOX RESOURCE MONITORING
    21. 21. Load Balancing•Sandboxed solutions can be run in two modes •Local Mode • Execute code on the SharePoint WFE • Low administration overhead • Lower scalability •Remote Mode • Execution on back-end farm machine • Via dedicated service applications • Load balanced distribution of code execution requests
    22. 22. Sandbox Solution MonitoringHow it works•Site collection quotas specify the warning and hard limits for number of resources that can be used per day•Sum of resource measures are taken across solutions deployed to site collection •I.e., add up CPU Points for all solutions•Max of resource utilization measures checked against site collection quota to determine if it should be throttled/blocked
    23. 23. Monitored Resources Resources Per Hard Metric Name Description Units Point Limit AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1 CPUExecutionTime CPU exception time Seconds 200 60 CriticalExceptionCount Critical exception fired Number 10 3 Number of times solution InvocationCount Count N/A N/A has been invoked Percentage Units of Overall PercentProcessorTime Note: # of cores not factored in 85 100 Processor Consumed ProcessCPUCycles CPU Cycles 1E+11 1E+11 ProcessHandleCount Windows Handles 10,000 5,000 (Hard Limit Only) Bytes written 1E+07 ProcessIOBytes Bytes 1E+08 to IO Number of Threads ProcessThreadCount Threads 10,000 200 in Overall Process (Hard Limit Only) ProcessVirtualBytes Bytes 1E+09 4E+09 Memory consumed SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 400 100 Amount of time spent waiting SharePointDatabaseQueryTime Seconds 20 60 for a query to be performed UnhandledExceptionCount Unhanded Exceptions 50 3 We have to kill the process because it has UnresponsiveprocessCount Number 2 1 become unresponsive You can tweak these values to fit your need…
    24. 24. Sandbox Solution MonitoringCase Study• A solution has executed 40 SQL queries (via the SharePoint OM)• One point for SQL is 400 queries• Means for SQL it’s consumed .1 resource points• So the resource usage is for the day for that solution is .1 resource points + other counters
    25. 25. Sorting UniformOrder FormDemo
    26. 26. Key Takeaways•You can build complex forms using InfoPath (Rapid Application Development)•Consider Sandbox Solutions first •Safe •Monitored •Allow more manageable hosting scenarios•Quotas are for all sandbox solutions in the site collection• Be creative with your solution design (Use Silverlight + WCF)•InfoPath + Sandboxed Solution  Better Together
    27. 27. Related Content Data-Centric Composites and Mashups in SharePoint 2010 09 March 2011 09:00 AM - 10:00 AM - Room: Yellow Theatre 2 SharePoint 2010 Developer Overview 09 March 2011 03:30 PM - 04:30 PM - Room: Green Room 3 Build Compelling Intranets and Extranets with SharePoint 2010 09 March 2011 11:45 AM - 12:45 PM - Room: Green Room 2 SharePoint Sandboxed Solutions and InfoPath 10 March 2011 09:00 AM - 10:00 AM
    28. 28. 8 – 10 March 2011 | Dubai, UAEComplete anevaluation onCommZone and enterto win a HP Laptop!
    29. 29. © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

    ×