sharepoint sandboxed solutions and infopath - teched middle east

Post on 23-Dec-2014

1.619 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

By

TRANSCRIPT

8 – 10 March 2011 | Dubai, UAE

8 – 10 March 2011 | Dubai, UAE

Ayman El-Hattab Mohamed YehiaMicrosoft MVP TSP, Microsoft

SharePoint Sandboxed Solutions and InfoPath

SESSION CODE: OSP305

• Technology Specialist • Contributor Author – SharePoint 2010 Unleashed

Ayman El-Hattab

v-ayele@microsoft.com

@aymanelhattab

www.aymanelhattab.com

• Technology Specialist – Microsoft• SharePoint friend since 2004

Mohamed Yehia

v-myehia@microsoft.com

@mohdyehia

www.mohamedyehia.net

facebook.com/mohdyehia

Agenda

Demo: Order Forms

Developing Sandbox Solutions

Demo: Integrating Sandbox with InfoPath

Summary

Creating Forms with InfoPath 2010

NEED TO HAVE SHIRTS FOR TECHED SPEAKERS

What is InfoPath?

Visual Layout

Form Logic

Data Connection

Form Designer & FillerBrowser and Client forms

InfoPath Vs. ASP.NET

Building Uniform Order FormDemo

SANDBOX SOLUTIONS

Outline

• Challenges• What are Sandbox Solutions?• How do they work?• What can I do them Sandbox Solutions?• How can they be managed?

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

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

Sandbox

Sandbox and Code Access SecurityAspNetHostingPermission, Level=MinimalSharePointPermission, ObjectModel=true

SecurityPermission, Flags=Execution

Full Trust

wss_usercode.config

User Code

Framework Code

My.dll

Other.dll System DLL

SharePoint DLL

SharePoint OM

Subset OM

Sandboxed Solutions Process

Root SPWeb of SPSiteSolution galleryWebParts.wsp

Web Part gallery

Per-WFE AssemblyCache<siteguid>\company.intranet.webpart.wsp\foo.dll

Sandboxed Worker Process

12 5

6

7

4

3

Sandboxed Solution Lifecycle

Installation• U

pload into Solution Gallery

Activation• A

uto-activates features

Deactivation• I

nert operation, extended by developer

• Web Parts no longer execute

Deletion

Developing a Sandbox SolutionDemo

Types of Sandboxed Solutions Sandboxed Solutions Support

• Sandboxed solutions offer developers a subset of the SharePoint API available fully trusted solutions• Site collection and

site scoped Features• Many XML constructs available: Modules, Lists,

ContentTypes, etc.

• Client technologies to access external data – JavaScript, Silverlight etc.

• Offloading resource usage and access handling to client

Non-Visual Web Parts

Event/Feature

Receivers

Feature Activation

Events

Custom Workflow

Actions

InfoPath Forms

ServicesList

DefinitionsCustom Actions

Site Pages

Site Columns

Content Types

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

xxxx

xx

x

xx

SANDBOX RESOURCE MONITORING

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

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

Monitored ResourcesMetric Name Description Units Resources Per

PointHard Limit

AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1CPUExecutionTime CPU exception time Seconds 200 60CriticalExceptionCount Critical exception fired Number 10 3

InvocationCount Number of times solution has been invoked Count N/A N/A

PercentProcessorTime Note: # of cores not factored in Percentage Units of Overall Processor Consumed 85 100

ProcessCPUCycles CPU Cycles 1E+11 1E+11ProcessHandleCount Windows Handles 10,000 5,000

ProcessIOBytes (Hard Limit Only) Bytes written to IO Bytes 1E+07 1E+08

ProcessThreadCount Number of Threads in Overall Process Threads 10,000 200

ProcessVirtualBytes (Hard Limit Only) Memory consumed Bytes 1E+09 4E+09

SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 400 100

SharePointDatabaseQueryTime Amount of time spent waiting for a query to be performed Seconds 20 60

UnhandledExceptionCount Unhanded Exceptions 50 3

UnresponsiveprocessCount We have to kill the process because it has become unresponsive Number 2 1

You can tweak these values to fit your need…

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

Sorting Uniform Order FormDemo

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

Q & A

34

SharePoint Sandboxed Solutions and InfoPath10 March 2011 09:00 AM - 10:00 AM

Build Compelling Intranets and Extranets with SharePoint 201009 March 2011 11:45 AM - 12:45 PM - Room: Green Room 2

SharePoint 2010 Developer Overview09 March 2011 03:30 PM - 04:30 PM - Room: Green Room 3

35

Related Content

Data-Centric Composites and Mashups in SharePoint 201009 March 2011 09:00 AM - 10:00 AM - Room: Yellow Theatre 2

8 – 10 March 2011 | Dubai, UAE

Complete an evaluation on CommZone and enter to win a HP Laptop!

© 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.

top related