Presentation is loading. Please wait.

Presentation is loading. Please wait.

SharePoint 2010 Client Side Object Model. Agenda Introduction The Problem Client side vs Server Side Client Side Object Model – How it works – What can.

Similar presentations


Presentation on theme: "SharePoint 2010 Client Side Object Model. Agenda Introduction The Problem Client side vs Server Side Client Side Object Model – How it works – What can."— Presentation transcript:

1 SharePoint 2010 Client Side Object Model

2 Agenda Introduction The Problem Client side vs Server Side Client Side Object Model – How it works – What can it do? – Limitations – Possibilities REST Interface Demonstration – REST + CSOM Questions

3 Introductions Who am I? Who are you? Customisation Possibilities

4 The Problem SharePoint does so much! But not exactly what I want I know – Ill customise it!

5 The Problem Custom development – Too Risky ? Data issues? – Too Expensive ? Initial development Maintenance Upgrade? More often than not, custom development requires installation of components on the Server – Promotion through environments – Time and costs associated with downtime

6 The Problem Customise!

7 The Problem $@#%$*&!

8 The Problem A lot of organisations simply don't allow server side coding A lot of hosting situations dont allow server side coding – BPOS / Office 360 / SharePoint Online – Web Central – Shared Tenancy / Security Issues Team based SharePoint development rarely performed – TFS – Proper Build Servers

9 Client side vs Server Side Client side Server Side

10 Client side vs Server Side Client Side Code running on client computer Can only interact with SharePoint via web services Hard to do anything of any complexity Server Side Code running on server Can use SharePoint object model directly Requires installation on server

11 Client side vs Server Side Designer * Server Side Web Part Development Generic Feature Development UI Menu Feature Development SharePoint Event Handlers Custom Web Services Custom Field Types Custom Page Development/ Code behind Custom Windows Applications / Utilities Custom STSADM commands Business Connectivity Services (BCS)(2010) InfoPath Forms Custom Timer Jobs Custom Workflows / Custom Workflow Actions Branding / Design User controls Workflows Advanced configuration …

12 Client side vs Server Side Client Side ?

13 So previously the real client side options were: – Web Services Very low level A bit complex (security) – Scripts on page Mainly for UI change (hiding fields, UI improvements) Can call web services – yuck VB can do some interesting things – SharePoint designer modifications OK – if you dont delete everything Customisations not as portable as would like Know your boundaries! Client side vs Server Side

14 Some client side work-arounds got quite popular: – JPoint – series of JavaScript functionality in web parts – HTML Calculated column –using the calculated column to conditionally output HTML – JavaScript web-service libraries – still yuck Client side vs Server Side

15 SharePoint 2010 has two major areas of functionality in this area 1.Client Side Object Model (CSOM) 2.REST Services Whats New Already?!

16 16 Consistent developer experience across platforms Client Side Object Model

17

18 Each of these have work with the Client web-service under the hood to provide the functionality on the server CSOM

19 Client Side Object Model

20 Example - Delete List (.net ):

21 Client Side Object Model Example - Delete List ( JavaScript ):

22 Client Side Object Model Demo – CSOM

23 Client Side Object Model JavaScript? – Yes – JavaScript – SharePoint 2010 Ribbon – Custom Links – Content Editor Web Parts – Added into Forms pages for lists and libraries – Scriptlets

24 Client Side Object Model Demo – JS

25 Client Side Object Model Security – Windows Credentials by Default – Can use Forms Authentication – Permission level setting

26 Client Side Object Model Tips and Tricks? – Minimise what you need to retrieve – Know what is loaded in context and what isnt… – Beware of IQueryable with ListItem – JavaScript only has a-sync calls…. Ouch – Use the JavaScript Item Table Holds data for the current item context

27 SP 2010 & REST REST = Representational State Transfer REST allows data to be accessed via URL alone – Allows caching – No state on server Data comes back as an ATOM feed (not RSS)

28 SP 2010 & REST Syntax: – /_vti_bin/ListData.svc/{Entity}[({identifier})]/[{Property}] – Example for sorting: – /_vti_bin/ListData.svc/Announcements?$orderby=Title desc – Example to get budget hours for Project $4: /_vti_bin/ListData.svc/Projects(4)/BudgetHours – Example to get Projects for Clients in Chicago: /_vti_bin/ListData.svc/Projects?$filter=Client/City eq 'Chicago' – Example to get a Project and its related Client: /_vti_bin/ListData.svc/Projects?$expand=Client Shows me parent that is associated with this XML

29 SP 2010 & REST QueryString parameters for REST – $filter – $expand – $orderby – $skip – $top – $metadata (will bring back all the XML metadata about the object. Think of it like WSDL for your REST call)

30 Summary Before – Client side coding was very difficult – Either via web services or very limited in functionality After – Client side coding much easier – Object Model - like coding on the server – Similar for JavaScript, Silverlight,.Net Applications – Dont need to develop on the server! – New Possibilities with Rest and the CSOM

31 Reading: Using the SharePoint Foundation 2010 Managed Client Object Model http://msdn.microsoft.com/en-us/library/ee857094.aspx Managed Client Object Model http://msdn.microsoft.com/en-us/library/ee537247.aspx Common Programming Tasks http://msdn.microsoft.com/en-us/library/ee537013.aspx Praveen Battula http://praveenbattula.blogspot.com/

32 Questions?


Download ppt "SharePoint 2010 Client Side Object Model. Agenda Introduction The Problem Client side vs Server Side Client Side Object Model – How it works – What can."

Similar presentations


Ads by Google