1 / 29

SharePoint 2010 Client Side Object Model

SharePoint 2010 Client Side Object Model. 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 . Introductions. Who am I? Who are you?

vince
Download Presentation

SharePoint 2010 Client Side Object Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 – I’ll 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 don’t 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 Server Side Client 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. Client side vs Server Side • 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 don’t delete everything • Customisations not as portable as would like • Know your boundaries!

  14. Client side vs Server Side • 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

  15. What’s New Already?! • SharePoint 2010 has two major areas of functionality in this area • Client Side Object Model (CSOM) • REST Services

  16. Client Side Object Model • Abstraction layer • Results returned as recognizable SharePoint objects • Client Object Model provides complete API • .NET • ECMAScript • Silverlight Consistent developer experience across platforms • What does the client object model enable? • Provide powerful ways to interact with SharePoint Online data remotely without web services – providing access to objects at the site-collection level and lower within the SharePoint hierarchy.

  17. Client Side Object Model • In a nutshell - the client side object model provides an ‘object model’ to client technologies • .NetApplications • Silverlight • JavaScript (ECMAScript) • Each of these have a separate .dll to work with, but have very similar code

  18. Client Side Object Model • 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. Client Side Object Model • 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 isn’t… • Beware of IQueryablewith ListItem • JavaScript only has a-sync calls…. Ouch • Use the JavaScript “Item Table” • Holds data for the current item context

  27. 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 • Don’t need to develop on the server! • New Possibilities with Rest and the CSOM

  28. 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/

  29. Questions?

More Related