Your SlideShare is downloading. ×
0
SharePoint 2013 APIs demystified
JOŠKO IVANKOV, EVISION

SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER...
sponsors
Agenda
• About SharePoint
• SharePoint APIs history
• SharePoint 2013 API overview
• What API to choose
• SharePoint Apps ...
What is SharePoint?
• It’s web & intranet platform for…
•
•
•
•
•
•
•

Collaboration
Enterprise Content Management
Search
...
Why SharePoint?
• Worldwide used product and platform
• Leading platform for ECM, BPM, BI and Social Computing
• On premis...
What is SharePoint Development?

End user
Power user

• SharePoint Configuration
• Internet Explorer
• XML, XSL, JavaScrip...
One day in life of SharePoint developer
• Server side OM
• Client side OM
• JavaScript
• Rest
• WCF (SOAP, OData)
• HTML, ...
Development overview

Client Side
• Client Object
Model
• REST
Services

Data
Platform
•
•
•
•

Farm
Sites
List data
Exter...
APIs – History: SharePoint 2007
• Server-side object model
• RPC Calls (owssrc.dll)
• ASMX Web Services (The only client s...
APIs – History: SharePoint 2010
• Server Side object model
• RPC Calls (owssrc.dll)
• ASMX Web Services
• SPServices (Comm...
APIs – SharePoint 2013
• Server Side Object Model
• RPC Calls (owssrc.dll)
• ASMX Web Services
• Client-Side Object Model ...
Sever object model
• Largest API set
• Cover all functionalities of SharePoint – both end user and
administrative
• Micros...
Sever object model - example
Server object model – remember
• Code that use SharePoint data platform (SPSite, SPWeb, SPList,
SPListItem, SPFile …) shou...
SharePoint 2013 Remote API
Architecture
Client object model for managed code
• .NET client object model
• .NET application that run on a non-phone Windows client
...
Client object model for managed code
• Silverlight client object model
• Used in Silverlight applications regardless where...
Client object model for managed code
• Mobile object model
• Special version of the Silverlight client object model for Wi...
JavaScript object model
• Inline script or separate .js files
• Includes all the same functionality as the .NET Framework ...
Client Object Model Mechanics
Changes to CSOM in SharePoint 2013
CSOM using Managed Code
CSOM using JavaScript
REST/OData endpoints
• Access SharePoint entities from client technology that do not
use JavaScript and are not built on t...
REST mechanics
REST URLs in SharePoint 2013
Mapping Objects to Resources
Testing REST Calls Through the Browser
Returning ATOM XML vs. JSON
REST Query from Managed Code
REST Query Using JavaScript & jQuery
Factors that determine which API to use
• The type of application
• SharePoint App, Web Part, Silverlight application, tim...
What API to use?
If you want to do this
• Create an ASP.NET web application that performs
create/read/update/deleted (CRUD) operations acro...
If you want to do this
• Create an ASP.NET web application that performs CRUD
operations on SharePoint data or external da...
If you want to do this
• Create a LAMP web application that performs CRUD operations
on SharePoint data or external data t...
If you want to do this
• Create a Windows Phone app that performs CRUD operations
on SharePoint data

…use these APIs
• Mo...
If you want to do this
• Create an iOS or Android app that performs CRUD operations
on SharePoint data

…use these APIs
• ...
If you want to do this
• Create a .NET Framework application that performs CRUD
operations on SharePoint data

…use these ...
If you want to do this
• Create a Silverlight application that performs CRUD operations
on SharePoint data

…use these API...
If you want to do this
• Create an HTML/JavaScript application that performs CRUD
operations on SharePoint data

…use thes...
If you want to do this
• Create an app for Office that works with SharePoint

…use these APIs
• JavaScript client object m...
If you want to do this
• Create a custom Windows PowerShell command

…use these APIs
• Server object model
If you want to do this
• Create a timer job

…use these APIs
• Server object model
If you want to do this
• Create a custom Web Part, application page, or ASP.NET user
control

…use these APIs
• Server obj...
What to chose?

SharePoint
extensions

SharePoint
Data models

Web parts

Farm Solutions

Application
Pages

Event
Handler...
What to chose?

Admin
stuff

PowerShell

Communicate with
SharePoint from
outer world

Client Object Model
SharePoint Serv...
What to chose?

.net
Applications

Silverlight
Applications

Windows
Phone
applications

JavaScript (in
SharePoint
pages)
...
SharePoint solution types with SP 2013
1

2
Farm solutions

3
Sandbox

SP Apps

Full trust solutions

Declarative elements...
apps…
• …are not executed in SharePoint App pool
• …are in most of the cases not even running on SP Server
• …can have ful...
why apps
• Isolated (safe!)
• Multi-tenant
• Multiple development possibilities (even non-MS stack)
• Easier to deploy
• E...
SP App design - a choice of three approaches

Provider-Hosted App
Cloud-based Apps

“Bring your own server hosting infrast...
Types of Apps for SharePoint
Shape

Description

Example

Immersive App
(Full Page)

App that implements a new
scenario fo...
Development environment for SharePoint
2013

• Create solutions with server side object model or develop apps
for SharePoi...
Key Takeaways
• SharePoint is leading IWS solution
• SharePoint development is complex but worthy
• Invest time in choosin...
questions?
JOSKO.IVANKOV@EVISION.HR

@JOSKOI
thank you.
SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013
ZAGREB, NOVEMBER 27-28 2013
Upcoming SlideShare
Loading in...5
×

SharePoint 2013 APIs demystified

2,910

Published on

This sessions if for everybody that always wanted to know about SharePoint development, but didn’t have anyone to ask, or didn’t have opportunity to try on their own. We’ll show how to start with SharePoint development, what API to use, when to use client API, is server side object model deprecated, how to setup development environment and more tips & tricks which are not usually mentioned.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,910
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
162
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Transcript of "SharePoint 2013 APIs demystified"

  1. 1. SharePoint 2013 APIs demystified JOŠKO IVANKOV, EVISION SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013
  2. 2. sponsors
  3. 3. Agenda • About SharePoint • SharePoint APIs history • SharePoint 2013 API overview • What API to choose • SharePoint Apps overview • SharePoint Dev environment • Key Takeaways • Q&A
  4. 4. What is SharePoint? • It’s web & intranet platform for… • • • • • • • Collaboration Enterprise Content Management Search Business Process Management (Workflows) Business Intelligence Social Computing Enterprise Application Integration • More than 50% of intranets in the world use SharePoint!!!
  5. 5. Why SharePoint? • Worldwide used product and platform • Leading platform for ECM, BPM, BI and Social Computing • On premise and Cloud ready • Standardized and widely accepted functionalities • Lot’s of Out-Of-The-Box features and platform for creating your own applications
  6. 6. What is SharePoint Development? End user Power user • SharePoint Configuration • Internet Explorer • XML, XSL, JavaScript, jQuery, UI Config • SharePoint designer Designer • Master Page, Page layout, CSS • SharePoint designer Developer • SSOM, CSOM, .NET, JS, REST • Visual Studio
  7. 7. One day in life of SharePoint developer • Server side OM • Client side OM • JavaScript • Rest • WCF (SOAP, OData) • HTML, CSS • XML, XSLT • jQuery • TypeScript • Oauth • NTLM, Kerberos • FBA authentication • Claims • InfoPath forms • Azure ACS • AppFabric Cache • Windows RT • Windows Phone • Workflow Foundation • Silverlight
  8. 8. Development overview Client Side • Client Object Model • REST Services Data Platform • • • • Farm Sites List data External lists Server side • Server Side Object Model
  9. 9. APIs – History: SharePoint 2007 • Server-side object model • RPC Calls (owssrc.dll) • ASMX Web Services (The only client side possibility) • SPServices (Community Project based on ASMX services)
  10. 10. APIs – History: SharePoint 2010 • Server Side object model • RPC Calls (owssrc.dll) • ASMX Web Services • SPServices (Community Project based on ASMX services) • ListData.svc (REST-like web service) • Client Side Object Model
  11. 11. APIs – SharePoint 2013 • Server Side Object Model • RPC Calls (owssrc.dll) • ASMX Web Services • Client-Side Object Model (extended) • New REST APIs
  12. 12. Sever object model • Largest API set • Cover all functionalities of SharePoint – both end user and administrative • Microsoft.SharePoint… namespace • Assemblies are deployed to GAC • On premises use only • Sandboxed solutions are deprecated in favor of Apps for SharePoint
  13. 13. Sever object model - example
  14. 14. Server object model – remember • Code that use SharePoint data platform (SPSite, SPWeb, SPList, SPListItem, SPFile …) should be on SharePoint server with Front End role • Use WSP – easier to deploy and maintain • Check disposing of SharePoint objects • Use it for Web Parts, Layout pages, Timer jobs, EventReceivers, custom WCF/ASMX on SharePoint server, • On premises only!!!
  15. 15. SharePoint 2013 Remote API Architecture
  16. 16. Client object model for managed code • .NET client object model • .NET application that run on a non-phone Windows client • user computer • external server • web or worker role on Windows Azure • Core classes in SSOM have corresponding classes in CSOM • SPSite -> Site • SPWeb -> Web • SPList -> List • Support for ECM, taxonomy, user profiles, publishing, search, BCS… • Lines of code are sent to the server in batches (to improve performance) • Install SharePoint client components • Namespace Microsoft.SharePoint.Client
  17. 17. Client object model for managed code • Silverlight client object model • Used in Silverlight applications regardless where the compiled .xap file is persisted • • • • Assets library on SharePoint 2013 site Client computer Cloud storage External server • Nearly identical to .NET Client object model • Difference: in Silverlight version all batches of commands are sent to the server asynchronously -> UI of the application remains active • Silverlight .xap files can be included in Apps for SharePoint
  18. 18. Client object model for managed code • Mobile object model • Special version of the Silverlight client object model for Windows Phone devices • Additional API – relevant only to telephones (push notifications…) • Supports only core SharePoint functionalities • Support for ECM, taxonomy, user profiles, publishing, search, BCS…
  19. 19. JavaScript object model • Inline script or separate .js files • Includes all the same functionality as the .NET Framework and Silverlight client object models • Batches of code always run asynchronously • Data is returned from the server in JavaScript Object Notation (JSON)
  20. 20. Client Object Model Mechanics
  21. 21. Changes to CSOM in SharePoint 2013
  22. 22. CSOM using Managed Code
  23. 23. CSOM using JavaScript
  24. 24. REST/OData endpoints • Access SharePoint entities from client technology that do not use JavaScript and are not built on the .NET Framework or Silverlight platforms • CRUD operations on SharePoint list data using OData protocol • Response: Atom or JSON format
  25. 25. REST mechanics
  26. 26. REST URLs in SharePoint 2013
  27. 27. Mapping Objects to Resources
  28. 28. Testing REST Calls Through the Browser
  29. 29. Returning ATOM XML vs. JSON
  30. 30. REST Query from Managed Code
  31. 31. REST Query Using JavaScript & jQuery
  32. 32. Factors that determine which API to use • The type of application • SharePoint App, Web Part, Silverlight application, timer job… • Your existing skill • JavaScript, ASP.NET, REST/OData, Silverlight, Windows Phone… • The device on which the code runs • Server in the SharePoint farm, external server, a client computer, mobile device…
  33. 33. What API to use?
  34. 34. If you want to do this • Create an ASP.NET web application that performs create/read/update/deleted (CRUD) operations across a firewall on SharePoint data or external data that is surfaced in SharePoint by a Microsoft Business Connectivity Services (BCS) external content type …use these APIs • JavaScript client object model
  35. 35. If you want to do this • Create an ASP.NET web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type, but does not have to call SharePoint across a firewall …use these APIs • .NET Framework client object model, Silverlight client object model, or REST/OData endpoints
  36. 36. If you want to do this • Create a LAMP web application that performs CRUD operations on SharePoint data or external data that is surfaced in SharePoint by a BCS external content type …use these APIs • REST/OData endpoints
  37. 37. If you want to do this • Create a Windows Phone app that performs CRUD operations on SharePoint data …use these APIs • Mobile client object model
  38. 38. If you want to do this • Create an iOS or Android app that performs CRUD operations on SharePoint data …use these APIs • REST/OData endpoints
  39. 39. If you want to do this • Create a .NET Framework application that performs CRUD operations on SharePoint data …use these APIs • .NET Framework client object model
  40. 40. If you want to do this • Create a Silverlight application that performs CRUD operations on SharePoint data …use these APIs • Silverlight client object model
  41. 41. If you want to do this • Create an HTML/JavaScript application that performs CRUD operations on SharePoint data …use these APIs • JavaScript client object model
  42. 42. If you want to do this • Create an app for Office that works with SharePoint …use these APIs • JavaScript client object model
  43. 43. If you want to do this • Create a custom Windows PowerShell command …use these APIs • Server object model
  44. 44. If you want to do this • Create a timer job …use these APIs • Server object model
  45. 45. If you want to do this • Create a custom Web Part, application page, or ASP.NET user control …use these APIs • Server object model
  46. 46. What to chose? SharePoint extensions SharePoint Data models Web parts Farm Solutions Application Pages Event Handlers SharePoint Business customizatio ns Connectivity Services Service Applications Timer Jobs Admin stuff SharePoint Server Side Object Model ...
  47. 47. What to chose? Admin stuff PowerShell Communicate with SharePoint from outer world Client Object Model SharePoint Server Side Object Model REST API
  48. 48. What to chose? .net Applications Silverlight Applications Windows Phone applications JavaScript (in SharePoint pages) SharePoint Apps Office Apps iOS, Android * CLR PowerShell SL WP ECMA Client Object Model SharePoint Server Side Object Model * REST API
  49. 49. SharePoint solution types with SP 2013 1 2 Farm solutions 3 Sandbox SP Apps Full trust solutions Declarative elements New Apps model Customizations to file system of servers Partially trusted code service still included for limited server side support Deployed from corporate catalog or office market place Classic model from 2007 Manage permission and licenses specifically Preferred option
  50. 50. apps… • …are not executed in SharePoint App pool • …are in most of the cases not even running on SP Server • …can have full trust, with user’s approval (OAuth) • …can access SharePoint Data • …can access outer world non-SharePoint Data • …can use any external resources • …can be executed in it’s own chrome, as app parts, or as SharePoint extensions
  51. 51. why apps • Isolated (safe!) • Multi-tenant • Multiple development possibilities (even non-MS stack) • Easier to deploy • Easier to maintain (lifecycle – versioning, upgrades) • Manageable (SharePoint Marketplace, Corporate Catalog) • Cloud ready!
  52. 52. SP App design - a choice of three approaches Provider-Hosted App Cloud-based Apps “Bring your own server hosting infrastructure” Developers will need to isolate tenants Get remote events from SharePoint Use CSOM/REST + OAuth to work with SP SharePoint Web Your Hosted Site SharePoint Web Azure (from WebDeploy, DacPac) Azure Auto-Hosted App Windows Azure + SQL Azure provisioned invisibly as apps are installed SharePoint-hosted App Provision an isolated sub web on a parent web • Reuse web elements (lists, files, out-of-box web parts) • No server code allowed; use client JavaScript for logic, UX Parent Web App Web (from WSP)
  53. 53. Types of Apps for SharePoint Shape Description Example Immersive App (Full Page) App that implements a new scenario for customers Resource Tracking, Budgeting App Part Provides new parts you can add to your sites Weather, Team Mascot, News Extension App (Custom Action) Add new actions for documents and items Display Document Visualization, Print to Print Service Vendor
  54. 54. Development environment for SharePoint 2013 • Create solutions with server side object model or develop apps for SharePoint for a corporate catalog (full control permission) • VM • • • • Windows Server 2008 R2(SP1)/2012 SQL Server 2008 R2/2012 (Express/Standard/Enterprise) SharePoint 2013 Foundation/Standard/Enterprise Visual Studio 2012, SharePoint Designer 2013, Office 2013 • Create and publish apps for SharePoint • Get Office365 Developer site • NAPA / Visual Studio 2012
  55. 55. Key Takeaways • SharePoint is leading IWS solution • SharePoint development is complex but worthy • Invest time in choosing right technology and approach for SharePoint development • SharePoint Apps – be prepared for new trend • SaaS, Cloud – dominate trends in future
  56. 56. questions? JOSKO.IVANKOV@EVISION.HR @JOSKOI
  57. 57. thank you. SHAREPOINT AND PROJECT CONFERENCE ADRIATICS 2013 ZAGREB, NOVEMBER 27-28 2013
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×