Presentation is loading. Please wait.

Presentation is loading. Please wait.

Building Dynamic Applications with the SharePoint Client Object Model

Similar presentations


Presentation on theme: "Building Dynamic Applications with the SharePoint Client Object Model"— Presentation transcript:

1 Building Dynamic Applications with the SharePoint Client Object Model
Visual Studio Connections Building Dynamic Applications with the SharePoint Client Object Model Eric Shupps SharePoint Server MVP Updates will be available at

2 About Me SharePoint Server MVP President, BinaryWave
Microsoft Patterns & Practices (spg.codeplex.com) CKS:DEV (cksdev.codeplex.com) Web: Blog: Facebook:

3 “This session is a hunky dory jolly good awesomeness thingy”
Agenda Introduction to the Client Object Model .NET Client Object Model Silverlight and Client Object Model JavaScript and Client Object Model Demo Building a WPF Client Application with SharePoint Data “This session is a hunky dory jolly good awesomeness thingy” - Tobias Zimmergren

4 Legacy Data Access SharePoint Data Server Application SharePoint API
Web Service Client Application

5 Client Object Model Consistent Efficient SharePoint Data
Sort Of Somewhat Consistent Efficient Client Application .Net CLR Silverlight JavaScript

6 Accessing Data with Client OM
Browser JavaScript Controls Client Service Server Object Model JavaScript OM Proxy Proxy Managed OM Content Database Managed Controls Client Server

7 Equivalent Objects Server (Microsoft .SharePoint)
.NET Managed (Microsoft.SharePoint .Client) Silverlight (Microsoft.SharePoint .Client.Silverlight) JavaScript (SP.js) SPContext ClientContext SPSite Site SPWeb Web SPList List SPListItem ListItem SPField Field Show the various resources and their locations Server – Microsoft.SharePoint – [..]\14\ISAPI .NET – Microsoft.SharePoint.Client – [..]\14\ISAPI Silverlight – Microsoft.SharePoint.Client.Silverlight – [..]\14\LAYOUTS\ClientBin ECMAScript – SP.js - [..]\LAYOUTS

8 Getting Started: 3 things to know
ClientContext is the central object Before you read a property, you have to ask for it All requests must be committed in a batch clientContext = new ClientContext(“ clientContext.Load(list); clientContext.ExecuteQuery();

9 High level handling of commands
Client Application Server Sequence of commands: Client.svc command 1; command 2; command 3; Execute commands in the batch: XML context.ExecuteQuery(); command 1; command 2; command 3; JSON Process results Send results back

10 Client Object Model Limitations
You must handle synch/update semantics in code No elevation of privilege capabilities Requests are throttled .net CLR has sync method; Silverlight CLR and Jscript are async Limited subset of Server OM functionality You only get what you ask for – nothing more (but sometimes less)

11 .Net CLR Client OM Provides easy access from remote .NET clients to manipulate SharePoint data Can be utilized from managed code – also from office clients etc. Assemblies Microsoft.SharePoint.Client.dll (281kb) Microsoft.SharePoint.Client.Runtime.dll (145kb) To Compare: Microsoft.SharePoint.dll – 15.3MB

12 DEMO Building a .NET Client OM Application Using SharePoint Data

13 Silverlight in SharePoint 2010
Native Silverlight web part allows for compilation and deployment of XAP-only solutions One-click deployment from Visual Studio 2010 Web Parts can contain custom properties that are sent to Silverlight via the InitParams property Abstracted visual design in Expression (make the designer do it!)

14 Silverlight CLR Client OM
Use the correct references: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions \14\TEMPLATE\LAYOUTS\ClientBin Microsoft.SharePoint.Client.Silverlight 262KB Microsoft.SharePoint.Client.Silverlight.Runtime 138KB

15 Silverlight Client OM

16 Building and Deploying Silverlight
Built in support in Visual Studio 2010 Redirect assembly output into Module F5 deploy and debug experience SharePoint WSP Visual Studio builds WSP package on F5 Module XAP Deploy as Module

17 DEMO Building a Silverlight Client OM Application Using SharePoint Data

18 JavaScript Client OM Provides similar functionality to .NET/Silverlight COM from JavaScript/ECMAScript Identical structure Initialize Context -> Specify Items -> Load Objects -> Execute Query Limited to current site context (no cross-site scripting) Asynchronous (like Silverlight) Be aware of syntax changes get_web() get_lists() get_item()

19 DEMO Building a Javascript Client OM Application Using SharePoint Data

20 Your Feedback is Important
Visual Studio Connections Your Feedback is Important Please fill out a session evaluation form. Thank you! Updates will be available at


Download ppt "Building Dynamic Applications with the SharePoint Client Object Model"

Similar presentations


Ads by Google