Sharepoint 2010 data provider l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 36

SharePoint 2010 : Data Provider PowerPoint PPT Presentation


  • 98 Views
  • Uploaded on
  • Presentation posted in: General

SharePoint 2010 : Data Provider. The New way to connect data in SharePoint 2010. Renaud Comte [MVP] [email protected] www.wygwam.com. Wygwam Paris Wygwam Nord. Wygwam Belux. Wygwam Suisse. Session Objectives: . Overview of Data Technologies

Download Presentation

SharePoint 2010 : Data Provider

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Sharepoint 2010 data provider l.jpg

SharePoint 2010 : Data Provider

The New way to connect data in SharePoint 2010

Renaud Comte [MVP]

[email protected]


Slide2 l.jpg

www.wygwam.com

Wygwam Paris

Wygwam Nord

Wygwam Belux

Wygwam Suisse


Session objectives l.jpg

Session Objectives:

  • Overview of Data Technologies

  • Discover each SharePoint data access technology

  • Present the new List Platform capabilities

  • Demonstrate how to interact with SharePoint data using the new SharePoint APIs


Overview of data technologies l.jpg

Overview of Data Technologies

REST APIs

Strongly-typed

ClientOM

Weakly-typed

Client-side

Data Platform

Farm

Site

List Data

External Lists

ServerOM

Server-side

Weakly-typed

LINQ

Strongly-typed

New in 2010

Improved


List data improvements in sharepoint 2010 l.jpg

List Data Improvements in SharePoint 2010

List & Relationnal


Lists and lookups l.jpg

Lookups form relationships between lists

One-to-many

Many-to-many

Lists and Lookups

Projects

Employees

Clients

Lookup

Lookup

m

1

m

1


List relationships l.jpg

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


Large lists l.jpg

Large Lists

  • Set a limitfor how many rows of data can be retrieved for query before execution

    • 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


  • Slide9 l.jpg

    DEMO

    List Data Model by Code

    Lookup to Multiple Columns

    List Relationships

    Related Items UI


    Query with the server om and the client om l.jpg

    Query with the Server OM (and the Client OM)

    CAML is still here


    Caml queries 2010 main changes l.jpg

    Data engine query still use CAML

    Just for query !

    Become relationnal

    CAML Queries 2010 - Main Changes


    Slide12 l.jpg

    DEMO

    CAML 2010 in fact

    Lookup to Multiple Columns

    List Relationships

    Related Items UI


    Linq for sharepoint l.jpg

    Linq for SharePoint

    aka SPLINQ


    Linq for sharepoint aka splinq l.jpg

    Entity based programming on the server

    SPMetal Code Generation Utility

    LINQ Queries

    Strong Types

    Translates LINQ queries into CAMLqueries

    Can be used in

    Web Parts, Event Receivers, Sandboxed code(Server OM only)

    Linq for SharePoint aka SPLINQ


    Linq to sharepoint basics l.jpg

    LINQ to SharePoint Basics

    spmetal.exe

    SPLinq.cs

    SPLinq.vb

    spmetal/web:http://dataetch/code:SPLinq.cs

    SharePoint Site

    http://SPsomewhere

    SPLinqDataContext

    • SPLinqDataContext dc = new SPLinqDataContext (“http://SPsomewhere”);

    • 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;


    Linq for sharepoint aka splinq16 l.jpg

    Some details :

    Supports List Joins and Projections

    LINQ (lambda expressions, anonymous types, joins ...) can be used accross SharePoint lists

    Manage also Create/Update/Read/Delete operation

    Only "efficient" queries are supported by SPLINQ Beta 2.

    must be completed via LINQ to objects

    Change conflicts handling

    ...

    Linq for SharePoint aka SPLINQ


    Slide17 l.jpg

    DEMO

    SPLINQ live

    Simple Query

    Join Query

    Data CRUD and relational

    Sync management


    Linq to sharepoint sample original linq query l.jpg

    from p indata.Projectswhere

    p.Client.City == "Chicago"select new

    {

    Name = p.Title,

    ClientName = p.Client.Title,

    Budget = p.BudgetHours

    }

    LINQ to SharePointSample: Original LINQ query


    Linq to sharepoint g e nerated caml query l.jpg

    <Query>

    <Where>

    <And>

    <BeginsWith>

    <FieldRefName="ContentTypeId" />

    <ValueType="ContentTypeId">0x0100</Value>

    </BeginsWith>

    <Eq>

    <FieldRefName="ClientCity" />

    <ValueType="Lookup">Chicago</Value>

    </Eq>

    </And>

    </Where>

    </Query>

    <ViewFields>

    <FieldRefName="Title" />

    <FieldRefName="ClientTitle" />

    <FieldRefName="BudgetHours" />

    </ViewFields>

    <ProjectedFields>

    <FieldName="ClientTitle" Type="Lookup"

    List="Client" ShowField="Title" />

    <FieldName="ClientCity" Type="Lookup"

    List="Client" ShowField="City" />

    </ProjectedFields>

    <Joins>

    <JoinType="LEFT" ListAlias="Client">

    <!--List Name: Clients-->

    <Eq>

    <FieldRefName="Client" RefType="ID" />

    <FieldRefList="Client" Name="ID" />

    </Eq>

    </Join>

    </Joins>

    LINQ to SharePointGenerated CAML Query


    Client object model l.jpg

    Client Object Model

    JS/SL/Win OM


    Client object model21 l.jpg

    Unified object model across all clients

    JavaScript,.NETCLR,SilverlightCLR

    Subset of Server OM

    Webs, Lists, ListItems,Content Types, Fields,etc.

    Client Object Model


    Client om generally how it works l.jpg

    Client OMGenerally How It Works

    Client Application

    Server

    Sequence of commands:

    Client.svc

    command 1;

    command 2;

    command 3;

    Execute commands

    in the batch:

    XML

    command 1;

    command 2;

    command 3;

    context.ExecuteQuery();

    JSON

    Process results

    Send results back

    • Proxy to WCF

      • XML query / JSON response


    Client object model pattern l.jpg

    Client Object Model : Pattern

    • Create a Client Connection

    • Create a Client Connection

    • Execute the Query

    ClientContextclientContext = new ClientContext("http://SPdata");

    List list = clientContext.Web.Lists.GetByTitle(“Projects");

    clientContext.Load(list);

    clientContext.ExecuteQuery();


    Client object model remarks l.jpg

    Not an another OM !!!

    Simple API

    Server OM like !

    It gives you

    Effienciency,Batch processing,Productivity,...

    Still need

    Context to load / Batch to execute

    CAML to query data ...

    Client Object Model : remarks


    Restful data service interface l.jpg

    RESTful Data ServiceInterface

    Odata is coming


    Rest api l.jpg

    Work with data via Representational State Transfer (REST)

    Rss/Atom like : http://<site>/_vti_bin/ListData.svc

    SharePoint List Data

    Other Datasources

    Excel Services, Azure Cloud, ...

    Powered byWCF Data Services (ADO.NET Data Services v1.5 CTP2)

    Entity based programming

    Strong Types

    LINQ Queries

    REST API


    Slide27 l.jpg

    Framework free

    The Open Data Protocol (OData) is a Web protocol for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today

    Easy to use, not too much technology dependency

    Good for client side developpement

    Just a new protocol (Atom like)

    Open to any another technology

    Data/Url Driven

    Full Integration with Visual Studio


    Rest apis querystring parameters l.jpg

    REST APIsQueryString Parameters

    • $filter={simple predicate}

    • $expand={Entity}

    • $orderby={property}

    • $skip=n

    • $top=n

    • $metadata

    • See: http://msdn.microsoft.com/en-us/library/cc907912.aspx


    Rest apis uri map entity properties l.jpg

    REST APIsURI Map - Entity Properties

    • Syntax:

    • /_vti_bin/ListData.svc/{Entity}[({identifier})]/[{Property}]

    • Example to get budget hours for Project #4:

    • /_vit_bin/ListData.svc/Projects(4)/BudgetHours


    Rest apis uri map filter l.jpg

    REST APIsURI Map Filter

    • Syntax:

    • /_vti_bin/ListData.svc/{Entity}?$filter={simple predicate}

    • Example to get Projects for Clients in Geneva:

    • /_vit_bin/ListData.svc/Projects?$filter=Client/City eq ‘Geneva'


    Rest apis uri map expand think join l.jpg

    REST APIsURI Map – Expand (think Join)

    • Syntax:

    • /_vti_bin/ListData.svc/{Entity}?$expand={Entity}

    • Example to get a Project and its related Client:

    • /_vit_bin/ListData.svc/Projects?$expand=Client


    Slide32 l.jpg

    DEMO

    REST now …

    From a real simple client side code : jquery to ...


    Data access technologies decision matrix l.jpg

    Data Access TechnologiesDecision Matrix


    To sum up l.jpg

    SharePoint 2010 List Data Model

    Relationships, Joins, and Data Integrity

    Caml is still here but Linq also

    Client OM and Server OM

    Complete set of data APIs on both server and client side

    REST APIs and LINQ to SharePoint

    Simple and integrated developer experience for list based Data Applications

    Of course : SP2010 Data coding

    To sum up


    Thank you for your attention l.jpg

    Thank you for your Attention!

    • For more Information please contact

    • Name : Renaud Comte

      • Title : SharePoint Team Leader

      • Email : [email protected]


  • Login