Date post: | 17-Dec-2014 |
Category: |
Documents |
Upload: | officience |
View: | 2,410 times |
Download: | 3 times |
Client side programming with SharePoint 2010
Trung Van PHAM
Client side scenarios Story in SharePoint 2007 SharePoint 2010 Client Object Models
Overview of the Client Object Models .NET Client Object Model Silverlight Client Object Model ECMAScript Client Object Model ADO.NET Data Services
JQuery, SP WebServices and Silverlight
Agenda
Scenarios Web Browsers Microsoft Office Applications Custom Applications
Commonly interaction with SharePoint Display SharePoint data Manipulating with SharePoint data
Client side scenarios
Story in SharePoint 2007
SharePoint Server
SharePoint Content DB
SharePointObject Model
Applications
Web UIs
Web Services,
RPC
Web Browsers
ApplicationsCustom Services
Client Object Model provides 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)
Overview of the Client Object Models
SharePoint 2010 Client Object Models
SharePoint
Server
SharePoint Content DB
SharePointObject Model
Applications
Client.svc
Client Apps
Client OMs
How does Client OM work?
SharePoint Server
Client Application
Client.svc
Execute:• Command 1• Command 2• Command n
Send result back
Build sequence commands:
• Command 1• Command 2• Command n
Execute Commands
Process result
XML
JSON
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
Supported Areas
Consistency
Server (Microsoft.SharePoint)
.NET Managed(Microsoft.SharePoint.Client)
Silverlight(Microsoft.SharePoint.Client.Silverlight)
ECMAScript(SP.js)
SPContext ClientContext ClientContext ClientContext
SPSite Site Site Site
SPWeb Web Web Web
SPList List List List
SPListItem ListItem ListItem ListItem
SPField Field Field Field
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI
Files Microsoft.SharePoint.Client.dll (282KB) Microsoft.SharePoint.Client.Runtime.dll (146
KB) Compare to SharePoint Server OM
Microsoft.SharePoint.dll (16.2 MB)
.NET Client Object Model
DEMO 1Getting Started
.NET Client Object Model (cont)
Think about efficiency All the properties are loaded in DEMO1 Specify the properties you need:
ctx.Load(web, w=>w.Title);ctx.Load(list,l=>l.Title, l=>l.ItemCoun);ctx.ExecuteQuery();
.NET Client Object Model (cont)
DEMO 2Specifying properties to load
.NET Client Object Model (cont)
Loading List Items List Items are always loaded using a CAML
Query[[Code]] - tbd
.NET Client Object Model (cont)
DEMO 3Loading List Items
.NET Client Object Model (cont)
DEMO 4Creating and Updating List Items
.NET Client Object Model (cont)
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin
Files: Microsoft.SharePoint.Client.Silverlight.dll
(266K) Microsoft.SharePoint.Client.Silverlight.Runtime.
dll (142K)
Silverlight Client Object Model
[[tbd]] Code
Silverlight Client Object Model (cont)
DEMO 5Creating the Silverlight Web Part
Silverlight Client Object Model (cont)
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
Files: SP.js (381 KB) Debug version: SP.debug (561 KB)
ECMAScript Object Model
[[tbd]] Code
ECMAScript Object Model (cont)
DEMO 6ECMAScript Object Model
ECMAScript Object Model (cont)
LINQ to SP not implemented in Silverlight ListData.svc provides RESTful access
ADO.NET Data Services
ListData.svcLoads ADO.NET Data Services handler assembly
DEMO 7REST demo
ADO.NET Data Services (c0nt)
SPServices: JQuery Library for SharePoint Web Services Site Url: http://spservices.codeplex.com/
SPServices
DEMO 8JQuery, SPServices and Silverlight
SPServices (cont)
Q & A ?THANK YOU!
Summary