• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Developing With Data Technologies
 

Developing With Data Technologies

on

  • 4,796 views

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 ...

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.

Statistics

Views

Total Views
4,796
Views on SlideShare
4,484
Embed Views
312

Actions

Likes
0
Downloads
1
Comments
0

4 Embeds 312

http://www.chakkaradeep.com 280
http://balaonweb.blogspot.com 22
http://www.slideshare.net 8
http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

CC Attribution License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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

Developing With Data Technologies Developing With Data Technologies Presentation Transcript

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