Friday, October 17, 2014

SharePoint 2013 Client Object Model - basic understanding

SharePoint Client Object Models

Javascript (JSOM )
You have to use this model if you host your client application within SharePoint server.
You have to include the SP.js file which is located in layout folder in 14 hive.
You can leverage the the power of JSOM conjunction with JQuery for dynamic content rendering on your client application.

Managed Object Model (CSOM) : Its .NET libraries and can be used in and out of SharePoint server, In this model you need to pass your credentials to talk with SharePoint.
You need to add the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies. You have locate these dlls in ISAPI folder.

Silverlight Object Model (SOM): Can be used any of the Silverlight application.
You need to add the Microsoft.SharePoint.Client.Silverlight and .Silverlight.Runtime assemblies. You have locate these dlls in layouts\ClientBin folder.
I am sure,It could be abbreviated to SOM  :)

All of the client side object has some advantage and limitation over Server side object model.
These models are just a layer to talk with SharePoint through built-in WCF service named "Client.svc".

The request from this models were sent to SharePoint through XML and the response from SharePoint will be JSON format and then it can be parsed.

SharePoint Client Object Model also supports the Anonymous and FBA (Form based Authentication).

You can also write RunWithElevated privilege equivalent in Client object model by passing the Network credential to ClientContext class.

It supports synchronous and asynchronous method calling.

In SharePoint 2013, Microsoft updates the Client Object Model to be worked on Managed Meta data,User Profile Service and Search Service application through REST API and CSOM.