sharepoint 2010 data provider
Download
Skip this Video
Download Presentation
SharePoint 2010 : Data Provider

Loading in 2 Seconds...

play fullscreen
1 / 36

SharePoint 2010 : Data Provider - PowerPoint PPT Presentation


  • 125 Views
  • Uploaded on

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

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'SharePoint 2010 : Data Provider' - wallis


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
SharePoint 2010 : Data Provider

The New way to connect data in SharePoint 2010

Renaud Comte [MVP]

[email protected]

slide2

www.wygwam.com

Wygwam Paris

Wygwam Nord

Wygwam Belux

Wygwam Suisse

session objectives
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
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

lists and lookups

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

List Data Model by Code

Lookup to Multiple Columns

List Relationships

Related Items UI

slide12
DEMO

CAML 2010 in fact

Lookup to Multiple Columns

List Relationships

Related Items UI

linq for sharepoint aka splinq

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

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
DEMO

SPLINQ live

Simple Query

Join Query

Data CRUD and relational

Sync management

linq to sharepoint sample original linq query
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
<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 model21

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

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
rest api

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

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

REST now …

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

to sum up

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
Thank you for your Attention!
  • For more Information please contact
ad