diff --git a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj index 906e4428d..4599ba115 100644 --- a/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj +++ b/src/Orchard.Core.Tests/Orchard.Core.Tests.csproj @@ -59,7 +59,9 @@ False ..\..\lib\autofac\Autofac.dll - + + ..\..\lib\claysharp\ClaySharp.dll + False ..\..\lib\moq\Moq.dll diff --git a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs index 5424a2e21..bf6d0724f 100644 --- a/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs +++ b/src/Orchard.Specs/Bindings/OrchardSiteFactory.cs @@ -15,7 +15,7 @@ namespace Orchard.Specs.Bindings { webApp.GivenIHaveACleanSiteWith(TableData( new { extension = "module", names = "Orchard.Setup, Orchard.Pages, Orchard.Modules, Orchard.Packaging, Orchard.PublishLater, Orchard.Themes, Orchard.Widgets, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.jQuery, Orchard.Tags, TinyMce" }, - new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Navigation, Contents, Routable, Scheduling, Settings, Shapes, XmlRpc" }, + new { extension = "core", names = "Common, Dashboard, Feeds, HomePage, Messaging, Navigation, Contents, Routable, Scheduling, Settings, Shapes, XmlRpc" }, new { extension = "theme", names = "SafeMode, TheAdmin, TheThemeMachine" })); webApp.WhenIGoTo("Setup"); diff --git a/src/Orchard.Specs/Pages.feature b/src/Orchard.Specs/Pages.feature index d1699177c..7ad8c6712 100644 --- a/src/Orchard.Specs/Pages.feature +++ b/src/Orchard.Specs/Pages.feature @@ -3,7 +3,19 @@ As an author I want to create, publish and edit pages -Scenario: The "Page" content type is available to create from the admin menu +Scenario: In the admin (menu) there is a link to create a Page Given I have installed Orchard - When I go to "" - Then I should see "Page" \ No newline at end of file + When I go to "admin" + Then I should see "Page" + +Scenario: I can create and publish a new Page + Given I have installed Orchard + When I go to "admin/contents/create/page" + And I fill in + | name | value | + | Routable.Title | Super Duper | + | Body.Text | This is super. | + And I hit "Publish Now" + And I go to "super-duper" + Then I should see "

Super Duper

" + And I should see "This is super." \ No newline at end of file diff --git a/src/Orchard.Specs/Pages.feature.cs b/src/Orchard.Specs/Pages.feature.cs index e90de1c38..38d421857 100644 --- a/src/Orchard.Specs/Pages.feature.cs +++ b/src/Orchard.Specs/Pages.feature.cs @@ -54,18 +54,53 @@ namespace Orchard.Specs } [NUnit.Framework.TestAttribute()] - [NUnit.Framework.DescriptionAttribute("The \"Page\" content type is available to create from the admin menu")] - public virtual void ThePageContentTypeIsAvailableToCreateFromTheAdminMenu() + [NUnit.Framework.DescriptionAttribute("In the admin (menu) there is a link to create a Page")] + public virtual void InTheAdminMenuThereIsALinkToCreateAPage() { - TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The \"Page\" content type is available to create from the admin menu", ((string[])(null))); + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("In the admin (menu) there is a link to create a Page", ((string[])(null))); #line 6 this.ScenarioSetup(scenarioInfo); #line 7 testRunner.Given("I have installed Orchard"); #line 8 - testRunner.When("I go to \"\""); + testRunner.When("I go to \"admin\""); #line 9 testRunner.Then("I should see \"Page\""); +#line hidden + testRunner.CollectScenarioErrors(); + } + + [NUnit.Framework.TestAttribute()] + [NUnit.Framework.DescriptionAttribute("I can create and publish a new Page")] + public virtual void ICanCreateAndPublishANewPage() + { + TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create and publish a new Page", ((string[])(null))); +#line 11 +this.ScenarioSetup(scenarioInfo); +#line 12 + testRunner.Given("I have installed Orchard"); +#line 13 + testRunner.When("I go to \"admin/contents/create/page\""); +#line hidden + TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] { + "name", + "value"}); + table1.AddRow(new string[] { + "Routable.Title", + "Super Duper"}); + table1.AddRow(new string[] { + "Body.Text", + "This is super."}); +#line 14 + testRunner.And("I fill in", ((string)(null)), table1); +#line 18 + testRunner.And("I hit \"Publish Now\""); +#line 19 + testRunner.And("I go to \"super-duper\""); +#line 20 + testRunner.Then("I should see \"

Super Duper

\""); +#line 21 + testRunner.And("I should see \"This is super.\""); #line hidden testRunner.CollectScenarioErrors(); } diff --git a/src/Orchard.Specs/Setup.feature b/src/Orchard.Specs/Setup.feature index 2566dbbf1..4fed2e159 100644 --- a/src/Orchard.Specs/Setup.feature +++ b/src/Orchard.Specs/Setup.feature @@ -6,8 +6,8 @@ Feature: Setup Scenario: Root request shows setup form Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | - | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | + | module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce | + | core | Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Default.aspx" Then I should see "Welcome to Orchard" @@ -17,8 +17,8 @@ Scenario: Root request shows setup form Scenario: Setup folder also shows setup form Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | - | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | + | module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce | + | core | Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Setup" Then I should see "Welcome to Orchard" @@ -28,8 +28,8 @@ Scenario: Setup folder also shows setup form Scenario: Some of the initial form values are required Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.jQuery, TinyMce | - | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | + | module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce | + | core | Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode | When I go to "/Setup" And I hit "Finish Setup" @@ -39,8 +39,8 @@ Scenario: Some of the initial form values are required Scenario: Calling setup on a brand new install Given I have a clean site with | extension | names | - | module | Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce | - | core | Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.PublishLater, Scheduling, Settings, Shapes, XmlRpc | + | module | Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orchard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce | + | core | Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Scheduling, Settings, Shapes, XmlRpc | | theme | SafeMode, TheThemeMachine | And I am on "/Setup" When I fill in diff --git a/src/Orchard.Specs/Setup.feature.cs b/src/Orchard.Specs/Setup.feature.cs index f665bd830..3f77447c3 100644 --- a/src/Orchard.Specs/Setup.feature.cs +++ b/src/Orchard.Specs/Setup.feature.cs @@ -66,12 +66,12 @@ this.ScenarioSetup(scenarioInfo); "names"}); table1.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + - "hard.Themes, Orchard.jQuery, TinyMce"}); + "Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orc" + + "hard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce"}); table1.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + - "shLater, Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Sc" + + "heduling, Settings, Shapes, XmlRpc"}); table1.AddRow(new string[] { "theme", "SafeMode"}); @@ -102,12 +102,12 @@ this.ScenarioSetup(scenarioInfo); "names"}); table2.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + - "hard.Themes, Orchard.jQuery, TinyMce"}); + "Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orc" + + "hard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce"}); table2.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + - "shLater, Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Sc" + + "heduling, Settings, Shapes, XmlRpc"}); table2.AddRow(new string[] { "theme", "SafeMode"}); @@ -138,12 +138,12 @@ this.ScenarioSetup(scenarioInfo); "names"}); table3.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + - "hard.Themes, Orchard.jQuery, TinyMce"}); + "Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orc" + + "hard.PublishLater, Orchard.Themes, Orchard.jQuery, TinyMce"}); table3.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + - "shLater, Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Sc" + + "heduling, Settings, Shapes, XmlRpc"}); table3.AddRow(new string[] { "theme", "SafeMode"}); @@ -176,12 +176,13 @@ this.ScenarioSetup(scenarioInfo); "names"}); table4.AddRow(new string[] { "module", - "Orchard.Setup, Orchard.Users, Orchard.Roles, Orchard.Pages, Orchard.Comments, Orc" + - "hard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQuery, TinyMce"}); + "Orchard.Setup, Orchard.Pages, Orchard.Users, Orchard.Roles, Orchard.Comments, Orc" + + "hard.PublishLater, Orchard.Themes, Orchard.Modules, Orchard.Widgets, Orchard.jQu" + + "ery, TinyMce"}); table4.AddRow(new string[] { "core", - "Common, Contents, Dashboard, Feeds, HomePage, Navigation, Routable, Orchard.Publi" + - "shLater, Scheduling, Settings, Shapes, XmlRpc"}); + "Common, Contents, Dashboard, Feeds, HomePage, Messaging, Navigation, Routable, Sc" + + "heduling, Settings, Shapes, XmlRpc"}); table4.AddRow(new string[] { "theme", "SafeMode, TheThemeMachine"}); diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index 77eb787f7..8512c3825 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -59,8 +59,12 @@ False ..\..\lib\autofac\Autofac.dll
- - + + ..\..\lib\Castle Windsor 2.0\bin\Castle.Core.dll + + + ..\..\lib\claysharp\ClaySharp.dll + False ..\..\lib\fluentnhibernate\FluentNHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj index 0e6b5b122..911ca0478 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj +++ b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj @@ -92,10 +92,6 @@ {9916839C-39FC-4CEB-A5AF-89CA7E87119F} Orchard.Core - - {79AED36E-ABD0-4747-93D3-8722B042454B} - Orchard.Users - diff --git a/src/Orchard.Web/Modules/Orchard.Email/Services/EmailMessageEventHandler.cs b/src/Orchard.Web/Modules/Orchard.Email/Services/EmailMessageEventHandler.cs index e67ace915..a9bf4ee56 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Services/EmailMessageEventHandler.cs +++ b/src/Orchard.Web/Modules/Orchard.Email/Services/EmailMessageEventHandler.cs @@ -1,7 +1,7 @@ using Orchard.Messaging.Events; using Orchard.ContentManagement; -using Orchard.Users.Models; using Orchard.Messaging.Models; +using Orchard.Security; namespace Orchard.Email.Services { public class EmailMessageEventHandler : IMessageEventHandler { @@ -16,7 +16,7 @@ namespace Orchard.Email.Services { if ( contentItem == null ) return; - var recipient = contentItem.As(); + var recipient = contentItem.As(); if ( recipient == null ) return; diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj index 7b81c2256..906b5033c 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj +++ b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj @@ -43,7 +43,9 @@ False ..\..\..\..\lib\autofac\Autofac.dll - + + ..\..\..\..\lib\claysharp\ClaySharp.dll + diff --git a/src/Orchard.Web/Modules/Orchard.Users/Module.txt b/src/Orchard.Web/Modules/Orchard.Users/Module.txt index 266449435..2566b6b59 100644 --- a/src/Orchard.Web/Modules/Orchard.Users/Module.txt +++ b/src/Orchard.Web/Modules/Orchard.Users/Module.txt @@ -8,4 +8,5 @@ Description: The users module enables user management. Features: Orchard.Users: Description: Standard users. + Dependencies: Messaging Category: Core diff --git a/src/Orchard.Web/Themes/Web.config b/src/Orchard.Web/Themes/Web.config index a2d69a7b9..8ebb44d0d 100644 --- a/src/Orchard.Web/Themes/Web.config +++ b/src/Orchard.Web/Themes/Web.config @@ -3,7 +3,7 @@ - + - + diff --git a/src/Orchard/Commands/CommandHostEnvironment.cs b/src/Orchard/Commands/CommandHostEnvironment.cs index 8a79ff81d..a37339ca9 100644 --- a/src/Orchard/Commands/CommandHostEnvironment.cs +++ b/src/Orchard/Commands/CommandHostEnvironment.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Reflection; using System.Web.Hosting; using Orchard.Environment; using Orchard.Localization; @@ -21,7 +22,7 @@ namespace Orchard.Commands { } public bool IsAssemblyLoaded(string name) { - return AppDomain.CurrentDomain.GetAssemblies().Any(a => a.GetName().Name == name); + return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name); } public void RestartAppDomain() { diff --git a/src/Orchard/Environment/DefaultHostEnvironment.cs b/src/Orchard/Environment/DefaultHostEnvironment.cs new file mode 100644 index 000000000..d9616b7aa --- /dev/null +++ b/src/Orchard/Environment/DefaultHostEnvironment.cs @@ -0,0 +1,64 @@ +using System; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Web; +using System.Web.Hosting; +using Orchard.Services; +using Orchard.Utility.Extensions; + +namespace Orchard.Environment +{ + public class DefaultHostEnvironment : IHostEnvironment + { + private readonly IClock _clock; + + public DefaultHostEnvironment(IClock clock) + { + _clock = clock; + } + + public bool IsFullTrust + { + get { return AppDomain.CurrentDomain.IsFullyTrusted; } + } + + public string MapPath(string virtualPath) + { + return HostingEnvironment.MapPath(virtualPath); + } + + public bool IsAssemblyLoaded(string name) + { + return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name); + } + + public void RestartAppDomain() + { + ResetSiteCompilation(); + } + + public void ResetSiteCompilation() + { + // Touch web.config + File.SetLastWriteTimeUtc(MapPath("~/web.config"), _clock.UtcNow); + + // If setting up extensions/modules requires an AppDomain restart, it's very unlikely the + // current request can be processed correctly. So, we redirect to the same URL, so that the + // new request will come to the newly started AppDomain. + if (HttpContext.Current != null) + { + // Don't redirect posts... + if (HttpContext.Current.Request.RequestType == "GET") + { + HttpContext.Current.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/); + } + else + { + HttpContext.Current.Response.WriteFile("~/Refresh.html"); + HttpContext.Current.Response.End(); + } + } + } + } +} \ No newline at end of file diff --git a/src/Orchard/Environment/IHostEnvironment.cs b/src/Orchard/Environment/IHostEnvironment.cs index c1cba668a..8b6d668bf 100644 --- a/src/Orchard/Environment/IHostEnvironment.cs +++ b/src/Orchard/Environment/IHostEnvironment.cs @@ -1,13 +1,4 @@ -using System; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Web; -using System.Web.Hosting; -using Orchard.Services; -using Orchard.Utility.Extensions; - -namespace Orchard.Environment { +namespace Orchard.Environment { /// /// Abstraction of the running environment /// @@ -20,47 +11,4 @@ namespace Orchard.Environment { void RestartAppDomain(); void ResetSiteCompilation(); } - - public class DefaultHostEnvironment : IHostEnvironment { - private readonly IClock _clock; - - public DefaultHostEnvironment(IClock clock) { - _clock = clock; - } - - public bool IsFullTrust { - get { return AppDomain.CurrentDomain.IsFullyTrusted; } - } - - public string MapPath(string virtualPath) { - return HostingEnvironment.MapPath(virtualPath); - } - - public bool IsAssemblyLoaded(string name) { - return AppDomain.CurrentDomain.GetAssemblies().Any(assembly => new AssemblyName(assembly.FullName).Name == name); - } - - public void RestartAppDomain() { - ResetSiteCompilation(); - } - - public void ResetSiteCompilation() { - // Touch web.config - File.SetLastWriteTimeUtc(MapPath("~/web.config"), _clock.UtcNow); - - // If setting up extensions/modules requires an AppDomain restart, it's very unlikely the - // current request can be processed correctly. So, we redirect to the same URL, so that the - // new request will come to the newly started AppDomain. - if (HttpContext.Current != null) { - // Don't redirect posts... - if (HttpContext.Current.Request.RequestType == "GET") { - HttpContext.Current.Response.Redirect(HttpContext.Current.Request.ToUrlString(), true /*endResponse*/); - } - else { - HttpContext.Current.Response.WriteFile("~/Refresh.html"); - HttpContext.Current.Response.End(); - } - } - } - } -} +} \ No newline at end of file diff --git a/src/Orchard/Orchard.Framework.csproj b/src/Orchard/Orchard.Framework.csproj index c8c95384d..06ecea4d6 100644 --- a/src/Orchard/Orchard.Framework.csproj +++ b/src/Orchard/Orchard.Framework.csproj @@ -147,7 +147,9 @@ False ..\..\lib\aspnetmvc\System.Web.WebPages.dll - + + ..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll + @@ -174,6 +176,7 @@ +