SUMMARY

This chapter introduced you to the evolution of event receivers on the SharePoint platform: remote event receivers. Rather than relying on full-trust code deployed and running on the SharePoint server, remote event receivers are Web services where the URL is registered with SharePoint and called when an event fires on your specified SharePoint artifact. This provides the way for your app, which is executing remotely from SharePoint, to be called as events are transpiring or have transpired within your installed app on SharePoint.

Remote event receivers support both a server-to-server (behind the firewall) configuration for authentication or OAuth. In either case, appropriate authentication is required for your code to call back into SharePoint to perform a follow-on action. Both synchronous and asynchronous methods are provided for this in the web service.

Lastly, this chapter introduced you to the all-new events that fire during the app’s life cycle: when it is installed, upgraded, or uninstalling. These events round out the ability for your remote app to interact with SharePoint from its beginning install, during its execution, through its upgrade, and at the end of life.


EXERCISES
You can find answers to exercises in Appendix A.
1. What is the name of the asynchronous method in the remote event receiver?
2. If you want to cancel an event and provide an error message, what enumeration would you use on SPRemoteEventServiceStatus, and what property would you place the text for your message into?
3. What two primary ways can you configure authentication on SharePoint for your app to have the ability to call back into SharePoint to perform follow-on actions?
4. Where would you look in your Visual Studio project to see whether an app-level event has been identified in your app?

WHAT YOU LEARNED IN THIS CHAPTER

ITEM DESCRIPTION
Remote event receivers Web services where the URL is registered with SharePoint and called when events you identify on SharePoint artifacts are transpiring or have transpired on SharePoint.
SP remote event result The SPRemoteEventResult object is used only on the synchronous method call and is passed back to SharePoint for processing. You can modify this object prior to its return to SharePoint.
Call back to SharePoint Both synchronous and asynchronous events can call back into SharePoint using CSOM or REST for follow-on actions but either an S2S or OAuth authentication configuration must be in place.
App-level events App-level events are identified in the app manifest and registered with SharePoint to fire during the app’s lifecycle events of installed, updated, and uninstalling.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset