Skip to content

Commit a09ed62

Browse files
authored
Edit pass Solutions guidance (SharePoint#1803)
* Updates to TOC and edit pass Search * Edit pass * Edit pass of Search doc * Fixes * Edit pass * Fixes * Edit pass Transform farms * Edit pass * Edit pass Replace content types * Edit pass * Edit Replace files * Fixes * Edit pass * Edit pass * Edit Replace lists * Edit pass * Edit pass * Edit pass on Transform sandboxes * Edit pass * Edit pass * Edit pass * Transform sandbox and farms * Adjusted table spacing * Adjusted table spacing 2
1 parent 09a2b7d commit a09ed62

13 files changed

+1217
-1189
lines changed
Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
11
---
22
title: Sandbox solution transformation guidance - Event receivers
3-
ms.date: 11/03/2017
3+
description: Identify options and strategies for replacing existing event receivers from your sandbox solutions.
4+
ms.date: 5/4/2018
45
---
5-
# Sandbox solution transformation guidance - Event receivers
6-
This article will help you to identify options and strategies on replacing existing event receivers from your sandbox solutions.
76

8-
_**Applies to:** Add-ins for SharePoint | SharePoint 2013 | SharePoint 2016 | SharePoint Online_
7+
# Sandbox solution transformation guidance - Event receivers
98

10-
Code-based sandbox solutions [were deprecated](https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/) back in 2014 and SharePoint online has started the process to completely remove this capability. Code-based sandbox solutions are also deprecated in SharePoint 2013 and in SharePoint 2016.
9+
The approach you take to handle events in SharePoint is slightly different in the SharePoint Add-in model than it was with Full Trust Code or in coded-sandbox solutions. In typical previous solutions, event receivers were created using the SharePoint Server-Side Object Model and deployed via solutions packages, which executed the code on the SharePoint servers.
1110

12-
## Summary
11+
In the SharePoint Add-in model, however, the event receiver implementation executes on the web server that is hosting the event receiver; these are called remote event receivers (RERs). Event receivers can in many cases be replaced with a remote event receiver implementation.
1312

14-
The approach you take to handle events in SharePoint is slightly different in the SharePoint Add-in model than it was with Full Trust Code or in coded-sandbox solutions. In typical previous solutions, event receivers were created using the SharePoint Server Side Object Model and deployed via solutions packages, which executes the code on the SharePoint servers. In the SharePoint Add-in model; however, the event receiver implementation executes on the web server that is hosting the event receiver and these are called Remote Event Receivers (RER). Event receivers can in many cases be replaced with a remote event receiver implementation. This article describes various options and design considerations.
13+
This article describes various options and design considerations.
1514

15+
> [!NOTE]
16+
> [Code-based sandbox solutions were deprecated](https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/) in 2014, and SharePoint Online has started the process to completely remove this capability. Code-based sandbox solutions are also deprecated in SharePoint 2013 and in SharePoint 2016.
1617
17-
## Options for replacing Event Receivers
18-
<a name="sectionSection2"> </a>
18+
## Options for replacing event receivers
1919

20-
|**Approach**|**Additional Information**|
20+
|Approach|More information|
2121
|:-----|:-----|
22-
|Remote Event Receiver|</p><lu><li>[Use remote event receivers in SharePoint](https://msdn.microsoft.com/en-us/pnp_articles/use-remote-event-receivers-in-sharepoint)</li><li>[How to use remote event receivers for your SharePoint add-ins](https://channel9.msdn.com/blogs/OfficeDevPnP/How-to-use-remote-event-receivers-for-your-SharePoint-add-ins)</li><li>[Event receivers and list event receivers in the SharePoint Add-in model](https://msdn.microsoft.com/en-us/pnp_articles/event-receiver-and-list-event-receiver-sharepoint-add-in)</li></lu><li>[Auto tagging sample add-in for SharePoint](https://msdn.microsoft.com/en-us/pnp_articles/autotagging-sample-app-for-sharepoint)</li><li>[Handle events in SharePoint Add-ins](https://msdn.microsoft.com/en-us/library/office/jj220048.aspx)</li></lu></p>|
23-
|WebHooks|<p>WebHooks for SharePoint are still under development and will be available for preview soon.<lu><li>[Introducing SharePoint WebHooks](http://dev.office.com/blogs/introducing-sharepoint-webhooks)</li></p>
24-
|Remote Timer Job to monitor changes|<p>Use the **ChangeQuery** object to monitor a site or list for modifications. This pattern is an alternative to Remote Event Receivers<lu><li>[SharePoint List Item Change Monitor](https://github.com/SharePoint/PnP/tree/master/Samples/Core.ListItemChangeMonitor)</li><li>[Remote Timer Job Pattern](https://github.com/SharePoint/PnP/tree/master/Samples/Core.SimpleTimerJob)</p>|
25-
26-
## Design Considerations
27-
### Remote Event Receivers
28-
- Requires hosting infrastructure
29-
- Hosting infrastructure must be highly available
30-
- The service endpoint that hosts the remote event receiver must be configured for anonymous authentication
31-
- Requires a trusted 3rd Party certificate if you are using SharePoint Online
32-
- Not intended for long running operations
33-
- Remote Event Receivers that are attached out-side the context of add-in, attached using a console application or PowerShell; will not receive a SharePoint context token when invoked and you must differ to app-only permissions or use the SharePointOnlineCredentials class
34-
- There is no retry mechanism
35-
36-
### WebHooks
37-
- Requires hosting infrastructure
38-
- Hosting infrastructure must be highly available
39-
- Does not support synchronous events
40-
- Process changes after the event has occurred
41-
- Public preview available in summer 2016 for SharePoint Online
22+
|Remote event receiver|<ul><li>[Use remote event receivers in SharePoint](use-remote-event-receivers-in-sharepoint.md)</li><li>[How to use remote event receivers for your SharePoint Add-ins](https://channel9.msdn.com/blogs/OfficeDevPnP/How-to-use-remote-event-receivers-for-your-SharePoint-add-ins)</li><li>[Event receivers and list event receivers in the SharePoint Add-in model](event-receiver-and-list-event-receiver-sharepoint-add-in.md)</li><li>[Auto-tagging sample SharePoint Add-in](autotagging-sample-app-for-sharepoint.md)</li><li>[Handle events in SharePoint Add-ins](../sp-add-ins/handle-events-in-sharepoint-add-ins.md)</li></ul>|
23+
|Webhooks|<ul><li>[Overview of SharePoint webhooks](/apis/webhooks/overview-sharepoint-webhooks)</li><li>[Introducing SharePoint Webhooks](https://dev.office.com/blogs/introducing-sharepoint-webhooks)</li></ul>
24+
|Remote timer job to monitor changes|<p>Use the **ChangeQuery** object to monitor a site or list for modifications. This pattern is an alternative to remote event receivers.<ul><li>[SharePoint List Item Change Monitor](https://github.com/SharePoint/PnP/tree/master/Samples/Core.ListItemChangeMonitor)</li><li>[Remote Timer Job Pattern](https://github.com/SharePoint/PnP/tree/master/Samples/Core.SimpleTimerJob)</ul></p>|
25+
26+
## Design considerations
27+
28+
### Remote event receivers
29+
30+
- Require hosting infrastructure.
31+
- Hosting infrastructure must be highly available.
32+
- The service endpoint that hosts the remote event receiver must be configured for anonymous authentication.
33+
- Requires a trusted third-party certificate if you are using SharePoint Online.
34+
- Not intended for long running operations.
35+
- Remote event receivers that are attached outside the context of add-ins, attached by using a console application or PowerShell will not receive a SharePoint context token when invoked, and you must defer to add-in-only permissions or use the SharePointOnlineCredentials class.
36+
- There is no retry mechanism.
37+
38+
### Webhooks
39+
40+
- Require hosting infrastructure.
41+
- Hosting infrastructure must be highly available.
42+
- Does not support synchronous events.
43+
- Process changes after the event has occurred.
4244
- Not available in SharePoint on-premises builds at this time.
4345

44-
### Remote Timer Job
45-
- Requires hosting infrastructure
46-
- Process changes after the event has occurred
47-
- Uses a polling mechanism to process changes
46+
### Remote timer job
47+
48+
- Requires hosting infrastructure.
49+
- Process changes after the event has occurred.
50+
- Uses a polling mechanism to process changes.
4851

4952
## Removing your sandbox code from your site
50-
<a name="sectionSection3"></a>
51-
When you deactivate your existing sandbox solution from your sites, any assets or files deployed using declarative options will not be removed however, the features in the sandbox solution will automatically be deactivated and the event receiver(s) will be removed.
53+
54+
When you deactivate your existing sandbox solution from your sites, any assets or files deployed by using declarative options are not removed. However, the features in the sandbox solution are automatically deactivated and the event receiver is removed.
5255

5356
## See also
54-
<a name="bk_addresources"> </a>
55-
- [Removing Code-Based Sandbox Solutions in SharePoint Online](http://dev.office.com/blogs/removing-code-based-sandbox-solutions-in-sharepoint-online)
56-
- [Sandbox solution transformation guidance](https://msdn.microsoft.com/en-us/pnp_articles/sandbox-solution-transformation-guidance)
57-
- [Remove assembly reference from your Sandbox solution created in Visual Studio](https://support.microsoft.com/en-us/kb/3183084)
58-
- [Build add-ins for SharePoint](https://msdn.microsoft.com/library/office/fp179930.aspx)
59-
- [Office 365 development and SharePoint patterns and practices solution guidance](https://msdn.microsoft.com/en-us/pnp_articles/office-365-development-patterns-and-practices-solution-guidance)
57+
58+
- [Transform sandbox solutions to the SharePoint Add-in model](sandbox-solution-transformation-guidance.md)
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
---
22
title: Sandbox solution transformation guidance - Feature receivers
3-
ms.date: 11/03/2017
3+
description: Learn about the options and strategies of converting existing functionality to SharePoint Add-in model or alternative solutions.
4+
ms.date: 5/4/2018
45
---
5-
# Sandbox solution transformation guidance - Feature receivers
6-
Transform or convert your code-based sandbox solutions to the SharePoint Add-in model. Learn about the options and strategies of converting existing functionality to SharePoint Add-in model or alternative solutions.
7-
8-
_**Applies to:** Add-ins for SharePoint | SharePoint 2013 | SharePoint 2016 | SharePoint Online_
96

7+
# Sandbox solution transformation guidance - Feature receivers
108

11-
## Summary
129
Feature receivers are typically used to apply different kind of configurations or settings to SharePoint sites when feature is activated or when site is created (if feature associated to site template / web template). Feature receivers have been deployed using Sandbox solutions in the SharePoint Online, but since code-based customizations cannot no logner be used, alternative design will need to be taken.
1310

1411
The approach you take to handle feature receivers in SharePoint is slightly different in the SharePoint Add-in model than it was with Full Trust Code or in coded-sandbox solutions. You will need to re-design the solution in away that you use remote APIs (CSOM/REST) to apply the needed configurations to your sites, which previously existed in the feature receiver(s).
1512

13+
> [!NOTE]
14+
> [Code-based sandbox solutions were deprecated](https://blogs.msdn.microsoft.com/sharepointdev/2014/01/14/deprecation-of-custom-code-in-sandboxed-solutions/) in 2014, and SharePoint Online has started the process to completely remove this capability. Code-based sandbox solutions are also deprecated in SharePoint 2013 and in SharePoint 2016.
1615
17-
## Options for replacing Feature Receivers
18-
<a name="sectionSection2"> </a>
16+
## Options for replacing feature receivers
1917

2018
|**Approach**|**Additional Information**|
2119
|:-----|:-----|
2220
|PowerShell based customizations|<p>You use PowerShell scripts to provision new site collections (and potentially sub sites) where needed customizations are applied using remote APIs. Typically this is done by using CSOM/REST directly in the PowerShell scripts or by using PnP PowerShell commands, which provides easy way to modify sites and content remotely.</p><p><lu><li>[PnP provisioning engine](https://github.com/SharePoint/PnP-PowerShell)</li><li>[PnP PowerShell - Getting started with latest updates](http://dev.office.com/blogs/pnp-powershell-getting-started-with-latest-updates)</li></lu></p>|
2321
|Code based customizations|<p>You can apply the needed customizations also using managed code with remote APIs. This means that you will either apply them as part of the administrative operation when the site is created or you apply customizations to SharePoint, which will hook in your code to be part of the UI elements, like by overiding the sub site creation logic, so that you can associate customizations as part of the provisioning logic.</p><p><lu><li>[Remote provisioning pattern for sub site creation](https://channel9.msdn.com/blogs/OfficeDevPnP/Using-remote-provisioning-pattern-for-sub-site-creation)</li><li>[PnP CSOM Core Component](https://github.com/SharePoint/PnP-sites-core)</li></lu></p>|
2422

25-
## Design Considerations
26-
### PowerShell based provisioning
23+
## Design considerations
24+
25+
### PowerShell-based provisioning
26+
2727
This model works great if your site provisioning model is based on administrative actions.
2828
- Does require script to be executed which applies needed customizations to created sites
2929
- Can be combined to site creation process, if performed by as administrative operation
3030
- Does not require hosting infrastructure
3131
- No way to combine automatically as part of the sub site creation process
3232

33-
### Code based provisioning
33+
### Code-based provisioning
34+
3435
- Can require hosting infrastructure, if combined with end user operations
3536
- You can use managed code which is executed anywhere using CSOM/REST APIs for the needed operations
3637
- Can be used to integrate to SharePoint by overriding sub site creation link
3738
- You can automate site collection and subsite provisioning using remote APIs
3839

39-
> If you want to provide automatic way to apply needed remote code as part of the sub site creation logic, you'll need to override sub site link using user custom actions. This option is only availale in sites, which are using classic mode around libraries and lists.
40-
40+
If you want to provide an automatic way to apply needed remote code as part of the sub site creation logic, you'll need to override sub site link using user custom actions. This option is only availale in sites, which are using classic mode around libraries and lists.
4141

4242
## Reference approaches
43+
4344
### Applying needed customizations to sites using PowerShell
4445
Here's a simple script which is using PnP PowerShell to upload a theme color file from computer to SharePoint Online and activates that in SharePoint site.
4546

46-
> This sample is using [PnP PowerShell](https://github.com/SharePoint/PnP-PowerShell), which provides more than 150 additional PowerShell cmdlets targeted for site configuration and asset management.
47-
48-
```postscript
47+
This sample uses [PnP PowerShell](https://github.com/SharePoint/PnP-PowerShell), which provides more than 150 additional PowerShell cmdlets targeted for site configuration and asset management.
4948

49+
```powershell
5050
Connect-SPOnline –Url https://yoursite.sharepoint.com/ –Credentials (Get-Credential)
5151
Add-SPOFile -Path c:\temp\company.spcolor -Folder /_catalogs/theme/15/
5252
Set-SPOTheme -ColorPaletteUrl /_catalogs/theme/15/company.spcolor
53-
5453
```
5554

5655
### Applying needed customizations to sites using code
56+
5757
Here's a simple code piece which uses SharePoint Online CSOM to activate custom theme by first uploading the assets to SharePoint site and then activating custom theme.
5858

59-
> This sample is using [PnP CSOM Core Component](https://github.com/SharePoint/PnP-sites-core), which extends the native out-of-the-box operations by introducing additional set of extension methods for common operations. You can perform similar operations also by using native CSOM, but code would be significantly more complex.
59+
This sample is using [PnP CSOM Core Component](https://github.com/SharePoint/PnP-sites-core), which extends the native out-of-the-box operations by introducing additional set of extension methods for common operations. You can perform similar operations also by using native CSOM, but code would be significantly more complex.
6060

6161
```csharp
6262

@@ -85,15 +85,14 @@ web.SetComposedLookByUrl("Green");
8585
When you are using code based approaches, we recommend using [PnP provisioning engine](http://dev.office.com/blogs/sharepoint-pnp-remote-provisioning-engine-august-2016) for the template management, which will dramatically simplify the development efforts.
8686

8787
## Removing sandbox solution containing feature receiver code from your site
88-
<a name="sectionSection3"> </a>
88+
8989
If your sandbox solution contains feature receivers logic for feature deactivation and it's important that those are being executed, before code-based support is completely removed, you should ensure that these kind of features are deactivated before the code-based support is disabled from SharePoint Online. You can uninstall sandbox solutions from SharePoint Online after the code-based support is disabled, but your faeture receiver code would not be executed even though features are getting moved from the site.
9090

91-
When you deactivate your existing sandbox solution from your sites, any assets or files deployed using declarative options will not be removed however, the feature will automatically be deactivated. Execution of the code in the feature receiver, is dependent on the timing when the sandbox solution is deactivated.
91+
When you deactivate your existing sandbox solution from your sites, any assets or files deployed by using declarative options are not removed. However, the features in the sandbox solution are automatically deactivated and the event receiver is removed.
9292

9393

9494
## See also
95-
<a name="bk_addresources"> </a>
96-
- [Removing Code-Based Sandbox Solutions in SharePoint Online](http://dev.office.com/blogs/removing-code-based-sandbox-solutions-in-sharepoint-online)
97-
- [Sandbox solution transformation guidance](https://msdn.microsoft.com/en-us/pnp_articles/sandbox-solution-transformation-guidance)
98-
- [PnP PowerShell](https://github.com/SharePoint/PnP-PowerShell/blob/master/README.md) - Script based customizations
99-
- [PnP CSOM Core training](https://blogs.msdn.microsoft.com/vesku/2016/04/12/office-dev-pnp-core-componenttraining-package/) - For code based options
95+
96+
- [PnP PowerShell](https://github.com/SharePoint/PnP-PowerShell/blob/master/README.md) - Script based customizations
97+
- [PnP CSOM Core training](https://blogs.msdn.microsoft.com/vesku/2016/04/12/office-dev-pnp-core-componenttraining-package/) - For code based options
98+
- [Transform sandbox solutions to the SharePoint Add-in model](sandbox-solution-transformation-guidance.md)

0 commit comments

Comments
 (0)