--HG--
branch : autoroute
This commit is contained in:
randompete
2012-01-31 21:07:24 +00:00
4 changed files with 10 additions and 11 deletions

View File

@@ -6,4 +6,4 @@ a1ef39ba4e2d0cd78b3c91d6150e841793acb34b src/Orchard.Web/Modules/Orchard.Routabl
204bdef384f41bb5e463bed6b98a056945a7d839 src/Orchard.Web/Modules/Orchard.Rules
ce578373f907c0a55fd91229a344f0755f290174 src/Orchard.Web/Modules/Orchard.TaskLease
42d34730d8bb22052585ca94e3e945111aea3b9d src/Orchard.Web/Modules/Orchard.Tokens
08eadecb5e5fae52e8b4c7d1c60f29e51c63b2ca src/orchard.web/modules/Orchard.Fields
1babbc24ce7e890ec95755c992c14c9ff4ed448d src/orchard.web/modules/Orchard.Fields

View File

@@ -2,6 +2,7 @@
using System.Runtime.InteropServices;
using System.Security;
using System.Threading;
using Orchard.Environment;
using Orchard.Events;
using Orchard.Localization;
using Orchard.Logging;
@@ -11,14 +12,14 @@ using Orchard.UI.Notify;
namespace Orchard.Exceptions {
public class DefaultExceptionPolicy : IExceptionPolicy {
private readonly INotifier _notifier;
private readonly Lazy<IAuthorizer> _authorizer;
private readonly Work<IAuthorizer> _authorizer;
public DefaultExceptionPolicy() {
Logger = NullLogger.Instance;
T = NullLocalizer.Instance;
}
public DefaultExceptionPolicy(INotifier notifier, Lazy<IAuthorizer> authorizer) {
public DefaultExceptionPolicy(INotifier notifier, Work<IAuthorizer> authorizer) {
_notifier = notifier;
_authorizer = authorizer;
Logger = NullLogger.Instance;

View File

@@ -2,7 +2,6 @@
using System.Linq;
using System.ServiceModel.Activation;
using System.Web.Routing;
using Autofac;
using Orchard.Environment;
using Orchard.Environment.Configuration;
@@ -10,17 +9,17 @@ namespace Orchard.Mvc.Routes {
public class RoutePublisher : IRoutePublisher {
private readonly RouteCollection _routeCollection;
private readonly ShellSettings _shellSettings;
private readonly ILifetimeScope _shellLifetimeScope;
private readonly IWorkContextAccessor _workContextAccessor;
private readonly IRunningShellTable _runningShellTable;
public RoutePublisher(
RouteCollection routeCollection,
ShellSettings shellSettings,
ILifetimeScope shellLifetimeScope,
IWorkContextAccessor workContextAccessor,
IRunningShellTable runningShellTable) {
_routeCollection = routeCollection;
_shellSettings = shellSettings;
_shellLifetimeScope = shellLifetimeScope;
_workContextAccessor = workContextAccessor;
_runningShellTable = runningShellTable;
}
@@ -49,7 +48,7 @@ namespace Orchard.Mvc.Routes {
// new routes are added
foreach (var routeDescriptor in routesArray) {
ShellRoute shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _shellLifetimeScope, _runningShellTable);
var shellRoute = new ShellRoute(routeDescriptor.Route, _shellSettings, _workContextAccessor, _runningShellTable);
_routeCollection.Add(routeDescriptor.Name, shellRoute);
}
}

View File

@@ -4,7 +4,6 @@ using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web.SessionState;
using Autofac;
using Orchard.Environment;
using Orchard.Environment.Configuration;
using Orchard.Mvc.Extensions;
@@ -18,11 +17,11 @@ namespace Orchard.Mvc.Routes {
private readonly IRunningShellTable _runningShellTable;
private readonly UrlPrefix _urlPrefix;
public ShellRoute(RouteBase route, ShellSettings shellSettings, ILifetimeScope shellLifetimeScope, IRunningShellTable runningShellTable) {
public ShellRoute(RouteBase route, ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRunningShellTable runningShellTable) {
_route = route;
_shellSettings = shellSettings;
_runningShellTable = runningShellTable;
_workContextAccessor = shellLifetimeScope.Resolve<IWorkContextAccessor>();
_workContextAccessor = workContextAccessor;
if (!string.IsNullOrEmpty(_shellSettings.RequestUrlPrefix))
_urlPrefix = new UrlPrefix(_shellSettings.RequestUrlPrefix);