--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-11-14 21:52:31 -08:00
16 changed files with 169 additions and 100 deletions

View File

@@ -59,7 +59,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
</Reference>
<Reference Include="ClaySharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="ClaySharp">
<HintPath>..\..\lib\claysharp\ClaySharp.dll</HintPath>
</Reference>
<Reference Include="Moq, Version=4.0.812.4, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\moq\Moq.dll</HintPath>

View File

@@ -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");

View File

@@ -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 "<a href="/Admin/Contents/Create/Page">Page</a>"
When I go to "admin"
Then I should see "<a href="/Admin/Contents/Create/Page">Page</a>"
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 "<h1>Super Duper</h1>"
And I should see "This is super."

View File

@@ -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 \"<a href=\"/Admin/Contents/Create/Page\">Page</a>\"");
#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 \"<h1>Super Duper</h1>\"");
#line 21
testRunner.And("I should see \"This is super.\"");
#line hidden
testRunner.CollectScenarioErrors();
}

View File

@@ -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

View File

@@ -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"});

View File

@@ -59,8 +59,12 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\autofac\Autofac.dll</HintPath>
</Reference>
<Reference Include="Castle.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc, processorArchitecture=MSIL" />
<Reference Include="ClaySharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="Castle.Core">
<HintPath>..\..\lib\Castle Windsor 2.0\bin\Castle.Core.dll</HintPath>
</Reference>
<Reference Include="ClaySharp">
<HintPath>..\..\lib\claysharp\ClaySharp.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate, Version=1.0.0.593, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\fluentnhibernate\FluentNHibernate.dll</HintPath>

View File

@@ -92,10 +92,6 @@
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
<Name>Orchard.Core</Name>
</ProjectReference>
<ProjectReference Include="..\Orchard.Users\Orchard.Users.csproj">
<Project>{79AED36E-ABD0-4747-93D3-8722B042454B}</Project>
<Name>Orchard.Users</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Placement.info" />

View File

@@ -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<UserPart>();
var recipient = contentItem.As<IUser>();
if ( recipient == null )
return;

View File

@@ -43,7 +43,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\autofac\Autofac.dll</HintPath>
</Reference>
<Reference Include="ClaySharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" />
<Reference Include="ClaySharp">
<HintPath>..\..\..\..\lib\claysharp\ClaySharp.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.ComponentModel.DataAnnotations">

View File

@@ -8,4 +8,5 @@ Description: The users module enables user management.
Features:
Orchard.Users:
Description: Standard users.
Dependencies: Messaging
Category: Core

View File

@@ -3,7 +3,7 @@
<system.web>
<httpHandlers>
<!-- iis6 - for any request in this location, return via managed static file handler -->
<add path="*/Theme.png" verb="*" type="System.Web.StaticFileHandler" />
<!--<add path="*/Theme.png" verb="*" type="System.Web.StaticFileHandler" />-->
</httpHandlers>
<!--
Enabling request validation in view pages would cause validation to occur
@@ -30,7 +30,7 @@
iis7 - for any request to a file exists on disk, return it via native http module.
accessPolicy 'Script' is to allow for a managed 404 page.
-->
<add name="StaticFile" path="*/Theme.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
<!--<add name="StaticFile" path="*/Theme.png" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />-->
</handlers>
</system.webServer>
<runtime>

View File

@@ -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() {

View File

@@ -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();
}
}
}
}
}

View File

@@ -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 {
/// <summary>
/// Abstraction of the running environment
/// </summary>
@@ -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();
}
}
}
}
}
}

View File

@@ -147,7 +147,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\lib\aspnetmvc\System.Web.WebPages.dll</HintPath>
</Reference>
<Reference Include="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
<Reference Include="System.Web.WebPages.Razor">
<HintPath>..\..\lib\aspnetmvc\System.Web.WebPages.Razor.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Yaml, Version=1.0.3370.39839, Culture=neutral, PublicKeyToken=187a3d240e44a135, processorArchitecture=MSIL">
@@ -174,6 +176,7 @@
<Compile Include="DisplayManagement\Implementation\IShapeDisplayEvents.cs" />
<Compile Include="DisplayManagement\Implementation\IShapeFactoryEvents.cs" />
<Compile Include="DisplayManagement\Shapes\ITagBuilderFactory.cs" />
<Compile Include="Environment\DefaultHostEnvironment.cs" />
<Compile Include="Environment\Extensions\Loaders\RawThemeExtensionLoader.cs" />
<Compile Include="Environment\Features\FeatureManager.cs" />
<Compile Include="Localization\Services\DefaultLocalizedStringManager.cs" />