--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-04-28 14:07:08 -07:00
27 changed files with 1210 additions and 54 deletions

View File

@@ -12,3 +12,4 @@ glob:src/Orchard.Web/Modules/Orchard.DevTools/Module.txt
glob:src/Orchard.Web/Modules/Orchard.Sandbox/Module.txt glob:src/Orchard.Web/Modules/Orchard.Sandbox/Module.txt
glob:src/Orchard.Web/Media/* glob:src/Orchard.Web/Media/*
glob:desktop.ini glob:desktop.ini
glob:src/Orchard.Azure.suo

View File

@@ -47,23 +47,11 @@ namespace Orchard.Specs.Bindings {
descriptor.EnabledFeatures.Concat(new[] { new ShellFeature { Name = name } }), descriptor.EnabledFeatures.Concat(new[] { new ShellFeature { Name = name } }),
descriptor.Parameters); descriptor.Parameters);
} }
Trace.WriteLine("This call to Host.Reinitialize should not be needed, eventually");
MvcApplication.Host.Reinitialize_Obsolete();
}); });
} }
[When(@"I cycle the app domain")]
public void WhenICycleTheAppDomain() {
var webApp = Binding<WebAppHosting>();
webApp.Host.Execute(() => {
Trace.WriteLine("This call to Host.Reinitialize should not be needed, eventually");
MvcApplication.Host.Reinitialize_Obsolete();
});
}
[Given(@"I have tenant ""(.*)\"" on ""(.*)\"" as ""(.*)\""")] [Given(@"I have tenant ""(.*)\"" on ""(.*)\"" as ""(.*)\""")]
public void GivenIHaveTenantOnSiteAsName(string shellName, string hostName, string siteName) { public void GivenIHaveTenantOnSiteAsName(string shellName, string hostName, string siteName) {
var webApp = Binding<WebAppHosting>(); var webApp = Binding<WebAppHosting>();
@@ -76,7 +64,6 @@ namespace Orchard.Specs.Bindings {
using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) { using (var environment = MvcApplication.CreateStandaloneEnvironment("Default")) {
environment.Resolve<IShellSettingsManager>().SaveSettings(shellSettings); environment.Resolve<IShellSettingsManager>().SaveSettings(shellSettings);
} }
MvcApplication.Host.Reinitialize_Obsolete();
}); });
webApp.WhenIGoToPathOnHost("Setup", hostName); webApp.WhenIGoToPathOnHost("Setup", hostName);

View File

@@ -19,6 +19,6 @@ Scenario: Edit module shows its features
Scenario: Features of installed modules are listed Scenario: Features of installed modules are listed
Given I have installed Orchard Given I have installed Orchard
When I go to "admin/modules/features" When I go to "admin/modules/features"
Then I should see "<h2>Available Features</h2>" Then I should see "<h1>Manage Features</h1>"
And I should see "<h3>Common</h3>" And I should see "<h3>Common</h3>"
And the status should be 200 OK And the status should be 200 OK

View File

@@ -102,7 +102,7 @@ this.ScenarioSetup(scenarioInfo);
#line 21 #line 21
testRunner.When("I go to \"admin/modules/features\""); testRunner.When("I go to \"admin/modules/features\"");
#line 22 #line 22
testRunner.Then("I should see \"<h2>Available Features</h2>\""); testRunner.Then("I should see \"<h1>Manage Features</h1>\"");
#line 23 #line 23
testRunner.And("I should see \"<h3>Common</h3>\""); testRunner.And("I should see \"<h3>Common</h3>\"");
#line 24 #line 24

View File

@@ -79,6 +79,6 @@ Scenario: Listing tenants from command line
Given I have installed Orchard Given I have installed Orchard
And I have installed "Orchard.MultiTenancy" And I have installed "Orchard.MultiTenancy"
And I have tenant "Alpha" on "example.org" as "New-site-name" And I have tenant "Alpha" on "example.org" as "New-site-name"
When I execute >orchard tenant list When I execute >tenant list
Then I should see "Name: Alpha" Then I should see "Name: Alpha"
And I should see "Request Url Host: example.org" And I should see "Request Url Host: example.org"

View File

@@ -8,7 +8,7 @@
// the code is regenerated. // the code is regenerated.
// </auto-generated> // </auto-generated>
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
namespace Orchard.Specs namespace Orchard.Tests
{ {
using TechTalk.SpecFlow; using TechTalk.SpecFlow;

View File

@@ -137,7 +137,7 @@ namespace Orchard.Tests.Modules.Settings.Topology {
Enumerable.Empty<ShellFeature>(), Enumerable.Empty<ShellFeature>(),
Enumerable.Empty<ShellParameter>()); Enumerable.Empty<ShellParameter>());
Assert.That(eventBus.LastMessageName, Is.EqualTo(typeof(IShellDescriptorManager).FullName + ".UpdateShellDescriptor")); Assert.That(eventBus.LastMessageName, Is.EqualTo("ShellDescriptor_Changed"));
} }
} }
} }

View File

@@ -1,7 +1,9 @@
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using Moq;
using NUnit.Framework; using NUnit.Framework;
using Orchard.Environment.Configuration; using Orchard.Environment.Configuration;
using Orchard.Events;
namespace Orchard.Tests.Environment.Configuration { namespace Orchard.Tests.Environment.Configuration {
[TestFixture] [TestFixture]
@@ -26,7 +28,7 @@ namespace Orchard.Tests.Environment.Configuration {
_appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else"); _appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else");
IShellSettingsManager loader = new ShellSettingsManager(_appData); IShellSettingsManager loader = new ShellSettingsManager(_appData, new Mock<IEventBus>().Object);
var settings = loader.LoadSettings().Single(); var settings = loader.LoadSettings().Single();
Assert.That(settings, Is.Not.Null); Assert.That(settings, Is.Not.Null);
Assert.That(settings.Name, Is.EqualTo("Default")); Assert.That(settings.Name, Is.EqualTo("Default"));
@@ -41,7 +43,7 @@ namespace Orchard.Tests.Environment.Configuration {
_appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else"); _appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else");
_appData.CreateFile("Sites\\Another\\Settings.txt", "Name: Another\r\nDataProvider: SQLite2\r\nDataConnectionString: something else2"); _appData.CreateFile("Sites\\Another\\Settings.txt", "Name: Another\r\nDataProvider: SQLite2\r\nDataConnectionString: something else2");
IShellSettingsManager loader = new ShellSettingsManager(_appData); IShellSettingsManager loader = new ShellSettingsManager(_appData, new Mock<IEventBus>().Object);
var settings = loader.LoadSettings(); var settings = loader.LoadSettings();
Assert.That(settings.Count(), Is.EqualTo(2)); Assert.That(settings.Count(), Is.EqualTo(2));
@@ -59,8 +61,8 @@ namespace Orchard.Tests.Environment.Configuration {
[Test] [Test]
public void NewSettingsCanBeStored() { public void NewSettingsCanBeStored() {
_appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else"); _appData.CreateFile("Sites\\Default\\Settings.txt", "Name: Default\r\nDataProvider: SQLite\r\nDataConnectionString: something else");
IShellSettingsManager loader = new ShellSettingsManager(_appData); IShellSettingsManager loader = new ShellSettingsManager(_appData, new Mock<IEventBus>().Object);
var foo = new ShellSettings {Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux"}; var foo = new ShellSettings {Name = "Foo", DataProvider = "Bar", DataConnectionString = "Quux"};
Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1)); Assert.That(loader.LoadSettings().Count(), Is.EqualTo(1));

View File

@@ -7,6 +7,7 @@ using System.Web.Mvc;
using System.Web.Routing; using System.Web.Routing;
using Autofac; using Autofac;
using Autofac.Integration.Web; using Autofac.Integration.Web;
using Moq;
using NUnit.Framework; using NUnit.Framework;
using Orchard.Environment; using Orchard.Environment;
using Orchard.Environment.Configuration; using Orchard.Environment.Configuration;
@@ -87,15 +88,15 @@ namespace Orchard.Tests.Mvc.Routes {
var routeC = new Route("quux", new MvcRouteHandler()); var routeC = new Route("quux", new MvcRouteHandler());
_containerA.Resolve<IRoutePublisher>().Publish( _containerA.Resolve<IRoutePublisher>().Publish(
new[] {new RouteDescriptor {Priority = 0, Route = routeA}}); new[] { new RouteDescriptor { Priority = 0, Route = routeA } });
_containerB.Resolve<IRoutePublisher>().Publish( _containerB.Resolve<IRoutePublisher>().Publish(
new[] {new RouteDescriptor {Priority = 0, Route = routeB}}); new[] { new RouteDescriptor { Priority = 0, Route = routeB } });
Assert.That(_routes.Count(), Is.EqualTo(2)); Assert.That(_routes.Count(), Is.EqualTo(2));
_containerA.Resolve<IRoutePublisher>().Publish( _containerA.Resolve<IRoutePublisher>().Publish(
new[] {new RouteDescriptor {Priority = 0, Route = routeC}}); new[] { new RouteDescriptor { Priority = 0, Route = routeC } });
Assert.That(_routes.Count(), Is.EqualTo(2)); Assert.That(_routes.Count(), Is.EqualTo(2));
@@ -110,17 +111,17 @@ namespace Orchard.Tests.Mvc.Routes {
[Test] [Test]
public void MatchingRouteToActiveShellTableWillLimitTheAbilityToMatchRoutes() { public void MatchingRouteToActiveShellTableWillLimitTheAbilityToMatchRoutes() {
var routeFoo = new Route("foo", new MvcRouteHandler()); var routeFoo = new Route("foo", new MvcRouteHandler());
_settingsA.RequestUrlHost = "a.example.com"; _settingsA.RequestUrlHost = "a.example.com";
_containerA.Resolve<IRoutePublisher>().Publish( _containerA.Resolve<IRoutePublisher>().Publish(
new[] {new RouteDescriptor {Priority = 0, Route = routeFoo}}); new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } });
_rootContainer.Resolve<IRunningShellTable>().Add(_settingsA); _rootContainer.Resolve<IRunningShellTable>().Add(_settingsA);
_settingsB.RequestUrlHost = "b.example.com"; _settingsB.RequestUrlHost = "b.example.com";
_containerB.Resolve<IRoutePublisher>().Publish( _containerB.Resolve<IRoutePublisher>().Publish(
new[] {new RouteDescriptor {Priority = 0, Route = routeFoo}}); new[] { new RouteDescriptor { Priority = 0, Route = routeFoo } });
_rootContainer.Resolve<IRunningShellTable>().Add(_settingsB); _rootContainer.Resolve<IRunningShellTable>().Add(_settingsB);
var httpContext = new StubHttpContext("~/foo"); var httpContext = new StubHttpContext("~/foo");
@@ -143,6 +144,86 @@ namespace Orchard.Tests.Mvc.Routes {
Assert.That(routeContainerProviderB.ApplicationContainer.Resolve<IRoutePublisher>(), Is.SameAs(_containerB.Resolve<IRoutePublisher>())); Assert.That(routeContainerProviderB.ApplicationContainer.Resolve<IRoutePublisher>(), Is.SameAs(_containerB.Resolve<IRoutePublisher>()));
Assert.That(routeContainerProviderB.ApplicationContainer.Resolve<IRoutePublisher>(), Is.Not.SameAs(_containerA.Resolve<IRoutePublisher>())); Assert.That(routeContainerProviderB.ApplicationContainer.Resolve<IRoutePublisher>(), Is.Not.SameAs(_containerA.Resolve<IRoutePublisher>()));
} }
[Test]
public void RequestUrlPrefixAdjustsMatchingAndPathGeneration() {
var settings = new ShellSettings { RequestUrlPrefix = "~/foo" };
var builder = new ContainerBuilder();
builder.RegisterType<ShellRoute>().InstancePerDependency();
builder.RegisterAutoMocking();
builder.Register(ctx => settings);
var container = builder.Build();
container.Mock<IRunningShellTable>()
.Setup(x => x.Match(It.IsAny<HttpContextBase>()))
.Returns(settings);
var shellRouteFactory = container.Resolve<Func<RouteBase, ShellRoute>>();
var helloRoute = shellRouteFactory(new Route(
"hello",
new RouteValueDictionary { { "controller", "foo" }, { "action", "bar" } },
new MvcRouteHandler()));
var tagsRoute = shellRouteFactory(new Route(
"tags/{tagName}",
new RouteValueDictionary { { "controller", "tags" }, { "action", "show" } },
new MvcRouteHandler()));
var defaultRoute = shellRouteFactory(new Route(
"{controller}/{action}",
new RouteValueDictionary { { "controller", "home" }, { "action", "index" } },
new MvcRouteHandler()));
var routes = new RouteCollection { helloRoute, tagsRoute, defaultRoute };
var helloRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Hello"));
Assert.That(helloRouteData, Is.Not.Null);
Assert.That(helloRouteData.Values.Count(), Is.EqualTo(2));
Assert.That(helloRouteData.GetRequiredString("controller"), Is.EqualTo("foo"));
Assert.That(helloRouteData.GetRequiredString("action"), Is.EqualTo("bar"));
var tagsRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Tags/my-tag-name"));
Assert.That(tagsRouteData, Is.Not.Null);
Assert.That(tagsRouteData.Values.Count(), Is.EqualTo(3));
Assert.That(tagsRouteData.GetRequiredString("controller"), Is.EqualTo("tags"));
Assert.That(tagsRouteData.GetRequiredString("action"), Is.EqualTo("show"));
Assert.That(tagsRouteData.GetRequiredString("tagName"), Is.EqualTo("my-tag-name"));
var defaultRouteData = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha/Beta"));
Assert.That(defaultRouteData, Is.Not.Null);
Assert.That(defaultRouteData.Values.Count(), Is.EqualTo(2));
Assert.That(defaultRouteData.GetRequiredString("controller"), Is.EqualTo("Alpha"));
Assert.That(defaultRouteData.GetRequiredString("action"), Is.EqualTo("Beta"));
var defaultRouteData2 = routes.GetRouteData(new StubHttpContext("~/Foo/Alpha"));
Assert.That(defaultRouteData2, Is.Not.Null);
Assert.That(defaultRouteData2.Values.Count(), Is.EqualTo(2));
Assert.That(defaultRouteData2.GetRequiredString("controller"), Is.EqualTo("Alpha"));
Assert.That(defaultRouteData2.GetRequiredString("action"), Is.EqualTo("index"));
var defaultRouteData3 = routes.GetRouteData(new StubHttpContext("~/Foo/"));
Assert.That(defaultRouteData3, Is.Not.Null);
Assert.That(defaultRouteData3.Values.Count(), Is.EqualTo(2));
Assert.That(defaultRouteData3.GetRequiredString("controller"), Is.EqualTo("home"));
Assert.That(defaultRouteData3.GetRequiredString("action"), Is.EqualTo("index"));
var defaultRouteData4 = routes.GetRouteData(new StubHttpContext("~/Foo"));
Assert.That(defaultRouteData4, Is.Not.Null);
Assert.That(defaultRouteData4.Values.Count(), Is.EqualTo(2));
Assert.That(defaultRouteData4.GetRequiredString("controller"), Is.EqualTo("home"));
Assert.That(defaultRouteData4.GetRequiredString("action"), Is.EqualTo("index"));
var requestContext = new RequestContext(new StubHttpContext("~/Foo/Alpha/Beta"), defaultRouteData);
var helloVirtualPath = routes.GetVirtualPath(requestContext, helloRouteData.Values);
Assert.That(helloVirtualPath, Is.Not.Null);
Assert.That(helloVirtualPath.VirtualPath, Is.EqualTo("~/foo/hello"));
var defaultVirtualPath4 = routes.GetVirtualPath(requestContext, defaultRouteData4.Values);
Assert.That(defaultVirtualPath4, Is.Not.Null);
Assert.That(defaultVirtualPath4.VirtualPath, Is.EqualTo("~/foo/"));
}
} }
} }

View File

@@ -0,0 +1,71 @@
using NUnit.Framework;
using Orchard.Mvc.Routes;
namespace Orchard.Tests.Mvc.Routes {
[TestFixture]
public class UrlPrefixTests {
[Test]
public void RemoveLeadingSegmentsOnlyMatchesFullSegment() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar"));
Assert.That(prefix.RemoveLeadingSegments("~/fooo/bar"), Is.EqualTo("~/fooo/bar"));
Assert.That(prefix.RemoveLeadingSegments("~/fo/bar"), Is.EqualTo("~/fo/bar"));
}
[Test]
public void RemoveLeadingSegmentsMayContainSlash() {
var prefix = new UrlPrefix("foo/quux");
Assert.That(prefix.RemoveLeadingSegments("~/foo/quux/bar"), Is.EqualTo("~/bar"));
Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/foo/bar"));
Assert.That(prefix.RemoveLeadingSegments("~/quux/bar"), Is.EqualTo("~/quux/bar"));
}
[Test]
public void RemoveLeadingSegmentsCanMatchEntireUrl() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.RemoveLeadingSegments("~/foo/"), Is.EqualTo("~/"));
Assert.That(prefix.RemoveLeadingSegments("~/foo"), Is.EqualTo("~/"));
}
[Test]
public void RemoveLeadingSegmentsIsCaseInsensitive() {
var prefix = new UrlPrefix("Foo");
Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar"));
Assert.That(prefix.RemoveLeadingSegments("~/FOO/BAR"), Is.EqualTo("~/BAR"));
}
[Test]
public void RemoveLeadingSegmentsIgnoreLeadingAndTrailingCharactersOnInput() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar"));
var prefix2 = new UrlPrefix("~/foo");
Assert.That(prefix2.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar"));
var prefix3 = new UrlPrefix("foo/");
Assert.That(prefix3.RemoveLeadingSegments("~/foo/bar"), Is.EqualTo("~/bar"));
}
[Test]
public void PrependLeadingSegmentsInsertsBeforeNormalVirtualPath() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar"));
}
[Test]
public void PrependLeadingSegmentsPreservesNatureOfIncomingPath() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.PrependLeadingSegments("~/bar"), Is.EqualTo("~/foo/bar"));
Assert.That(prefix.PrependLeadingSegments("/bar"), Is.EqualTo("/foo/bar"));
Assert.That(prefix.PrependLeadingSegments("bar"), Is.EqualTo("foo/bar"));
}
[Test]
public void PrependLeadingSegmentsHandlesShortUrlConditionsAppropriately() {
var prefix = new UrlPrefix("foo");
Assert.That(prefix.PrependLeadingSegments("~/"), Is.EqualTo("~/foo/"));
Assert.That(prefix.PrependLeadingSegments("/"), Is.EqualTo("/foo/"));
Assert.That(prefix.PrependLeadingSegments("~"), Is.EqualTo("~/foo/"));
Assert.That(prefix.PrependLeadingSegments(""), Is.EqualTo("foo/"));
}
}
}

View File

@@ -169,6 +169,7 @@
<Compile Include="Environment\ShellBuilders\DefaultShellContainerFactoryTests.cs" /> <Compile Include="Environment\ShellBuilders\DefaultShellContainerFactoryTests.cs" />
<Compile Include="Environment\ShellBuilders\DefaultShellContextFactoryTests.cs" /> <Compile Include="Environment\ShellBuilders\DefaultShellContextFactoryTests.cs" />
<Compile Include="Mvc\Routes\ShellRouteTests.cs" /> <Compile Include="Mvc\Routes\ShellRouteTests.cs" />
<Compile Include="Mvc\Routes\UrlPrefixTests.cs" />
<Compile Include="Utility\ContainerExtensions.cs" /> <Compile Include="Utility\ContainerExtensions.cs" />
<Compile Include="Environment\TestDependencies\TestDependency.cs" /> <Compile Include="Environment\TestDependencies\TestDependency.cs" />
<Compile Include="Environment\Topology\DefaultShellDescriptorCacheTests.cs" /> <Compile Include="Environment\Topology\DefaultShellDescriptorCacheTests.cs" />

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
@@ -25,6 +26,10 @@ namespace Orchard.Tests.Stubs {
public override HttpRequestBase Request { public override HttpRequestBase Request {
get { return new StubHttpRequest(this); } get { return new StubHttpRequest(this); }
} }
public override HttpResponseBase Response {
get { return new StubHttpResponse(this); }
}
public override IDictionary Items { public override IDictionary Items {
get { return _items; } get { return _items; }
@@ -56,7 +61,18 @@ namespace Orchard.Tests.Stubs {
?? new NameValueCollection { { "HTTP_HOST", _httpContext._hostHeader } }; ?? new NameValueCollection { { "HTTP_HOST", _httpContext._hostHeader } };
} }
} }
} }
class StubHttpResponse : HttpResponseBase {
private readonly StubHttpContext _httpContext;
public StubHttpResponse(StubHttpContext httpContext) {
_httpContext = httpContext;
}
public override string ApplyAppPathModifier(string virtualPath) {
return "~/" + virtualPath.TrimStart('/');
}
}
} }
} }

View File

@@ -86,7 +86,7 @@ namespace Orchard.Core.Settings.Topology {
} }
_eventBus.Notify( _eventBus.Notify(
typeof(IShellDescriptorManager).FullName + ".UpdateShellDescriptor", "ShellDescriptor_Changed",
null); null);
} }
} }

View File

@@ -12,20 +12,12 @@ namespace Orchard.MultiTenancy.Services {
_orchardHost = orchardHost; _orchardHost = orchardHost;
} }
#region Implementation of ITenantService
public IEnumerable<ShellSettings> GetTenants() { public IEnumerable<ShellSettings> GetTenants() {
return _shellSettingsManager.LoadSettings(); return _shellSettingsManager.LoadSettings();
} }
public void CreateTenant(ShellSettings settings) { public void CreateTenant(ShellSettings settings) {
_shellSettingsManager.SaveSettings(settings); _shellSettingsManager.SaveSettings(settings);
// MultiTenancy: This will not be needed when host listens to event bus
_orchardHost.Reinitialize_Obsolete();
} }
#endregion
} }
} }

View File

@@ -173,9 +173,6 @@ namespace Orchard.Setup.Controllers {
_shellSettingsManager.SaveSettings(shellSettings); _shellSettingsManager.SaveSettings(shellSettings);
// MultiTenancy: This will not be needed when host listens to event bus
_orchardHost.Reinitialize_Obsolete();
// redirect to the welcome page. // redirect to the welcome page.
return Redirect("~/"); return Redirect("~/");
} }

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Yaml.Serialization; using System.Yaml.Serialization;
using Orchard.Events;
using Orchard.Localization; using Orchard.Localization;
namespace Orchard.Environment.Configuration { namespace Orchard.Environment.Configuration {
@@ -13,10 +14,12 @@ namespace Orchard.Environment.Configuration {
public class ShellSettingsManager : IShellSettingsManager { public class ShellSettingsManager : IShellSettingsManager {
private readonly IAppDataFolder _appDataFolder; private readonly IAppDataFolder _appDataFolder;
private readonly IEventBus _eventBus;
Localizer T { get; set; } Localizer T { get; set; }
public ShellSettingsManager(IAppDataFolder appDataFolder) { public ShellSettingsManager(IAppDataFolder appDataFolder, IEventBus eventBus) {
_appDataFolder = appDataFolder; _appDataFolder = appDataFolder;
_eventBus = eventBus;
T = NullLocalizer.Instance; T = NullLocalizer.Instance;
} }
@@ -32,6 +35,8 @@ namespace Orchard.Environment.Configuration {
var filePath = Path.Combine(Path.Combine("Sites", settings.Name), "Settings.txt"); var filePath = Path.Combine(Path.Combine("Sites", settings.Name), "Settings.txt");
_appDataFolder.CreateFile(filePath, ComposeSettings(settings)); _appDataFolder.CreateFile(filePath, ComposeSettings(settings));
_eventBus.Notify("ShellSettings_Saved", null);
} }
IEnumerable<ShellSettings> LoadSettings() { IEnumerable<ShellSettings> LoadSettings() {

View File

@@ -1,7 +1,7 @@
using System;
using System.Linq; using System.Linq;
using System.Web.Mvc; using System.Web.Mvc;
using Autofac; using Autofac;
using Autofac.Integration.Web;
using System.Collections.Generic; using System.Collections.Generic;
using Orchard.Environment.Configuration; using Orchard.Environment.Configuration;
using Orchard.Environment.Extensions; using Orchard.Environment.Extensions;
@@ -131,5 +131,13 @@ namespace Orchard.Environment {
} }
} }
public void Process(string messageName, IDictionary<string, string> eventData) {
if (messageName == "ShellSettings_Saved") {
_current = null;
}
else if (messageName == "ShellDescriptor_Changed") {
_current = null;
}
}
} }
} }

View File

@@ -0,0 +1,23 @@
using System.Collections.Generic;
using Orchard.Events;
namespace Orchard.Environment {
/// <summary>
/// This handler forwards calls to the IOrchardHost when it is an instance of DefaultOrchardHost.
/// The reason for this is to avoid adding IEventBusHandler, because DefaultOrchardHost is a component
/// that should not be detected and registererd automatically as an IDependency.
/// </summary>
public class DefaultOrchardHostEventSink : IEventBusHandler {
private readonly DefaultOrchardHost _host;
public DefaultOrchardHostEventSink(IOrchardHost host) {
_host = host as DefaultOrchardHost;
}
public void Process(string messageName, IDictionary<string, string> eventData) {
if (_host != null) {
_host.Process(messageName, eventData);
}
}
}
}

View File

@@ -27,6 +27,5 @@ namespace Orchard.Environment {
/// Services may be resolved from within this instance to configure and initialize it's storage. /// Services may be resolved from within this instance to configure and initialize it's storage.
/// </summary> /// </summary>
IStandaloneEnvironment CreateStandaloneEnvironment(ShellSettings shellSettings); IStandaloneEnvironment CreateStandaloneEnvironment(ShellSettings shellSettings);
} }
} }

View File

@@ -1,11 +1,12 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Orchard.Logging; using Orchard.Logging;
namespace Orchard.Events { namespace Orchard.Events {
public class DefaultOrchardEventBus : IEventBus { public class DefaultOrchardEventBus : IEventBus {
private readonly IEnumerable<IEventBusHandler> _handlers; private readonly Func<IEnumerable<IEventBusHandler>> _handlers;
public DefaultOrchardEventBus(IEnumerable<IEventBusHandler> handlers) { public DefaultOrchardEventBus(Func<IEnumerable<IEventBusHandler>> handlers) {
_handlers = handlers; _handlers = handlers;
Logger = NullLogger.Instance; Logger = NullLogger.Instance;
} }
@@ -15,7 +16,7 @@ namespace Orchard.Events {
#region Implementation of IEventBus #region Implementation of IEventBus
public void Notify(string messageName, IDictionary<string, string> eventData) { public void Notify(string messageName, IDictionary<string, string> eventData) {
_handlers.Invoke(handler => handler.Process(messageName, eventData), Logger); _handlers().Invoke(handler => handler.Process(messageName, eventData), Logger);
} }
#endregion #endregion

View File

@@ -16,12 +16,15 @@ namespace Orchard.Mvc.Routes {
private readonly ShellSettings _shellSettings; private readonly ShellSettings _shellSettings;
private readonly IContainer _container; private readonly IContainer _container;
private readonly IRunningShellTable _runningShellTable; private readonly IRunningShellTable _runningShellTable;
private UrlPrefix _urlPrefix;
public ShellRoute(RouteBase route, ShellSettings shellSettings, ILifetimeScope shellLifetimeScope, IRunningShellTable runningShellTable) { public ShellRoute(RouteBase route, ShellSettings shellSettings, ILifetimeScope shellLifetimeScope, IRunningShellTable runningShellTable) {
_route = route; _route = route;
_shellSettings = shellSettings; _shellSettings = shellSettings;
_runningShellTable = runningShellTable; _runningShellTable = runningShellTable;
_container = new LifetimeScopeContainer(shellLifetimeScope); _container = new LifetimeScopeContainer(shellLifetimeScope);
if (!string.IsNullOrEmpty(_shellSettings.RequestUrlPrefix))
_urlPrefix = new UrlPrefix(_shellSettings.RequestUrlPrefix);
var routeWithArea = route as IRouteWithArea; var routeWithArea = route as IRouteWithArea;
if (routeWithArea != null) { if (routeWithArea != null) {
@@ -45,8 +48,11 @@ namespace Orchard.Mvc.Routes {
if (settings == null || settings.Name != _shellSettings.Name) if (settings == null || settings.Name != _shellSettings.Name)
return null; return null;
// route didn't match anyway var effectiveHttpContext = httpContext;
var routeData = _route.GetRouteData(httpContext); if (_urlPrefix != null)
effectiveHttpContext = new UrlPrefixAdjustedHttpContext(httpContext, _urlPrefix);
var routeData = _route.GetRouteData(effectiveHttpContext);
if (routeData == null) if (routeData == null)
return null; return null;
@@ -59,12 +65,24 @@ namespace Orchard.Mvc.Routes {
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) {
// todo - ignore conditionally // locate appropriate shell settings for request
var settings = _runningShellTable.Match(requestContext.HttpContext);
var virtualPath = _route.GetVirtualPath(requestContext, values); // only proceed if there was a match, and it was for this client
if (settings == null || settings.Name != _shellSettings.Name)
return null;
var effectiveRequestContext = requestContext;
if (_urlPrefix != null)
effectiveRequestContext = new RequestContext(new UrlPrefixAdjustedHttpContext(requestContext.HttpContext, _urlPrefix), requestContext.RouteData);
var virtualPath = _route.GetVirtualPath(effectiveRequestContext, values);
if (virtualPath == null) if (virtualPath == null)
return null; return null;
if (_urlPrefix != null)
virtualPath.VirtualPath = _urlPrefix.PrependLeadingSegments(virtualPath.VirtualPath);
return virtualPath; return virtualPath;
} }

View File

@@ -0,0 +1,56 @@
using System;
namespace Orchard.Mvc.Routes {
/// <summary>
/// Small worker class to perform path prefix adjustments
/// </summary>
public class UrlPrefix {
private readonly string _prefix;
public UrlPrefix(string prefix) {
_prefix = prefix.TrimStart('~').Trim('/');
}
public string RemoveLeadingSegments(string path) {
var beginIndex = 0;
if (path.Length > beginIndex && path[beginIndex] == '~')
++beginIndex;
if (path.Length > beginIndex && path[beginIndex] == '/')
++beginIndex;
var endIndex = beginIndex + _prefix.Length;
if (path.Length == endIndex) {
// no-op
}
else if (path.Length > endIndex && path[endIndex] == '/') {
// don't include slash after segment in result
++endIndex;
}
else {
// too short to compare - return unmodified
return path;
}
if (string.Compare(path, beginIndex, _prefix, 0, _prefix.Length, StringComparison.OrdinalIgnoreCase) == 0) {
return path.Substring(0, beginIndex) + path.Substring(endIndex);
}
return path;
}
public string PrependLeadingSegments(string path) {
if (path == "~") {
// special case for peculiar situation
return "~/" + _prefix + "/";
}
var index = 0;
if (path.Length > index && path[index] == '~')
++index;
if (path.Length > index && path[index] == '/')
++index;
return path.Substring(0, index) + _prefix + '/' + path.Substring(index);
}
}
}

View File

@@ -0,0 +1,36 @@
using System;
using System.Web;
using Orchard.Mvc.Wrappers;
namespace Orchard.Mvc.Routes {
public class UrlPrefixAdjustedHttpContext : HttpContextBaseWrapper {
private readonly UrlPrefix _prefix;
public UrlPrefixAdjustedHttpContext(HttpContextBase httpContextBase, UrlPrefix prefix)
: base(httpContextBase) {
_prefix = prefix;
}
public override HttpRequestBase Request {
get {
return new AdjustedRequest(_httpContextBase.Request, _prefix);
}
}
class AdjustedRequest : HttpRequestBaseWrapper {
private readonly UrlPrefix _prefix;
public AdjustedRequest(HttpRequestBase httpRequestBase, UrlPrefix prefix)
: base(httpRequestBase) {
_prefix = prefix;
}
public override string AppRelativeCurrentExecutionFilePath {
get {
return _prefix.RemoveLeadingSegments(_httpRequestBase.AppRelativeCurrentExecutionFilePath);
}
}
}
}
}

View File

@@ -0,0 +1,211 @@
using System;
using System.Collections;
using System.Globalization;
using System.Security.Principal;
using System.Web;
using System.Web.Caching;
using System.Web.Profile;
namespace Orchard.Mvc.Wrappers {
public abstract class HttpContextBaseWrapper : HttpContextBase {
protected readonly HttpContextBase _httpContextBase;
protected HttpContextBaseWrapper(HttpContextBase httpContextBase) {
_httpContextBase = httpContextBase;
}
public override void AddError(Exception errorInfo) {
_httpContextBase.AddError(errorInfo);
}
public override void ClearError() {
_httpContextBase.ClearError();
}
public override object GetGlobalResourceObject(string classKey, string resourceKey) {
return _httpContextBase.GetGlobalResourceObject(classKey, resourceKey);
}
public override object GetGlobalResourceObject(string classKey, string resourceKey, CultureInfo culture) {
return _httpContextBase.GetGlobalResourceObject(classKey, resourceKey, culture);
}
public override object GetLocalResourceObject(string virtualPath, string resourceKey) {
return _httpContextBase.GetLocalResourceObject(virtualPath, resourceKey);
}
public override object GetLocalResourceObject(string virtualPath, string resourceKey, CultureInfo culture) {
return _httpContextBase.GetLocalResourceObject(virtualPath, resourceKey, culture);
}
public override object GetSection(string sectionName) {
return _httpContextBase.GetSection(sectionName);
}
public override object GetService(Type serviceType) {
return ((IServiceProvider)_httpContextBase).GetService(serviceType);
}
public override void RewritePath(string path) {
_httpContextBase.RewritePath(path);
}
public override void RewritePath(string path, bool rebaseClientPath) {
_httpContextBase.RewritePath(path, rebaseClientPath);
}
public override void RewritePath(string filePath, string pathInfo, string queryString) {
_httpContextBase.RewritePath(filePath, pathInfo, queryString);
}
public override void RewritePath(string filePath, string pathInfo, string queryString, bool setClientFilePath) {
_httpContextBase.RewritePath(filePath, pathInfo, queryString, setClientFilePath);
}
public override Exception[] AllErrors {
get {
return _httpContextBase.AllErrors;
}
}
public override HttpApplicationStateBase Application {
get {
return _httpContextBase.Application;
}
}
public override HttpApplication ApplicationInstance {
get {
return _httpContextBase.ApplicationInstance;
}
set {
_httpContextBase.ApplicationInstance = value;
}
}
public override Cache Cache {
get {
return _httpContextBase.Cache;
}
}
public override IHttpHandler CurrentHandler {
get {
return _httpContextBase.CurrentHandler;
}
}
public override RequestNotification CurrentNotification {
get {
return _httpContextBase.CurrentNotification;
}
}
public override Exception Error {
get {
return _httpContextBase.Error;
}
}
public override IHttpHandler Handler {
get {
return _httpContextBase.Handler;
}
set {
_httpContextBase.Handler = value;
}
}
public override bool IsCustomErrorEnabled {
get {
return _httpContextBase.IsCustomErrorEnabled;
}
}
public override bool IsDebuggingEnabled {
get {
return _httpContextBase.IsDebuggingEnabled;
}
}
public override bool IsPostNotification {
get {
return _httpContextBase.IsDebuggingEnabled;
}
}
public override IDictionary Items {
get {
return _httpContextBase.Items;
}
}
public override IHttpHandler PreviousHandler {
get {
return _httpContextBase.PreviousHandler;
}
}
public override ProfileBase Profile {
get {
return _httpContextBase.Profile;
}
}
public override HttpRequestBase Request {
get {
return _httpContextBase.Request;
}
}
public override HttpResponseBase Response {
get {
return _httpContextBase.Response;
}
}
public override HttpServerUtilityBase Server {
get {
return _httpContextBase.Server;
}
}
public override HttpSessionStateBase Session {
get {
return _httpContextBase.Session;
}
}
public override bool SkipAuthorization {
get {
return _httpContextBase.SkipAuthorization;
}
set {
_httpContextBase.SkipAuthorization = value;
}
}
public override DateTime Timestamp {
get {
return _httpContextBase.Timestamp;
}
}
public override TraceContext Trace {
get {
return _httpContextBase.Trace;
}
}
public override IPrincipal User {
get {
return _httpContextBase.User;
}
set {
_httpContextBase.User = value;
}
}
}
}

View File

@@ -0,0 +1,287 @@
using System;
using System.Collections.Specialized;
using System.IO;
using System.Security.Principal;
using System.Text;
using System.Web;
namespace Orchard.Mvc.Wrappers {
public abstract class HttpRequestBaseWrapper : HttpRequestBase {
protected readonly HttpRequestBase _httpRequestBase;
protected HttpRequestBaseWrapper(HttpRequestBase httpRequestBase) {
_httpRequestBase = httpRequestBase;
}
public override byte[] BinaryRead(int count) {
return _httpRequestBase.BinaryRead(count);
}
public override int[] MapImageCoordinates(string imageFieldName) {
return _httpRequestBase.MapImageCoordinates(imageFieldName);
}
public override string MapPath(string virtualPath) {
return _httpRequestBase.MapPath(virtualPath);
}
public override string MapPath(string virtualPath, string baseVirtualDir, bool allowCrossAppMapping) {
return _httpRequestBase.MapPath(virtualPath, baseVirtualDir, allowCrossAppMapping);
}
public override void SaveAs(string filename, bool includeHeaders) {
_httpRequestBase.SaveAs(filename, includeHeaders);
}
public override void ValidateInput() {
_httpRequestBase.ValidateInput();
}
public override string[] AcceptTypes {
get {
return _httpRequestBase.AcceptTypes;
}
}
public override string AnonymousID {
get {
return _httpRequestBase.AnonymousID;
}
}
public override string ApplicationPath {
get {
return _httpRequestBase.ApplicationPath;
}
}
public override string AppRelativeCurrentExecutionFilePath {
get {
return _httpRequestBase.AppRelativeCurrentExecutionFilePath;
}
}
public override HttpBrowserCapabilitiesBase Browser {
get {
return _httpRequestBase.Browser;
}
}
public override HttpClientCertificate ClientCertificate {
get {
return _httpRequestBase.ClientCertificate;
}
}
public override Encoding ContentEncoding {
get {
return _httpRequestBase.ContentEncoding;
}
set {
_httpRequestBase.ContentEncoding = value;
}
}
public override int ContentLength {
get {
return _httpRequestBase.ContentLength;
}
}
public override string ContentType {
get {
return _httpRequestBase.ContentType;
}
set {
_httpRequestBase.ContentType = value;
}
}
public override HttpCookieCollection Cookies {
get {
return _httpRequestBase.Cookies;
}
}
public override string CurrentExecutionFilePath {
get {
return _httpRequestBase.CurrentExecutionFilePath;
}
}
public override string FilePath {
get {
return _httpRequestBase.FilePath;
}
}
public override HttpFileCollectionBase Files {
get {
return _httpRequestBase.Files;
}
}
public override Stream Filter {
get {
return _httpRequestBase.Filter;
}
set {
_httpRequestBase.Filter = value;
}
}
public override NameValueCollection Form {
get {
return _httpRequestBase.Form;
}
}
public override NameValueCollection Headers {
get {
return _httpRequestBase.Headers;
}
}
public override string HttpMethod {
get {
return _httpRequestBase.HttpMethod;
}
}
public override Stream InputStream {
get {
return _httpRequestBase.InputStream;
}
}
public override bool IsAuthenticated {
get {
return _httpRequestBase.IsAuthenticated;
}
}
public override bool IsLocal {
get {
return _httpRequestBase.IsLocal;
}
}
public override bool IsSecureConnection {
get {
return _httpRequestBase.IsSecureConnection;
}
}
public override string this[string key] {
get {
return _httpRequestBase[key];
}
}
public override WindowsIdentity LogonUserIdentity {
get {
return _httpRequestBase.LogonUserIdentity;
}
}
public override NameValueCollection Params {
get {
return _httpRequestBase.Params;
}
}
public override string Path {
get {
return _httpRequestBase.Path;
}
}
public override string PathInfo {
get {
return _httpRequestBase.PathInfo;
}
}
public override string PhysicalApplicationPath {
get {
return _httpRequestBase.PhysicalApplicationPath;
}
}
public override string PhysicalPath {
get {
return _httpRequestBase.PhysicalPath;
}
}
public override NameValueCollection QueryString {
get {
return _httpRequestBase.QueryString;
}
}
public override string RawUrl {
get {
return _httpRequestBase.RawUrl;
}
}
public override string RequestType {
get {
return _httpRequestBase.RequestType;
}
set {
_httpRequestBase.RequestType = value;
}
}
public override NameValueCollection ServerVariables {
get {
return _httpRequestBase.ServerVariables;
}
}
public override int TotalBytes {
get {
return _httpRequestBase.TotalBytes;
}
}
public override Uri Url {
get {
return _httpRequestBase.Url;
}
}
public override Uri UrlReferrer {
get {
return _httpRequestBase.UrlReferrer;
}
}
public override string UserAgent {
get {
return _httpRequestBase.UserAgent;
}
}
public override string UserHostAddress {
get {
return _httpRequestBase.UserHostAddress;
}
}
public override string UserHostName {
get {
return _httpRequestBase.UserHostName;
}
}
public override string[] UserLanguages {
get {
return _httpRequestBase.UserLanguages;
}
}
}
}

View File

@@ -0,0 +1,358 @@
using System;
using System.Collections;
using System.Collections.Specialized;
using System.IO;
using System.Text;
using System.Web;
using System.Web.Caching;
namespace Orchard.Mvc.Wrappers {
public abstract class HttpResponseBaseWrapper : HttpResponseBase {
private readonly HttpResponseBase _httpResponseBase;
protected HttpResponseBaseWrapper(HttpResponseBase httpResponse) {
_httpResponseBase = httpResponse;
}
public override void AddCacheDependency(params CacheDependency[] dependencies) {
_httpResponseBase.AddCacheDependency(dependencies);
}
public override void AddCacheItemDependencies(ArrayList cacheKeys) {
_httpResponseBase.AddCacheItemDependencies(cacheKeys);
}
public override void AddCacheItemDependencies(string[] cacheKeys) {
_httpResponseBase.AddCacheItemDependencies(cacheKeys);
}
public override void AddCacheItemDependency(string cacheKey) {
_httpResponseBase.AddCacheItemDependency(cacheKey);
}
public override void AddFileDependencies(string[] filenames) {
_httpResponseBase.AddFileDependencies(filenames);
}
public override void AddFileDependencies(ArrayList filenames) {
_httpResponseBase.AddFileDependencies(filenames);
}
public override void AddFileDependency(string filename) {
_httpResponseBase.AddFileDependency(filename);
}
public override void AddHeader(string name, string value) {
_httpResponseBase.AddHeader(name, value);
}
public override void AppendCookie(HttpCookie cookie) {
_httpResponseBase.AppendCookie(cookie);
}
public override void AppendHeader(string name, string value) {
_httpResponseBase.AppendHeader(name, value);
}
public override void AppendToLog(string param) {
_httpResponseBase.AppendToLog(param);
}
public override string ApplyAppPathModifier(string virtualPath) {
return _httpResponseBase.ApplyAppPathModifier(virtualPath);
}
public override void BinaryWrite(byte[] buffer) {
_httpResponseBase.BinaryWrite(buffer);
}
public override void Clear() {
_httpResponseBase.Clear();
}
public override void ClearContent() {
_httpResponseBase.ClearContent();
}
public override void ClearHeaders() {
_httpResponseBase.ClearHeaders();
}
public override void Close() {
_httpResponseBase.Close();
}
public override void DisableKernelCache() {
_httpResponseBase.DisableKernelCache();
}
public override void End() {
_httpResponseBase.End();
}
public override void Flush() {
_httpResponseBase.Flush();
}
public override void Pics(string value) {
_httpResponseBase.Pics(value);
}
public override void Redirect(string url) {
_httpResponseBase.Redirect(url);
}
public override void Redirect(string url, bool endResponse) {
_httpResponseBase.Redirect(url, endResponse);
}
public override void RemoveOutputCacheItem(string path) {
_httpResponseBase.RemoveOutputCacheItem(path);
}
public override void SetCookie(HttpCookie cookie) {
_httpResponseBase.SetCookie(cookie);
}
public override void TransmitFile(string filename) {
_httpResponseBase.TransmitFile(filename);
}
public override void TransmitFile(string filename, long offset, long length) {
_httpResponseBase.TransmitFile(filename, offset, length);
}
public override void Write(char ch) {
_httpResponseBase.Write(ch);
}
public override void Write(object obj) {
_httpResponseBase.Write(obj);
}
public override void Write(string s) {
_httpResponseBase.Write(s);
}
public override void Write(char[] buffer, int index, int count) {
_httpResponseBase.Write(buffer, index, count);
}
public override void WriteFile(string filename) {
_httpResponseBase.WriteFile(filename);
}
public override void WriteFile(string filename, bool readIntoMemory) {
_httpResponseBase.WriteFile(filename, readIntoMemory);
}
public override void WriteFile(IntPtr fileHandle, long offset, long size) {
_httpResponseBase.WriteFile(fileHandle, offset, size);
}
public override void WriteFile(string filename, long offset, long size) {
_httpResponseBase.WriteFile(filename, offset, size);
}
public override void WriteSubstitution(HttpResponseSubstitutionCallback callback) {
_httpResponseBase.WriteSubstitution(callback);
}
// Properties
public override bool Buffer {
get {
return _httpResponseBase.Buffer;
}
set {
_httpResponseBase.Buffer = value;
}
}
public override bool BufferOutput {
get {
return _httpResponseBase.BufferOutput;
}
set {
_httpResponseBase.BufferOutput = value;
}
}
public override HttpCachePolicyBase Cache {
get {
return _httpResponseBase.Cache;
}
}
public override string CacheControl {
get {
return _httpResponseBase.CacheControl;
}
set {
_httpResponseBase.CacheControl = value;
}
}
public override string Charset {
get {
return _httpResponseBase.Charset;
}
set {
_httpResponseBase.Charset = value;
}
}
public override Encoding ContentEncoding {
get {
return _httpResponseBase.ContentEncoding;
}
set {
_httpResponseBase.ContentEncoding = value;
}
}
public override string ContentType {
get {
return _httpResponseBase.ContentType;
}
set {
_httpResponseBase.ContentType = value;
}
}
public override HttpCookieCollection Cookies {
get {
return _httpResponseBase.Cookies;
}
}
public override int Expires {
get {
return _httpResponseBase.Expires;
}
set {
_httpResponseBase.Expires = value;
}
}
public override DateTime ExpiresAbsolute {
get {
return _httpResponseBase.ExpiresAbsolute;
}
set {
_httpResponseBase.ExpiresAbsolute = value;
}
}
public override Stream Filter {
get {
return _httpResponseBase.Filter;
}
set {
_httpResponseBase.Filter = value;
}
}
public override Encoding HeaderEncoding {
get {
return _httpResponseBase.HeaderEncoding;
}
set {
_httpResponseBase.HeaderEncoding = value;
}
}
public override NameValueCollection Headers {
get {
return _httpResponseBase.Headers;
}
}
public override bool IsClientConnected {
get {
return _httpResponseBase.IsClientConnected;
}
}
public override bool IsRequestBeingRedirected {
get {
return _httpResponseBase.IsRequestBeingRedirected;
}
}
public override TextWriter Output {
get {
return _httpResponseBase.Output;
}
}
public override Stream OutputStream {
get {
return _httpResponseBase.OutputStream;
}
}
public override string RedirectLocation {
get {
return _httpResponseBase.RedirectLocation;
}
set {
_httpResponseBase.RedirectLocation = value;
}
}
public override string Status {
get {
return _httpResponseBase.Status;
}
set {
_httpResponseBase.Status = value;
}
}
public override int StatusCode {
get {
return _httpResponseBase.StatusCode;
}
set {
_httpResponseBase.StatusCode = value;
}
}
public override string StatusDescription {
get {
return _httpResponseBase.StatusDescription;
}
set {
_httpResponseBase.StatusDescription = value;
}
}
public override int SubStatusCode {
get {
return _httpResponseBase.SubStatusCode;
}
set {
_httpResponseBase.SubStatusCode = value;
}
}
public override bool SuppressContent {
get {
return _httpResponseBase.SuppressContent;
}
set {
_httpResponseBase.SuppressContent = value;
}
}
public override bool TrySkipIisCustomErrors {
get {
return _httpResponseBase.TrySkipIisCustomErrors;
}
set {
_httpResponseBase.TrySkipIisCustomErrors = value;
}
}
}
}

View File

@@ -163,6 +163,7 @@
<Compile Include="Data\SessionFactoryHolder.cs" /> <Compile Include="Data\SessionFactoryHolder.cs" />
<Compile Include="Environment\AutofacUtil\LifetimeScopeContainer.cs" /> <Compile Include="Environment\AutofacUtil\LifetimeScopeContainer.cs" />
<Compile Include="Environment\Configuration\TenantState.cs" /> <Compile Include="Environment\Configuration\TenantState.cs" />
<Compile Include="Environment\DefaultOrchardHostEventSink.cs" />
<Compile Include="Environment\RunningShellTable.cs" /> <Compile Include="Environment\RunningShellTable.cs" />
<Compile Include="Environment\AutofacUtil\DynamicProxy2\DynamicProxyContext.cs" /> <Compile Include="Environment\AutofacUtil\DynamicProxy2\DynamicProxyContext.cs" />
<Compile Include="Environment\AutofacUtil\DynamicProxy2\DynamicProxyExtensions.cs" /> <Compile Include="Environment\AutofacUtil\DynamicProxy2\DynamicProxyExtensions.cs" />
@@ -197,11 +198,16 @@
<Compile Include="Mvc\Extensions\ControllerExtensions.cs" /> <Compile Include="Mvc\Extensions\ControllerExtensions.cs" />
<Compile Include="Mvc\Html\FileRegistrationContextExtensions.cs" /> <Compile Include="Mvc\Html\FileRegistrationContextExtensions.cs" />
<Compile Include="Mvc\Extensions\UrlHelperExtensions.cs" /> <Compile Include="Mvc\Extensions\UrlHelperExtensions.cs" />
<Compile Include="Mvc\Routes\UrlPrefix.cs" />
<Compile Include="Mvc\Routes\UrlPrefixAdjustedHttpContext.cs" />
<Compile Include="Mvc\Routes\ShellRoute.cs" /> <Compile Include="Mvc\Routes\ShellRoute.cs" />
<Compile Include="Mvc\ViewModels\AdaptedViewModel.cs" /> <Compile Include="Mvc\ViewModels\AdaptedViewModel.cs" />
<Compile Include="Mvc\ViewUserControl.cs"> <Compile Include="Mvc\ViewUserControl.cs">
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="Mvc\Wrappers\HttpContextBaseWrapper.cs" />
<Compile Include="Mvc\Wrappers\HttpRequestBaseWrapper.cs" />
<Compile Include="Mvc\Wrappers\HttpResponseBaseWrapper.cs" />
<Compile Include="OrchardException.cs" /> <Compile Include="OrchardException.cs" />
<Compile Include="Security\IAuthorizationServiceEvents.cs" /> <Compile Include="Security\IAuthorizationServiceEvents.cs" />
<Compile Include="Security\MembershipSettings.cs" /> <Compile Include="Security\MembershipSettings.cs" />