SharePoint 2010 Client Object Model Overview & Capabilities
160 likes | 364 Vues
SharePoint 2010 Client Object Model Overview & Capabilities. Mark Nischalke, MCPD, MCSD, MCAD SharePoint Architect Prequel Solutions. What is the Client Object Model Supported environments Architecture How to use it SharePoint context Accessing objects Efficient queries
SharePoint 2010 Client Object Model Overview & Capabilities
E N D
Presentation Transcript
SharePoint 2010 Client Object Model Overview & Capabilities Mark Nischalke, MCPD, MCSD, MCAD SharePoint Architect Prequel Solutions
What is the Client Object Model Supported environments Architecture How to use it SharePoint context Accessing objects Efficient queries Add/Update/Delete Agenda
Been involved in Software Development over 15 years • Master of Information Systems • Multiple Microsoft certifications • Frequent contributor and MVP for Code Project About Me
Web services are available for use _vit_bin/Lists.asmx _vit_bin/Sites.asmx _vit_bin/Webs.asmx REST interface _vti_bin/ListData.svc _vti_bin/ListData.svc/Employees(4) _vti_bin/ListData.svc/Employees?$orderby=Name Web Services
Supported environments .NET managed code (.NET Framework 3.5 only) JavaScript Silverlight Client Object Model
_vti_bin/Client.svc/ProcessQuery Receives XML Returns JSON Client Object Model
.NET managed code (<%SharePoint Root%>\ISAPI) Microsoft.SharePoint.Client.dll (282kb) Microsoft.SharePoint.Client.Runtime.dll (146kb) JavaScript SP.js (381kb) * SP.Runtime.js (67kb) Silverlight (<%SharePoint Root%>\TEMPLATE\LAYOUTS\ClientBin) Microsoft.SharePoint.Client.Silverlight.dll (266kb) Microsoft.SharePoint.Client.Runtime.Silverlight.dll (142kb) Reference assemblies
Most server objects are represented in the Client OM Client Object Model
Authentication Uses Windows Authentication by default Can be configured for Claims Based Authentication ctx.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication; ctx.FormsAuthenticationLoginInfo = new FormsAuthenticationLoginInfo("loginName", "password"); Client Object Model
ClientContextctx = new ClientContext(“http://mysite”); Web web = ctx.Site.RootWeb; ctx.Load(web); ctx.Load(web, w => w.Title, w => w.Description); ctx.Load(web, w => w.Title, w => w.Lists .Include(l => l.Fields .Include(f => f.InternalName, f => f.Group))); Client Object Model
ClientContextctx = new ClientContext(“http://mysite”); Web web = ctx.Site.RootWeb; var lists = ctx.LoadQuery(web.Lists); var lists = ctx.LoadQuery(web.Lists.Include(l => l.Title)); var query = from l in web.Lists .Include(l => l.Title) select l; varlists = ctx.LoadQuery(query); Client Object Model
http://www.codeproject.com/KB/sharepoint/CSOM_Part1.aspx http://www.codeproject.com/KB/sharepoint/CSOM_Part2.aspx http://www.mansoftdev.com mark@mansoftdev.com Download and References
www.prequelsolutions.com mnischalke@prequelsolutions.com