Using ClientObjectModel Daniel Plocker CTO, Advantech
Agenda • Client Object Model overview • ECMA Script Client OM • Extending SP with HTML 5 • Going Mobile • .Net Managed Client
WhyClientOM? Client side integration between SharePoint and existing Office or LOB apps simplifies day-to-day activities. Richer, smoother and more intuitive user experience. Better multi-platform support.
3 thingsto know 1. ClientContext is the central object clientContext = new ClientContext(“http://mysite”); 2. Before you read a property, you have to ask for it clientContext.Load(list); 3. All requests must be committed in a batch clientContext.ExecuteQuery();
Client ObjectModelLimitations Client object model cannot be used on server to talk to same-server You still need to handle synch/update semantics (change log could help) No elevation of privilege capabilities Requests are throttled .net CLR has sync method; Silverlight CLR and Jscript are async
GoingMobilewithSharePoint Built-in mobile view with &mobile=1 You can customize the mobile view and master page. To take advantage of JQuery Mobile: Create a simple master page, HTML5 valid Add script links To use with client OM, don’t forget ExecuteOrDelayUntilScriptLoaded
.Net CLRClientOM 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)