|
7 | 7 |
|
8 | 8 | namespace Umbraco.Web.Strategies
|
9 | 9 | {
|
| 10 | + [Obsolete("This class is no longer used and will be removed from the codebase in future versions")] |
10 | 11 | public sealed class RelateOnCopyHandler : ApplicationEventHandler
|
11 | 12 | {
|
12 |
| - protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) |
13 |
| - { |
14 |
| - ContentService.Copied += ContentServiceCopied; |
15 |
| - } |
16 |
| - |
17 |
| - private void ContentServiceCopied(IContentService sender, Core.Events.CopyEventArgs<IContent> e) |
18 |
| - { |
19 |
| - if (e.RelateToOriginal) |
20 |
| - { |
21 |
| - var relationService = ApplicationContext.Current.Services.RelationService; |
22 |
| - |
23 |
| - var relationType = relationService.GetRelationTypeByAlias(Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias); |
24 |
| - |
25 |
| - if (relationType == null) |
26 |
| - { |
27 |
| - relationType = new RelationType(new Guid(Constants.ObjectTypes.Document), |
28 |
| - new Guid(Constants.ObjectTypes.Document), |
29 |
| - Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias, |
30 |
| - Constants.Conventions.RelationTypes.RelateDocumentOnCopyName) { IsBidirectional = true }; |
31 |
| - |
32 |
| - relationService.Save(relationType); |
33 |
| - } |
34 |
| - |
35 |
| - var relation = new Relation(e.Original.Id, e.Copy.Id, relationType); |
36 |
| - relationService.Save(relation); |
37 |
| - |
38 |
| - Audit.Add(AuditTypes.Copy, |
39 |
| - string.Format("Copied content with Id: '{0}' related to original content with Id: '{1}'", |
40 |
| - e.Copy.Id, e.Original.Id), e.Copy.WriterId, e.Copy.Id); |
41 |
| - } |
| 13 | + protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) |
| 14 | + { |
42 | 15 | }
|
43 | 16 | }
|
44 | 17 | }
|
0 commit comments