Tuesday, April 27, 2010

Working with Data in SharePoint 2010 - Part 1

Hi Folks,

I like to work with data since most of business applications are relying on consuming data from different data sources. This post is to highlight and give you the information or FAQ required to understand how to consume data in sharepoint 2010.

I had a presentation on my previous session on sharepoint saturday was talking about Data manipulation techniques in sharepoint 2010,check this url for details:
http://moustafa-arafa.blogspot.com/2010/03/sharepoint-2010-data-manipulation.html

1) How can i consume data from sharepoint 2010 ?
You can consume data in sharepoint using different ways: either using the server object model Microsoft.SharePoint.dll in the following path:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI
Or using the Client object model: Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.Runtime.dll

Note: if you are developing silverlight application, here is the path for the client object model for silverlight: microsoft.SharePoint.Client.Silverlight.dll and Microsoft.SharePoint.Silverlight.Runtime.dll
Path for the dlls:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\ClientBin


2) How Sharepoint 2010 is communicating with the client applications:
Clients are communicating in sharepoint 2010 using ADO.Net Data Services ( called also a RESTful API) that reside on the server and accept the requests from the client apps and respond to the requests in JSON objects.

3) What is the benefit of having Rest API ?
Restful API gives you flexible URLs and mutliple representation for the Data returned from the sharepoint server. Restful API is using WCF technology which supports Restful webservices starting from .NET 3.5.

Read more about Restful support in WCF in below link:
http://msdn.microsoft.com/en-us/library/dd203052.aspx

4) Which version of VS.NET IDE can i use to develop/consume restful webservices in SharePoint ?
You can use VS 2008 SP1 or VS 2010 and to add a reference to a restful webservice right click on your project and click on "Add Service Reference".

5) Why does Microsoft expose Client object model in SharePoint 2010 ?
Client Object model is a unified method across all client apps to consume sharepoint data: Silverlight Apps, Calling data from JavaScript and from .NET CLR Applications.

6) How can leverage the SharePoint data using LINQ ?
SharePoint 2010 supports LINQ out of the box, what you need to do is to use SPMETAL tool from the command prompt and point it to the required site to create stub from it and use this generated class in your application, then you are ready to use LINQ code from this generated class.

Hope this post helps in understanding working with sharepoint data.


Regards,
Mostafa arafa

No comments: