29
Kamal Pandey Client Object Model & REST Improvements in SharePoint 2013

Comsharepoint2013pdf

Embed Size (px)

DESCRIPTION

SharePoint 2013

Citation preview

Page 1: Comsharepoint2013pdf

Kamal Pandey

Client Object Model & REST

Improvements in SharePoint 2013

Page 2: Comsharepoint2013pdf

Who Am I? SharePoint Archtecte at L&T InfoTech LTD (New Yrok City , NY)

Microsoft Certified Trainer (MCT) since 2011.

MCSE SharePoint 2013

MCITP SharePoint Admin 2010, MCPD SharePoint Developer 2010 & MCTS SharePoint 2010 Configuration & Development

MCTS WSS 3.0, SharePoint Server 2007, MCITP, MCTS Project Server 2007 & 2010, MCTS Project Professional 2007 & 2010, MCPD.NET, MCSD.NET MCAD.NET

Email: [email protected]

Page 3: Comsharepoint2013pdf

Agenda

REST

Summary

Overview Client OM Intro

Q & A DEMO

Page 4: Comsharepoint2013pdf

CSOM in 2010

Page 5: Comsharepoint2013pdf

CSOM in SharePoint 2010

Issues with CSOM • No Direct Access to

client.svc Web Service

• Must use a Proxy or

Supported End Points

• Supports .NET Silverlight & JavaScript

Managed OM – Is Easy

Silverlight OM? – Is Easy

JavaScript OM? – Is Not

Easy

Page 6: Comsharepoint2013pdf

C

SharePoint 2010 CSOM Architecture

Silverlight

Library

.NET CLR

Library

JavaScript

Library

/_vti_bin/client.svc

Execute Query

Server

Client

Custom Client Code

Page 7: Comsharepoint2013pdf

How CSOM works

Page 8: Comsharepoint2013pdf

CSOM Changes in 2013

Page 9: Comsharepoint2013pdf

Changes in SharePoint 2013

Client.svc with REST Clients

• Direct Access to client.svc Web Service

• Access HTTP GET, PUT, Merge, POST

Requests

• OData Implementation

• Writing Code from NON Microsoft Apps

• New APIs for Server Functionality

• API for Windows Phone Development

For More Information http://tinyurl.com/SP2013Odata

Page 10: Comsharepoint2013pdf

New CSOM API Support

E-Discovery

Taxonomy Search

Workflow Sharing

User

Profiles

Analytics

Publishing Feeds

IRM Business

Data

Lists

Support both Server Side code and REST

Page 11: Comsharepoint2013pdf

C

SharePoint 2013 CSOM Architecture

Silverlight

Library

.NET CLR

Library

JavaScript

Library

_api

Execute Query

Server

Client

OData

Custom Client Code

Page 12: Comsharepoint2013pdf

Changes in SharePoint 2013 CSOM

• Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.RunTime.dll • Available in SharePoint Foundation • contains the core classes

Page 13: Comsharepoint2013pdf

Demo Managed Client OM

Page 14: Comsharepoint2013pdf

Demo JavaScript Client OM

Page 15: Comsharepoint2013pdf

REST Overview

Page 16: Comsharepoint2013pdf

What’s REST and Why?

Simple and Easier to

Use • Easier than SOAP Based

WS’s

• Higher Productivity using

JavaScript and JQuery

• Results as JSON and

ATOM

• Everything is URL

• Results can be cached on

Proxy Servers.

Page 17: Comsharepoint2013pdf

REST in SharePoint 2010

Page 18: Comsharepoint2013pdf

REST in SharePoint 2013

Replace

• http://intranet/_vti_bin/client.svc/web

with

• http://intranet/_api/web/

• Lot more simple URL

• Helps in 256 Character Limit of URLs

in browser

• ListData.svc is still there for

backword compatiability

• OLD Aps will still work but needs to

be updated

Page 19: Comsharepoint2013pdf

Client OM and OData

Page 20: Comsharepoint2013pdf

What is OData?

More Information @ http://www.odata.org/

Page 21: Comsharepoint2013pdf

OData Terms and Concepts OData Described in Entity Data Model by

Collection Entity Set A Navigation Property on an entity type that identifies a collection of entities

Entry Entry type Note: May be Part of a type Hierarchy

Property of an Entry Primitive or complex Entity type property

Complex Type Complex Type

Link A Navigation Property defined on an entity type

Service Operation Function Import

Page 22: Comsharepoint2013pdf

Methods will be mapped into either OData Maps CRUD Operations to HTTP Verbs

OData Implementation Details

More Information @ http://www.odata.org/

Page 23: Comsharepoint2013pdf

URLs

Resource Path – SQL Table or Web or List

Page 24: Comsharepoint2013pdf

REST – Return ATOM XML vs. JSON

ATOM-PUB XML

• Verbose

• Easier to Read

• ACCEPT = application/atom+xml

• Condensed notation

• Smaller payload

• ACCEPT =

application/json;odata=verbose;

Page 25: Comsharepoint2013pdf

Example REST URLS

http://Intranet.consoto.com/_api/web/

http://Intranet.consoto.com/_api/web/Lists

http://Intranet.consoto.com/_api/web/Lists/getByTitle(‘Customers’)

http://Intranet.consoto.com/_api/web/getAvailableWebTemplates(lcid=1033

http://Intranet.consoto.com/_api/web/

http://intranet.consoto.com/_api/web/Lists/getByTitle(‘Customers’)/Items(0)/?$select CustomerName,CustomerId,Address

Managing Objects to Resources

Page 26: Comsharepoint2013pdf

Demo : REST in Browser

Page 27: Comsharepoint2013pdf

Summary

CSOM Now Covers More

Important for App Development

REST

Improved Syntax

Easy to Use with JavaScript than C#

Page 28: Comsharepoint2013pdf

Some Great Resources

http://msdn.microsoft.com/en-us/library/jj164060.aspx

http://msdn.microsoft.com/en-us/library/jj163201.aspx

http://msdn.microsoft.com/en-us/library/jj164022.aspx

http://msdn.microsoft.com/en-us/library/jj163800.aspx

http://msdn.microsoft.com/en-us/library/fp142385.aspx

http://msdn.microsoft.com/en-us/library/fp142380.aspx

http://msdn.microsoft.com/en-us/library/fp142386.aspx

http://msdn.microsoft.com/en-us/library/jj193034(v=office.15).aspx

http://code.msdn.microsoft.com/office/SharePoint-2013-Perform-a-1bf3e87d/view/SourceCode#content

http://msdn.microsoft.com/en-us/library/jj860569.aspx

Page 29: Comsharepoint2013pdf

Thank You