Client Object Model and REST Improvements in SharePoint 2013
-
Upload
ejada -
Category
Technology
-
view
7.509 -
download
0
description
Transcript of Client Object Model and REST Improvements in SharePoint 2013
![Page 1: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/1.jpg)
Jerry YasirSharePoint Server MVP
Client Object Model & REST Improvements in SharePoint 2013
![Page 2: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/2.jpg)
Who Am I?SharePoint Server MVP Since 2010
SharePoint Practice Lead at US TECH Solutions (Jersey City, NJ)
Microsoft Certified Trainer (MCT) since 2008.
MCSE SharePoint 2013 – Waiting Results
MCITP SharePoint Admin 2010, MCPD SharePoint Developer 2010 & MCTS SharePoint 2010 Configuration & Development
MCTS WSS 3.0, SharePoint Server 2007, MCITP, MCTS Silverlight 4 Development, Project Server 2007 & 2010, MCTS Project Professional 2007 & 2010, MCPD.NET, MCSD.NET MCAD.NET
Email: [email protected],
Twitter: @jerry_yasir Facebook: yasir.attiq (Jerry Yasir)
Blog: http://jerryyasir.wordpress.com
![Page 3: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/3.jpg)
Overview – US Tech Solutions 3
Leading global consulting company, offering domain led IT Consulting services for more than 12 years .
Development centers and COE’s in the US and India. IT consultants deployed globally on various projects. Access to a unique portfolio of innovative technologies that
reduce IT project cost, timescales and risk. A large and diverse pool of resources with expertise on various
technologies and at various levels. Specially Designed Skill & Career Development Programs Technology partnerships with leading OEM’s like Microsoft, Oracle
and IBM.
©US Tech Solutions, 2012 www.ustechsolutions.com
![Page 4: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/4.jpg)
Agenda
REST
Summary
Overview
Client OM Intro
Q & ADEMO
![Page 5: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/5.jpg)
CSOM in 2010
![Page 6: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/6.jpg)
CSOM in SharePoint 2010
Everything WAS
client.svc
Issues with CSOM•No Direct Access to client.svc Web Service•Must use a Proxy or Supported End Points• Supports .NET Silverlight & JavaScript
What to Develop?Managed OM – Is EasySilverlight OM? – Is EasyJavaScript OM? – Is Not Easy
![Page 7: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/7.jpg)
C
SharePoint 2010 CSOM Architecture
Silverlight Library
.NET CLR Library
JavaScript Library
/_vti_bin/client.svc
Execute Query
Server
Client
Custom Client Code
![Page 8: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/8.jpg)
How CSOM works
![Page 9: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/9.jpg)
CSOM Changes in 2013
![Page 10: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/10.jpg)
Changes in SharePoint 2013
Extended REST Support for Client.svc
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
•New APIs for Server Functionality • API for Windows Phone Development
For More Informationhttp://tinyurl.com/SP2013Odata
![Page 11: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/11.jpg)
New CSOM API Support
E-Discovery
TaxonomySearch
Workflow
Sharing
User Profiles
Analytics
PublishingFeeds
IRMBusiness Data
Lists
Support both Server Side code and REST
![Page 12: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/12.jpg)
C
SharePoint 2013 CSOM Architecture
Silverlight Library
.NET CLR Library
JavaScript Library
_api
Execute Query
Server
Client
OData
Custom Client Code
![Page 13: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/13.jpg)
Changes in SharePoint 2013 CSOM
• Microsoft.SharePoint.Client.dll and Microsoft.SharePoint.Client.RunTime.dll• Available in SharePoint Foundation• contains the core classes
![Page 14: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/14.jpg)
DemoManaged Client OM
![Page 15: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/15.jpg)
DemoJavaScript Client OM
![Page 16: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/16.jpg)
REST Overview
![Page 17: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/17.jpg)
What’s REST and Why?
Significant Industry Momentum
Simple and Easier to Use• Easier than SOAP Based WS’s•Higher Productivity using JavaScript and JQuery• Results as JSON and ATOM
How to Query• Everything is URL• Results can be cached on Proxy Servers.
![Page 18: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/18.jpg)
REST in SharePoint 2010
ListData.svc
![Page 19: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/19.jpg)
REST in SharePoint 2013
NEW : CSOM URLS can go through /_api/folder
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 20: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/20.jpg)
Client OM and OData
![Page 21: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/21.jpg)
What is OData?
Access to Information Across Platforms
Uses HTTP Verbs Get, Put, Delete, Merge, Post
Support for all kind of Data, RD, FS, CMS or Web
Built on top of HTTP, ATOM and JSON
Web Protocol for Basic CRUD Operations on Data
Brand New Data Access API
More Information @ http://www.odata.org/
![Page 22: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/22.jpg)
OData Terms and ConceptsOData Described in Entity Data Model by
CollectionEntity SetA Navigation Property on an entity type that identifies a collection of entities
Entry Entry typeNote: 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 23: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/23.jpg)
Methods will be mapped into eitherOData Maps CRUD Operations to HTTP Verbs
OData Implementation Details
Update Mapped to PUT or MERGE
Delete Mapped to DELETE
Service Operation via POST, PUT, MERGE or Delete
Insert Mapped to POST
Read mapped to GETNavigation Operations e.g. List.getByTitle via a GET Request
More Information @ http://www.odata.org/
![Page 24: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/24.jpg)
URLsService Root URI : http://intranet.contoso.com/_api/
Resource Path – SQL Table or Web or List
Query Strings Options – $Filter, $select, $orderby
![Page 25: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/25.jpg)
REST – Return ATOM XML vs. JSON
Control data format response with ACCEPT header
ATOM-PUB XML
• Verbose• Easier to Read• ACCEPT = application/atom+xml
JSON
• Condensed notation• Smaller payload• ACCEPT = application/json;odata=verbose;
![Page 26: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/26.jpg)
Managing Objects to Resources
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
![Page 27: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/27.jpg)
Demo : REST in Browser
![Page 28: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/28.jpg)
Demo : Using Fiddler
![Page 29: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/29.jpg)
Demo : OData in Code
![Page 30: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/30.jpg)
Summary
CSOMNow Covers More Important for App Development
RESTImproved SyntaxEasy to Use with JavaScript than C#
![Page 31: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/31.jpg)
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 32: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/32.jpg)
Q & A
![Page 33: Client Object Model and REST Improvements in SharePoint 2013](https://reader033.fdocuments.us/reader033/viewer/2022061202/547a931ab4af9fda158b4b8c/html5/thumbnails/33.jpg)
Thank You