Developing With Data Technologies<br />Chakkaradeep Chandran<br />http://www.chakkaradeep.com<br />@chakkaradeep<br />
Session Objectives and Takeaway<br />Session Objectives:<br />Explain SharePoint Data Technologies<br />Present the new Li...
SharePoint 2010 for Developers<br />Visual Studio 2010<br />Install on Windows 7<br />SharePoint Designer 2010<br />Develo...
Overview of Data Technologies<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm...
List Data Improvements in SharePoint 2010<br />
Lists and Lookups<br />Lookup<br />Lookup<br />Projects<br />Employees<br />Clients<br />m<br />1<br />m<br />1<br />Looku...
List Relationships<br />Enforce Data Integrity<br />One-to-many relationships can be used to:<br />Trigger cascade delete<...
List Validation<br />Validation Formula can be specified on List and Columns<br />=[Column1]-[Column2]<br />=AND([Column1]...
Large Lists<br />Set a limit for how many rows of data can be retrieved for a list or library at any one time:<br />List V...
List View Threshold<br />
List Data Model<br />Lookup to Multiple Columns<br />List Relationships<br />Related Items UI<br />List Validation<br />
Summary : List Data Improvements<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />F...
Server Object<br />Model<br />
Building Server Applications<br />.aspx.cs<br />Server OM<br />SharePoint data<br />SharePoint data<br />Classes & Objects...
Server Object Model Example Code<br />Using Microsoft.SharePoint;<br />List&lt;Announcement&gt; announcements = new List&l...
LINQ to SharePoint<br />(SPLinq)<br />
LINQ to SharePoint<br />Entity based programming<br />Strong Types and Intellisense<br />Translates LINQ queries to CAML q...
LINQ to SharePoint Basics<br />spmetal.exe<br />SPLinq.cs<br />SPLinq.vb<br />spmetal/web:http://dataetch/code:SPLinq.cs<b...
SPMetal Options<br />
LINQ to SharePoint<br />
SPMetal – Default Code Generation Rules<br />spmetal.exe<br />SPLinqDataContext<br />Project<br />Projects<br />Class<br /...
SPMetal Parameters XML File<br />SPMetal does not require a parameters XML file<br />To include or exclude a different set...
LINQ to SharePoint: Parameters XML File<br />
Summary : LINQ to SharePoint<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<...
Client ObjectModel<br />
Building Client Applications – MOSS 2007<br />{code}<br />Web Services<br />{SharePoint  data}<br />SharePoint Site<br />S...
Client Object Model – SharePoint 2010<br />{code}<br />{SharePoint data}<br />Client Object Model<br />{SharePoint data}<b...
Client Object Model Example Code<br />class ClientOM<br />{ <br />using Microsoft.SharePoint.Client;<br />	static void Mai...
Client OM<br />
Client Object Model – How It Works<br />WCF Service<br />(Client.svc)<br />JavaScript Application<br />Server OM<br />JSON...
Client Object Model – How It Works<br />Client Application<br />Server<br />Sequence of commands:<br />command 1;<br />com...
ClientContextclientContext= new ClientContext(&quot;http://sptechcon&quot;);<br />List list= clientContext.Web.Lists.GetBy...
Client Object Model – The Pattern<br />Create a Client Connection<br />Create the Query<br />Execute the Query<br />Client...
Client Object Model – Trimming the Results<br />Title<br />Property<br />Web<br />SharePoint Site<br />Lists<br />Collecti...
.NET CLR Client Object Model<br />Requires two assemblies:<br />Microsoft.SharePoint.Client<br />Microsoft.SharePoint.Clie...
.NET Client OM<br />Using CAML Query<br />Object Identity<br />Trimming The Results<br />Creating and Populating a List<br...
Silverlight CLR Client Object Model<br />Requires two assemblies:<br />Microsoft.SharePoint.Client.Silverlight<br />Micros...
Silverlight Client OM<br />
JavaScript Client Object Model<br />Minified .js files for the ECMAScript (JavaScript, JScript) object model:<br />SP.js<b...
JavaScript Client OM<br />
Summary : Client Object Model<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm...
RESTful Data ServiceInterface<br />
RESTful Data Service Interface<br />REST-style list data web service<br />http://&lt;site&gt;/_vti_bin/ListData.svc<br />W...
REST API QueryString Parameters<br />$filter={simple predicate}<br />$expand={Entity}<br />$orderby={property}<br />$skip=...
Makes Development Easy!<br />
Accessing List Data via REST APIs<br />
Summary<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List D...
Thank You<br />chaks@intergen.co.nz<br />http://www.chakkaradeep.com/category/SharePoint-2010.aspx<br />http://twitter.com...
Upcoming SlideShare
Loading in...5
×

Developing With Data Technologies

2,897

Published on

SharePoint 2010 opens up a wide range of options for developers, and this session will take you through the new SharePoint list Data Model Capabilities; LINQ to SharePoint; Client Object Model and RESTful Data Service Interface for SharePoint.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,897
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Here is an overall view of the SharePoint data technologies platform. Developers can make use of these technologies to build SharePoint applications. SharePoint 2010 introduces more additions to the already available SharePoint 2007 technologies.Explain the client side and server side framework:Client OMREST APIsSPLINQ
  • Microsoft SharePoint Foundation offers a highly structured server-side object model that makes it easy to access objects that represent the various aspects of a SharePoint Web site. From higher-level objects, you can drill down through the object hierarchy to obtain the object that contains the members you need to use in your code.
  • Sample custom application: You may want to create custom .aspx pages and Web applications and store them in a location that is accessible from all Web sites in your Microsoft SharePoint Foundation 2010 deploymentDeveloper writes code (.aspx.cs) using the Server OMServer OM interacts with the SharePoint site, retrieves the data from the SharePoint siteThe .aspx page displays the SharePoint data
  • Transcript of "Developing With Data Technologies"

    1. 1. Developing With Data Technologies<br />Chakkaradeep Chandran<br />http://www.chakkaradeep.com<br />@chakkaradeep<br />
    2. 2. Session Objectives and Takeaway<br />Session Objectives:<br />Explain SharePoint Data Technologies<br />Present the new List Platform Capabilities<br />Demonstrate how to interact with SharePoint data using:<br />LINQ to SharePoint<br />Client Object Model<br />.NET CLR<br />Silverlight CLR<br />JavaScript CLR<br />RESTful Data Service Interface<br />Takeaway:<br />Building applications using the various SharePoint 2020 Data Technologies<br />
    3. 3. SharePoint 2010 for Developers<br />Visual Studio 2010<br />Install on Windows 7<br />SharePoint Designer 2010<br />Developer Dashboard<br />Developer Productivity<br />Business Connectivity Services <br />LINQ, REST and Data Improvements<br />Client Object Model<br />Silverlight Web Part<br />ECMAScript Object Model (JavaScript,JSCript)<br />Rich Platform Services<br />Team Foundation Server<br />Sandboxed Solutions<br />WSP Solution Upgrade<br />SharePoint Online<br />Flexible Deployment<br />
    4. 4. Overview of Data Technologies<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List Data<br />External Lists<br />LINQ<br />(spmetal.exe)<br />ServerOM<br />
    5. 5. List Data Improvements in SharePoint 2010<br />
    6. 6. Lists and Lookups<br />Lookup<br />Lookup<br />Projects<br />Employees<br />Clients<br />m<br />1<br />m<br />1<br />Lookups form relationships between lists<br />One-to-many<br />Many-to-many<br />
    7. 7. List Relationships<br />Enforce Data Integrity<br />One-to-many relationships can be used to:<br />Trigger cascade delete<br />Restrict delete<br />Relationship behaviors (delete/restrict) are not supported on multi-value lookups<br />
    8. 8. List Validation<br />Validation Formula can be specified on List and Columns<br />=[Column1]-[Column2]<br />=AND([Column1]&gt;[Column2], [Column1]&lt;[Column3])<br />=PRODUCT([Column1],[Column2],2)<br />=DATEDIF([Column1], [Column2],&quot;d&quot;)<br />=CONCATENATE([Column2], &quot;,&quot;, [Column1])<br />
    9. 9. Large Lists<br />Set a limit for how many rows of data can be retrieved for a list or library at any one time:<br />List View Threshold<br />List View Threshold for Auditors and Administrators<br />List View Lookup Threshold<br />Daily Time Window for Large Queries<br />If enabled on the Web Application, developer can turn off throttling using:<br />SPQuery.RequestThrottleOverride<br />SPSiteDataQuery.RequestThrottleOverride<br />
    10. 10. List View Threshold<br />
    11. 11. List Data Model<br />Lookup to Multiple Columns<br />List Relationships<br />Related Items UI<br />List Validation<br />
    12. 12. Summary : List Data Improvements<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List Data<br />External Lists<br />LINQ<br />(spmetal.exe)<br />ServerOM<br />
    13. 13. Server Object<br />Model<br />
    14. 14. Building Server Applications<br />.aspx.cs<br />Server OM<br />SharePoint data<br />SharePoint data<br />Classes & Objects<br />SharePoint Site<br />
    15. 15. Server Object Model Example Code<br />Using Microsoft.SharePoint;<br />List&lt;Announcement&gt; announcements = new List&lt;Announcement&gt;(); <br />SPSitesite = SPContext.GetContext(HttpContext.Current).Site; <br />using (SPWebcurWeb = site.OpenWeb()) <br />{ <br />SPListlstAnnouncements = <br />curWeb.Lists[new Guid(LibraryName)];   <br />//rest of the code <br />}<br />
    16. 16. LINQ to SharePoint<br />(SPLinq)<br />
    17. 17. LINQ to SharePoint<br />Entity based programming<br />Strong Types and Intellisense<br />Translates LINQ queries to CAML queries<br />Supports List Joins and Projections<br />Join lists on lookup field between them<br />Join multiple lists (A-&gt;B-&gt;C)<br />Project any field from joined list in a query without changes in list schema<br />Can be used in<br />Web Parts<br />Event Receivers<br />Sandboxed Code<br />
    18. 18. LINQ to SharePoint Basics<br />spmetal.exe<br />SPLinq.cs<br />SPLinq.vb<br />spmetal/web:http://dataetch/code:SPLinq.cs<br />SharePoint Site<br />http://datatech<br />SPLinqDataContext<br />SPLinqDataContext dc = new SPLinqDataContext (“http://datatech”);<br />var q=dc.Employees.Where(emp=&gt;emp.DueDate &lt; DateTime.Now.AddMonths(6));<br />from o in data.Orderswhere o.Customer.City.Name == “San Francisco“select o;<br />
    19. 19. SPMetal Options<br />
    20. 20. LINQ to SharePoint<br />
    21. 21. SPMetal – Default Code Generation Rules<br />spmetal.exe<br />SPLinqDataContext<br />Project<br />Projects<br />Class<br />Property<br />GetProjects<br />
    22. 22. SPMetal Parameters XML File<br />SPMetal does not require a parameters XML file<br />To include or exclude a different set of lists and columns from the default<br />&lt;?xmlversion=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;WebAccessModifier=&quot;Internal&quot; xmlns=&quot;http://schemas.microsoft.com/SharePoint/2009/spmetal&quot;&gt;<br />&lt;ContentTypeName=&quot;Contact&quot; Class=&quot;Contact&quot;&gt;<br /> &lt;ColumnName=&quot;ContId&quot; Member=&quot;ContactId&quot; /&gt;<br /> &lt;ColumnName=&quot;ContactName&quot; Member=&quot;ContactName1&quot; /&gt;<br /> &lt;ColumnName=&quot;Category&quot; Member=&quot;Cat&quot; Type=&quot;String&quot;/&gt;<br /> &lt;ExcludeColumnName=&quot;HomeTelephone&quot; /&gt;<br />&lt;/ContentType&gt;<br />&lt;ExcludeContentTypeName=&quot;Order&quot;/&gt;<br />&lt;ListName=”Team Members” Type=”TeamMember”&gt;<br /> &lt;ContentTypeName=”Item” Class=”TeamMember” /&gt;<br />&lt;/List&gt;<br />&lt;/Web&gt;<br />
    23. 23. LINQ to SharePoint: Parameters XML File<br />
    24. 24. Summary : LINQ to SharePoint<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List Data<br />External Lists<br />LINQ<br />(spmetal.exe)<br />ServerOM<br />
    25. 25. Client ObjectModel<br />
    26. 26. Building Client Applications – MOSS 2007<br />{code}<br />Web Services<br />{SharePoint data}<br />SharePoint Site<br />SharePoint API<br />{SharePoint data}<br />
    27. 27. Client Object Model – SharePoint 2010<br />{code}<br />{SharePoint data}<br />Client Object Model<br />{SharePoint data}<br />SharePoint Site<br />
    28. 28. Client Object Model Example Code<br />class ClientOM<br />{ <br />using Microsoft.SharePoint.Client;<br /> static void Main() <br />{ <br />ClientContextclientContext=<br /> new ClientContext(&quot;http://datatech&quot;); <br /> Web oWebsite = clientContext.Web; <br />clientContext.Load(oWebsite); <br />clientContext.ExecuteQuery();<br />Console.WriteLine(oWebsite.Title); <br />} <br />}<br />
    29. 29. Client OM<br />
    30. 30. Client Object Model – How It Works<br />WCF Service<br />(Client.svc)<br />JavaScript Application<br />Server OM<br />JSON Response<br />JavaScript OM<br />SharePoint Site<br />XML Request<br />Proxy<br />XML Request<br />Proxy<br />JSON Response<br />Managed OM<br />Managed Code Application (.NET)<br />
    31. 31. Client Object Model – How It Works<br />Client Application<br />Server<br />Sequence of commands:<br />command 1;<br />command 2;<br />command 3;<br />context.ExecuteQuery();<br />client.svc<br />Execute commands<br />in the batch:<br />command 1;<br />command 2;<br />command 3;<br />Send results back<br />XML<br />JSON<br />Process results<br />
    32. 32. ClientContextclientContext= new ClientContext(&quot;http://sptechcon&quot;);<br />List list= clientContext.Web.Lists.GetByTitle(“Workshops&quot;);<br />CamlQuerycamlQuery = new CamlQuery();<br />camlQuery.ViewXml= &quot;&lt;View/&gt;&quot;;<br />ListItemCollectionlistItems= list.GetItems(camlQuery);<br />clientContext.Load(list);<br />clientContext.Load(listItems);<br />clientContext.ExecuteQuery();<br />foreach(ListItemlistItem in listItems)<br />   Console.WriteLine(&quot;Id: {0} Title: {1}&quot;, listItem.Id,listItem[&quot;Title&quot;]);<br />Client Object Model – Object Identity<br />
    33. 33. Client Object Model – The Pattern<br />Create a Client Connection<br />Create the Query<br />Execute the Query<br />ClientContextclientContext = new ClientContext(&quot;http://datatech&quot;);<br />clientContext.ExecuteQuery();<br />List list = clientContext.Web.Lists.GetByTitle(“Projects&quot;);<br />clientContext.Load(list);<br />
    34. 34. Client Object Model – Trimming the Results<br />Title<br />Property<br />Web<br />SharePoint Site<br />Lists<br />Collection<br />Title<br />Property<br />Id<br />Property<br />
    35. 35. .NET CLR Client Object Model<br />Requires two assemblies:<br />Microsoft.SharePoint.Client<br />Microsoft.SharePoint.Client.Runtime<br />Develop solutions remotely<br />
    36. 36. .NET Client OM<br />Using CAML Query<br />Object Identity<br />Trimming The Results<br />Creating and Populating a List<br />Updating Client Objects<br />Deleting Client Objects<br />Asynchronous Pattern<br />
    37. 37. Silverlight CLR Client Object Model<br />Requires two assemblies:<br />Microsoft.SharePoint.Client.Silverlight<br />Microsoft.SharePoint.Client.Silverlight.Runtime<br />Develop solutions remotely<br />
    38. 38. Silverlight Client OM<br />
    39. 39. JavaScript Client Object Model<br />Minified .js files for the ECMAScript (JavaScript, JScript) object model:<br />SP.js<br />SP.Core.js<br />SP.Ribbon.js<br />SP.Runtime.js<br />Browser Support for ECMA Script:<br />Microsoft Internet Explorer 7 and greater<br />Firefox 3.5 and greater<br />Safari 4.0 and greater<br />Develop solutions remotely<br />
    40. 40. JavaScript Client OM<br />
    41. 41. Summary : Client Object Model<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List Data<br />External Lists<br />LINQ<br />(spmetal.exe)<br />ServerOM<br />
    42. 42. RESTful Data ServiceInterface<br />
    43. 43. RESTful Data Service Interface<br />REST-style list data web service<br />http://&lt;site&gt;/_vti_bin/ListData.svc<br />Work with data via REST<br />SharePoint List Data<br />Powered by ADO.NET Data Services<br />ADO.NET Data Services v1.5 CTP2<br />Entity based programming<br />Strong Types<br />LINQ Queries<br />Integration with Visual Studio<br />
    44. 44. REST API QueryString Parameters<br />$filter={simple predicate}<br />$expand={Entity}<br />$orderby={property}<br />$skip=n<br />$top=n<br />$metadata<br />Full List - http://bit.ly/RESTfulAPI<br />
    45. 45. Makes Development Easy!<br />
    46. 46. Accessing List Data via REST APIs<br />
    47. 47. Summary<br />REST APIs<br />Client OM<br />Client Side<br />Data Platform<br />Server Side<br />Farm<br />Site<br />List Data<br />External Lists<br />LINQ<br />(spmetal.exe)<br />ServerOM<br />
    48. 48. Thank You<br />chaks@intergen.co.nz<br />http://www.chakkaradeep.com/category/SharePoint-2010.aspx<br />http://twitter.com/chakkaradeep<br />

    ×