Presentation is loading. Please wait.

Presentation is loading. Please wait.

Using Promise Patterns with JavaScript, jQuery, and the SharePoint 2013 App Model Doug Hemminger SharePoint Solutions Architect, Protiviti.

Similar presentations


Presentation on theme: "Using Promise Patterns with JavaScript, jQuery, and the SharePoint 2013 App Model Doug Hemminger SharePoint Solutions Architect, Protiviti."— Presentation transcript:

1 Using Promise Patterns with JavaScript, jQuery, and the SharePoint 2013 App Model Doug Hemminger SharePoint Solutions Architect, Protiviti

2

3 Agenda SharePoint 2013 App Primer JavaScript “Function” Primer Asynchronous Patterns in JavaScript

4

5

6 App Shapes

7 Terminology Host Web – A SharePoint website where the app is installed and surfaced to the user. App Web – An isolated SharePoint web site on the SharePoint app domain that hosts SharePoint components used in the app

8 Hosting Architectures SharePoint Hosted – App is hosted by SharePoint Provider Hosted – App is hosted on a dedicated server either on-premises or on a third party hosting service

9

10 SharePoint-hosted Apps Runs on an isolated app domain of the SharePoint farm Authorized using the privileges of the signed in user Can only use JavaScript and HTML- No server side code

11 Provider-hosted Apps Runs on a dedicated server or hosting service (not in SharePoint) Authorization is through OAuth or the JavaScript cross-domain library Can use any language supported by the web server or hosting service

12

13 JavaScript Functions Functions are Objects in JavaScript. Essentially they are strings of JavaScript code.

14

15 Asynchronous Patterns Callbacks Events Promises

16 Callbacks A callback is a function that is passed to another function as a parameter and somehow affects the flow of execution Functions are Objects in JavaScript

17 Callback

18

19 Promises A promise represents the eventual value returned from the single completion of an operation. Three states Unfullfilled Fulfilled Rejected

20 Promises In jQuery the Promise pattern can be used with $.when(object) where object is a deferred object or a promise

21

22

23 TitleUrl Choose patterns for developing and hosting your app for SharePoint http://msdn.microsoft.com/en- us/library/office/fp179887(v=office.15).aspx Host webs, app webs, and SharePoint components in SharePoint 2013 http://msdn.microsoft.com/en- us/library/office/fp179925(v=office.15).aspx Apps for Office and SharePoint Bloghttp://blogs.msdn.com/b/officeapps/ Showcase: Contoso Incubation Search Apphttp://msdn.microsoft.com/en-US/office/dn594490 Asynchronous Programming in JavaScript with “Promises” http://blogs.msdn.com/b/ie/archive/2011/09/11/asyn chronous-programming-in-javascript-with- promises.aspx Promise Patternshttp://modernjavascript.blogspot.com/2013/09/prom ise-patterns.html Understand JavaScript callback functions and use them http://javascriptissexy.com/understand-javascript- callback-functions-and-use-them/

24 TitleUrl Understanding Callbacks in JavaScripthttp://recurial.com/programming/understanding- callback-functions-in-javascript/


Download ppt "Using Promise Patterns with JavaScript, jQuery, and the SharePoint 2013 App Model Doug Hemminger SharePoint Solutions Architect, Protiviti."

Similar presentations


Ads by Google