diff --git a/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs b/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs index a88627cea..a9a893640 100644 --- a/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs +++ b/src/Orchard.Core.Tests/Common/Providers/CommonAspectProviderTests.cs @@ -1,14 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using Autofac.Builder; using JetBrains.Annotations; using Moq; using NUnit.Framework; using Orchard.ContentManagement.Aspects; using Orchard.Core.Common.Models; -using Orchard.Core.Common.Providers; using Orchard.Core.Common.Records; using Orchard.ContentManagement; using Orchard.ContentManagement.Handlers; diff --git a/src/Orchard.Web/Core/Common/Providers/BodyAspectHandler.cs b/src/Orchard.Web/Core/Common/Models/BodyAspectHandler.cs similarity index 84% rename from src/Orchard.Web/Core/Common/Providers/BodyAspectHandler.cs rename to src/Orchard.Web/Core/Common/Models/BodyAspectHandler.cs index 68c368244..e0fc9738e 100644 --- a/src/Orchard.Web/Core/Common/Providers/BodyAspectHandler.cs +++ b/src/Orchard.Web/Core/Common/Models/BodyAspectHandler.cs @@ -2,10 +2,10 @@ using Orchard.Core.Common.Records; using Orchard.Data; using Orchard.ContentManagement.Handlers; -namespace Orchard.Core.Common.Providers { +namespace Orchard.Core.Common.Models { public class BodyAspectHandler : ContentHandler { public BodyAspectHandler(IRepository bodyRepository) { Filters.Add(StorageFilter.For(bodyRepository)); } } -} +} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Common/Providers/CommonAspectHandler.cs b/src/Orchard.Web/Core/Common/Models/CommonAspectHandler.cs similarity index 86% rename from src/Orchard.Web/Core/Common/Providers/CommonAspectHandler.cs rename to src/Orchard.Web/Core/Common/Models/CommonAspectHandler.cs index 2ee870249..2e386f879 100644 --- a/src/Orchard.Web/Core/Common/Providers/CommonAspectHandler.cs +++ b/src/Orchard.Web/Core/Common/Models/CommonAspectHandler.cs @@ -1,4 +1,3 @@ -using Orchard.Core.Common.Models; using Orchard.Core.Common.Records; using Orchard.Core.Common.ViewModels; using Orchard.Data; @@ -9,7 +8,7 @@ using Orchard.ContentManagement.ViewModels; using Orchard.Security; using Orchard.Services; -namespace Orchard.Core.Common.Providers { +namespace Orchard.Core.Common.Models { public class CommonAspectHandler : ContentHandler { private readonly IClock _clock; private readonly IAuthenticationService _authenticationService; @@ -119,24 +118,24 @@ namespace Orchard.Core.Common.Providers { // add handlers that will update records when aspect properties are set aspect.OwnerField.Setter(user => { - if (user == null) { - aspect.Record.OwnerId = 0; - } - else { - aspect.Record.OwnerId = user.ContentItem.Id; - } - return user; - }); + if (user == null) { + aspect.Record.OwnerId = 0; + } + else { + aspect.Record.OwnerId = user.ContentItem.Id; + } + return user; + }); aspect.ContainerField.Setter(container => { - if (container == null) { - aspect.Record.Container = null; - } - else { - aspect.Record.Container = container.ContentItem.Record; - } - return container; - }); + if (container == null) { + aspect.Record.Container = null; + } + else { + aspect.Record.Container = container.ContentItem.Record; + } + return container; + }); } diff --git a/src/Orchard.Web/Core/Common/Models/RoutableAspectHandler.cs b/src/Orchard.Web/Core/Common/Models/RoutableAspectHandler.cs index 07dd5f081..a481a1171 100644 --- a/src/Orchard.Web/Core/Common/Models/RoutableAspectHandler.cs +++ b/src/Orchard.Web/Core/Common/Models/RoutableAspectHandler.cs @@ -3,12 +3,15 @@ using JetBrains.Annotations; using Orchard.ContentManagement; using Orchard.ContentManagement.Aspects; using Orchard.ContentManagement.Handlers; +using Orchard.Core.Common.Records; +using Orchard.Data; namespace Orchard.Core.Common.Models { [UsedImplicitly] - public class RoutableAspectHandler : ContentHandler - { - public RoutableAspectHandler() { + public class RoutableAspectHandler : ContentHandler { + public RoutableAspectHandler(IRepository repository) { + Filters.Add(StorageFilter.For(repository)); + OnGetEditorViewModel((context, routable) => { var containerPathBuilder = new StringBuilder(); var container = context.ContentItem.As().Container; diff --git a/src/Orchard.Web/Core/Common/Providers/RoutableAspectHandler.cs b/src/Orchard.Web/Core/Common/Providers/RoutableAspectHandler.cs deleted file mode 100644 index 844848503..000000000 --- a/src/Orchard.Web/Core/Common/Providers/RoutableAspectHandler.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Orchard.Core.Common.Records; -using Orchard.Data; -using Orchard.ContentManagement.Handlers; - -namespace Orchard.Core.Common.Providers { - public class RoutableAspectHandler : ContentHandler { - public RoutableAspectHandler(IRepository repository) { - Filters.Add(StorageFilter.For(repository)); - } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Core/Orchard.Core.csproj b/src/Orchard.Web/Core/Orchard.Core.csproj index e33ff7f5c..663d68b27 100644 --- a/src/Orchard.Web/Core/Orchard.Core.csproj +++ b/src/Orchard.Web/Core/Orchard.Core.csproj @@ -71,12 +71,11 @@ - + - + -