Thursday, February 13, 2014

SharePoint 2013 client object model

In this post we will discuss about  various client object model in SharePoint 2013. Also you can check out some posts on:

- Enable Sign in as Different User Option in SharePoint 2013

- Architectural changes in SharePoint 2013

- How to get userprofile properties in SharePoint 2013 object model?

In SharePoint 2013, there were 4 client object models: Managed object model, Silverlight object model, Mobile object model and JavaScript object model.

Here we will discuss about various client object model.

Silverlight object model:
By using Silverlight object model, you can build Silverlight applications, Web Parts, Asp.Net applications, apps for SharePoint and Office, and Silverlight applications for phones that use SharePoint data or SharePoint objects.

The Silverlight client object model dlls are presented inside %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin folder.

Microsoft.SharePoint.Client.Silverlight.dll

Microsoft.SharePoint.Client.Silverlight.Runtime.dll

Microsoft.SharePoint.Client.DocumentManagement.Silverlight.dll

Microsoft.SharePoint.Client.Publishing.Silverlight.dll

Microsoft.SharePoint.Client.Search.Applications.Silverlight.dll

Microsoft.SharePoint.Client.Search.Silverlight.dll

Microsoft.SharePoint.Client.Taxonomy.Silverlight.dll

Microsoft.SharePoint.Client.UserProfiles.Silverlight.dll

Microsoft.SharePoint.Client.WorkflowServices.Silverlight.dll

Microsoft.Office.Client.Policy.Silverlight.dll

Microsoft.Office.Client.TranslationServices.Silverlight.dll

So according to your rwquirement you can use the above dlls to work with silverlight application.

Example of Silverlight client object model:

In this example, we will see the item count for a list.

using (ClientContext clientContext = ClientContext.Current)
{

List objList = clientContext.Web.Lists.GetByTitle("MyList");

clientContext.Load(this.objList);

lblResultCount = this.objList.ItemCount.ToString();

}

It will show number of items in the list.

Mobile client object model:
The Mobile object model can be used to create applications that run on Windows Phones. The Mobile client-side object model contains some functionality that is specific to phones, such as APIs that enable a phone app to register for notifications from the Microsoft Push Notification Service.

The required dlls are found inside %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\LAYOUTS\ClientBin folder.

The dlls are:
Microsoft.SharePoint.Client.Phone.dll

Microsoft.SharePoint.Client.Phone.Runtime.dll

Microsoft.SharePoint.Client.DocumentManagement.Phone.dll

Microsoft.SharePoint.Client.Publishing.Phone.dll

Microsoft.SharePoint.Client.Taxonomy.Phone.dll

Microsoft.SharePoint.Client.UserProfiles.Phone.dll

Microsoft.Office.Client.Policy.Phone.dll

Microsoft.Office.Client.TranslationServices.Phone.dll

Managed client object model:
The Managed object model can be used to create .NET applications that run on Windows operating systems that aren't phones or SharePoint servers. The managed client object model dlls are found inside ISAPI folder.

Microsoft.SharePoint.Client.dll

Microsoft.SharePoint.Client.Runtime.dll

Microsoft.SharePoint.Client.ServerRuntime.dll

Microsoft.SharePoint.Client.DocumentManagement.dll

Microsoft.SharePoint.Client.Publishing.dll

Microsoft.SharePoint.Client.Search.Applications.dll

Microsoft.SharePoint.Client.Search.dll

Microsoft.SharePoint.Client.Taxonomy.dll

Microsoft.SharePoint.Client.UserProfiles.dll

Microsoft.SharePoint.Client.WorkflowServices.dll

Microsoft.Office.Client.Education.dll

Microsoft.Office.Client.Policy.dll

Microsoft.Office.Client.TranslationServices.dll

Microsoft.Office.SharePoint.ClientExtensions.dll

JavaScript client object model:
JavaScript client object model does not contain any dlls, rather it contains .js files. These .js files are located inside LAYOUTS folder and mainly functionality exists inside SP.js and SP.Core.js. The JavaScript object model can be used in inline script or in separate .js files.

2 comments: