3. Setup Development Environment
• Enable Microsoft SharePoint Foundation
Sandboxed Code Service via CA
• Download power tools
http://visualstudiogallery.msdn.microsoft.com/8e602a8c-6714-
4549-9e95-f3700344b0d9
• Download Silverlight toolkit
http://www.microsoft.com/web/gallery/install.aspx?appid=s
ilverlight4tools;silverlight4toolkit;riaservicestoolkit
SharePoint Saturday
Brisbane 2012
4. 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
Subset-Model
Request Sandbox Worker Proxy Process
Access (SPUCWorkerProcessProxy.exe)
restricted
by CAS
policy
5. Sandboxed Solutions Support
Item Template Sandbox
Compatible?
Visual Web Part No
Visual Web Part (Sandboxed) Yes
Web Part Yes
Sequential Workflow No
State Machine Workflow No
Business Data Connectivity No
Model
Application Page No
Event Receiver Yes
Module Yes
Content Type Yes
List Definition From Content Yes
Type
List Definition Yes
List Instance Yes
Empty Element Yes
User Control No
SharePoint Saturday
Brisbane 2012
6. 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
SharePoint Saturday
Brisbane 2012
7. Unsupported Features
• Anything above the site collection
• Access to External Code/Data
• Creation of SPWeb/SPSite outside of context
• SPSecurity
• BCS (WCF service supported)
SharePoint Saturday
Brisbane 2012
9. 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
SharePoint Saturday
Brisbane 2012
10. Monitored Resources
Resources AbsoluteLi
Metric Name Description Units
Per Point mit
AbnormalProcessTerminationCount Process gets abnormally terminated Count 1 1
CPUExecutionTime CPU exception time Seconds 3,600 60
CriticalExceptionCount Critical exception fired Number 10 3
Number of times solution
InvocationCount Count N/A N/A
has been invoked
Percentage Units of
PercentProcessorTime Note: # of cores not factored in Overall Processor 85 100
Consumed
ProcessCPUCycles CPU Cycles 1E+11 1E+11
ProcessHandleCount Windows Handles 10,000 1,000
(Hard Limit Only) Bytes written
ProcessIOBytes Bytes 0 1E+08
to IO
Number of Threads
ProcessThreadCount Threads 10,000 200
in Overall Process
(Hard Limit Only)
ProcessVirtualBytes Bytes 0 1E+09
Memory consumed
SharePointDatabaseQueryCount SharePoint DB Queries Invoked Number 20 100
Amount of time spent waiting
SharePointDatabaseQueryTime Seconds 120 60
for a query to be performed
UnhandledExceptionCount Unhanded Exceptions 50 3
We have to kill the process because
UnresponsiveprocessCount Number 2 1
it has become unresponsive
11. SharePoint 2010 Approach
• Developers build Developer
custom solutions • Design, build and test
customizations
• Administrators leverage
resource monitors to Administrator
check site collection • Monitor customizations
usage
• Site collection owners
deploy, activate and Site Collection Owner
implement the • Activate and use
customizations customizations
• Install customizations
SharePoint Saturday
Brisbane 2012
13. Sandboxed Solution Summary
• Easy Deployment Model – No coffee break
• Limited functionality
SharePoint Saturday
Brisbane 2012
14. Why Client Object Model?
• More SharePoint Web services
is a major request
• Client Object Model provides more complete API
instead of more services
• Provides an abstraction layer to return results as
recognizable SharePoint objects
• Consistent developer experience across platforms
(.NET, ECMAScript, Silverlight)
SharePoint Saturday
Brisbane 2012
15. Supported Areas
• Site Collections and Sites
• Lists, List Items, Views, and List Schemas
• Files and Folders
• Web, List, and List Item Property Bags
• Web Parts
• Security
• Content Types
• Site Templates and Site Collection Operations
SharePoint Saturday
Brisbane 2012
16. ECMAScriptControlsand Logic
Browser
JSON Response
ECMAScript OM Server
XML Request
OM
Proxy
Client.svc
XML Request
Proxy
JSON Response Content
Managed OM
database
Managed Client
Managed Controls and Logic SharePoint Server
SharePoint Saturday
Brisbane 2012
17. Server .NET Managed Silverlight ECMAScript
(Microsoft.Shar (Microsoft.Shar (Microsoft.Shar (SP.js)
ePoint) ePoint.Client) ePoint.Client.Sil
verlight)
SPContext ClientContext ClientContext ClientContext
SPSite Site Site Site
SPWeb Web Web Web
SPList List List List
SPListItem ListItem ListItem ListItem
SPField Field Field Field
SharePoint Saturday
Brisbane 2012
18. .Net Client OM
• Designed for use outside of SharePoint
• Can be used with .Net 4.0
• Microsoft.SharePoint.Client
SharePoint Saturday
Brisbane 2012
19. .Net Example
ClientContext clientContext = new ClientContext("http://server");
//Load method
clientContext.Load(clientContext.Web);
clientContext.Load(clientContext.Web.Lists);
//LoadQuery method
var q1 = from list
in context.Web.Lists
where list.Title != null
select list;
var r1 = context.LoadQuery(q1);
20. ECMAScript Client OM
• ECMAScript Client OM is easily added to a
SharePoint ASPX page - reference:
– _layouts/sp.js
– Add this using <SharePoint:ScriptLink>
• All libraries crunched for performance
– Use un-crunched *.debug.js by adding
<SharePoint:ScriptLink … ScriptMode=“Debug” />
• Method signatures can be different
• Different data value types
SharePoint Saturday
Brisbane 2012
21. Silverlight Client OM
• Silverlight Development Enabled by Client
OM
• Can use Silverlight in separate ASPX page or
in Web Part
• Can utilize Client OM in Silverlight to create
SharePoint apps
SharePoint Saturday
Brisbane 2012
22. Creating Silverlight Web Parts
• A Web Part can be a host for Silverlight
• SharePoint ships with Silverlight web part
• The web part can contain custom properties
that are sent to Silverlight via the
InitParameters property
• The XAP file can be deployed to LAYOUTS and
loaded at run time
• The Silverlight application can then make use
of the Client OM.
SharePoint Saturday
Brisbane 2012
24. Client Object Model Summary
• 3 different versions
• Need to load items to get data
• Far easier than web services to get data
SharePoint Saturday
Brisbane 2012
26. EWS MA 1.1 Overview
• Managed API for developing applications
that use Exchange Web Services
• Functional parity with EWS*
• Makes EWS calls under the covers
• Backwards compatible
– Request versioning
new ExchangeService(
ExchangeVersion.Exchange2010_SP1);
• Cloud compatible out of the box
SharePoint Saturday
Brisbane 2012
27. Autodiscover
• Don’t hardcode EWS URL in your app!
• Use Autodiscover to find most efficient Client
Access Server URL for a given mailbox
– On-Premise
• Global & distributed deployments
– Cloud based
• Office 365
• Outlook Live
• Live@EDU
SharePoint Saturday
Brisbane 2012
28. Autodiscover – Exchange Online
EWS MA client contacts
Autodiscoversevice
EWS MA client executes
callback to Validate URL
Redirection
EWS MA Autodiscover service
returns URL for EWS EXO Office
Application bindings
365
EWS MA client connects to
Exchange Web Services
Firewall
SharePoint Saturday
Brisbane 2012
29. Impersonation
• Application performs actions using another
user’s
– Identity
– Permissions
• Exchange ApplicationImpersonation role
needs to be granted to a user
• Service account is typically allowed to
impersonate other accounts
SharePoint Saturday
Brisbane 2012
31. Office Client/Exchange Summary
• Easy to program against exchange
• Hybrid solutions to solve business problems
• Call SharePoint from business systems
SharePoint Saturday
Brisbane 2012
36. SharePoint Saturday
Sponsors
Gold
Thanks for listening!
Remember to submit your feedback so Silver
you can go into the raffle draw at the
end of the day! And don’t forget that
Bronze
you have to be at the draw to claim your
prizes!