This is my presentation in Cairo Code Camp Feb 2010.
Learn how to write applications that access SharePoint content without installing code on the server. This session will explore the Client Object Model in its three different flavours, .Net, Javascript (ECMA Script) and Silverlight.
2. Ana Meen? Technical Architect www.mohamedyehia.net @mohdyehia myehia@live.com
3. Why? SharePoint is used as: Data repository File sharing Social network Record management Collaboration Simply, make data available Integrate LOB
4. Challenges SharePoint Object Model available on the server Web services require XML and CAML Major request to increase web services Different from server side code.
5. Client Object Model Simple API an abstraction layer to return results as recognizable SharePoint objects .Net CLR Silverlight Javascript
6. Under the Hood ECMAScriptControlsand Logic Browser JSONResponse Server OM ECMAScript OM Client.svc XMLRequest Proxy XMLRequest Proxy Contentdatabase Managed OM JSONResponse ManagedClient Managed Controls and Logic SharePointServer
7. Not Another Object Model! Efficiency SQL Like Batch processing Network traffic Server Resources Productivity
8. .Net CLR – Client Object Model Assemblies Path %ProgramFiles%ommon Filesicrosoft Sharedeb server extensions4SAPI Microsoft.SharePoint.Client.dll Microsoft.SharePoint.Client.Runtime.dll. (145 kb) Compared to Microsft.SharePoint.dll (15.3 MB)
10. .Net CLR – Client OM, Tips ClientContext is the center of the universe Remember to always ExecuteQuery Use LINQ to load what you really need Use CamlQuery to access Lists
11. Silverlight – Client Object Model Assemblies Path %ProgramFiles%ommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTSlientBin Microsoft.SharePoint.Client.Silverlight.dll Microsoft.SharePoint.Client.Silverlight.Runtime.dll
13. Silverlight – Client OM, Tips ExecuteQuery is always asynchronous Callback methods are executed on another thread Use Invokes to update the UI
14. Javascript – Client Object Model Add link to SP.Js %ProgramFiles%ommon Filesicrosoft Sharedeb Server Extensions4EMPLATEAYOUTS Debug versions available Automatically adds SP.Core.js, SP.Runtime.js
16. Javascript– Client OM, Tips ExecuteQuery is always asynchronous Use jQuery Use with Applications Pages Dialog framework Web parts
17. The Site is the Limit Anything under SPSite Create / delete subsites Create/ delete/ manage lists Create custom actions Create Fields Etc.
18. Alternatives OOB Web Services ADO.NET Data Services sitrurl/_vti_bin/listdata.svc Develop your WCF/ Web services
19. Learn More MSDN (http://MSSharePointDeveloper.com) TechNet (http://MSSharePointITPro.com) Twitter Search #SP2010
20. Coming Sessions When MEF meets Silverlight – Amr El Sehemy What’s New in SharePoint Designer 2010 – Ayman El Hattab in C 7.02 Session 4 : Architecture of SharePoint 2010 Alexander Meijers C 7.01
This diagram displays how the transport mechanism worksManage client OM = .NET / SilverlightAll communication goes through the client.svc WCF serviceMicrosoft implemented the client OM by decorating the core SharePoint OM with attributes if it was “client aware”[ClientCallableType(Name=“Web”,[…]),[…]]public class SPWeb {}Then a code gen tool generates the client OM assemblies and JavaScriptThis ensures that there’s fidelity between all the client OM’s and the server equiv