--HG--
branch : 1.x
This commit is contained in:
bertrandleroy
2011-09-30 16:20:03 -07:00
16 changed files with 182 additions and 276 deletions

View File

@@ -47,8 +47,8 @@
<CallTarget Targets="Compile"/>
<CallTarget Targets="Test"/>
<CallTarget Targets="Package"/>
<CallTarget Targets="Spec"/>
<CallTarget Targets="Gallery"/>
<CallTarget Targets="Spec"/> <!-- Note: move to the end until SpecFlow test are more reliable -->
</Target>
<Target Name="FastPackage">

View File

@@ -23,7 +23,9 @@ Scenario: I can create a new blog and blog post
| Routable.Title | My Post |
| Body.Text | Hi there. |
And I hit "Publish Now"
And I go to "my-blog"
And I am redirected
Then I should see "Your Blog Post has been created."
When I go to "my-blog"
Then I should see "<h1[^>]*>.*?My Blog.*?</h1>"
And I should see "<h1[^>]*>.*?My Post.*?</h1>"
When I go to "my-blog/my-post"

View File

@@ -2,7 +2,7 @@
// <auto-generated>
// This code was generated by SpecFlow (http://www.specflow.org/).
// SpecFlow Version:1.5.0.0
// Runtime Version:4.0.30319.1
// Runtime Version:4.0.30319.17011
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -113,16 +113,20 @@ this.ScenarioSetup(scenarioInfo);
#line 25
testRunner.And("I hit \"Publish Now\"");
#line 26
testRunner.And("I go to \"my-blog\"");
testRunner.And("I am redirected");
#line 27
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
testRunner.Then("I should see \"Your Blog Post has been created.\"");
#line 28
testRunner.And("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.When("I go to \"my-blog\"");
#line 29
testRunner.When("I go to \"my-blog/my-post\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
#line 30
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.And("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 31
testRunner.When("I go to \"my-blog/my-post\"");
#line 32
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 33
testRunner.And("I should see \"Hi there.\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -135,11 +139,11 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog with multiple blog posts each with the same title and uni" +
"que slugs are generated or given for said posts", ((string[])(null)));
#line 33
this.ScenarioSetup(scenarioInfo);
#line 34
testRunner.Given("I have installed Orchard");
#line 35
this.ScenarioSetup(scenarioInfo);
#line 36
testRunner.Given("I have installed Orchard");
#line 37
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table3 = new TechTalk.SpecFlow.Table(new string[] {
@@ -148,15 +152,15 @@ this.ScenarioSetup(scenarioInfo);
table3.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 36
#line 38
testRunner.And("I fill in", ((string)(null)), table3);
#line 39
testRunner.And("I hit \"Save\"");
#line 40
testRunner.And("I go to \"admin/blogs\"");
#line 41
testRunner.And("I follow \"My Blog\"");
testRunner.And("I hit \"Save\"");
#line 42
testRunner.And("I go to \"admin/blogs\"");
#line 43
testRunner.And("I follow \"My Blog\"");
#line 44
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table4 = new TechTalk.SpecFlow.Table(new string[] {
@@ -168,21 +172,21 @@ this.ScenarioSetup(scenarioInfo);
table4.AddRow(new string[] {
"Body.Text",
"Hi there."});
#line 43
#line 45
testRunner.And("I fill in", ((string)(null)), table4);
#line 47
testRunner.And("I hit \"Publish Now\"");
#line 48
testRunner.And("I go to \"my-blog/my-post\"");
#line 49
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.And("I hit \"Publish Now\"");
#line 50
testRunner.And("I should see \"Hi there.\"");
testRunner.And("I go to \"my-blog/my-post\"");
#line 51
testRunner.When("I go to \"admin/blogs\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 52
testRunner.And("I follow \"My Blog\"");
testRunner.And("I should see \"Hi there.\"");
#line 53
testRunner.When("I go to \"admin/blogs\"");
#line 54
testRunner.And("I follow \"My Blog\"");
#line 55
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table5 = new TechTalk.SpecFlow.Table(new string[] {
@@ -194,21 +198,21 @@ this.ScenarioSetup(scenarioInfo);
table5.AddRow(new string[] {
"Body.Text",
"Hi there, again."});
#line 54
#line 56
testRunner.And("I fill in", ((string)(null)), table5);
#line 58
testRunner.And("I hit \"Publish Now\"");
#line 59
testRunner.And("I go to \"my-blog/my-post-2\"");
#line 60
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.And("I hit \"Publish Now\"");
#line 61
testRunner.And("I should see \"Hi there, again.\"");
testRunner.And("I go to \"my-blog/my-post-2\"");
#line 62
testRunner.When("I go to \"admin/blogs\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 63
testRunner.And("I follow \"My Blog\"");
testRunner.And("I should see \"Hi there, again.\"");
#line 64
testRunner.When("I go to \"admin/blogs\"");
#line 65
testRunner.And("I follow \"My Blog\"");
#line 66
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table6 = new TechTalk.SpecFlow.Table(new string[] {
@@ -223,15 +227,15 @@ this.ScenarioSetup(scenarioInfo);
table6.AddRow(new string[] {
"Body.Text",
"Are you still there?"});
#line 65
#line 67
testRunner.And("I fill in", ((string)(null)), table6);
#line 70
testRunner.And("I hit \"Publish Now\"");
#line 71
testRunner.And("I go to \"my-blog/my-post-3\"");
#line 72
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.And("I hit \"Publish Now\"");
#line 73
testRunner.And("I go to \"my-blog/my-post-3\"");
#line 74
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 75
testRunner.And("I should see \"Are you still there?\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -244,11 +248,11 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I can create a new blog and blog post and when I change the slug of the blog the " +
"path of the plog post is updated", ((string[])(null)));
#line 75
this.ScenarioSetup(scenarioInfo);
#line 76
testRunner.Given("I have installed Orchard");
#line 77
this.ScenarioSetup(scenarioInfo);
#line 78
testRunner.Given("I have installed Orchard");
#line 79
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table7 = new TechTalk.SpecFlow.Table(new string[] {
@@ -257,19 +261,19 @@ this.ScenarioSetup(scenarioInfo);
table7.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 78
#line 80
testRunner.And("I fill in", ((string)(null)), table7);
#line 81
testRunner.And("I hit \"Save\"");
#line 82
testRunner.And("I go to \"my-blog\"");
#line 83
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
testRunner.And("I hit \"Save\"");
#line 84
testRunner.When("I go to \"admin/blogs\"");
testRunner.And("I go to \"my-blog\"");
#line 85
testRunner.And("I follow \"My Blog\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
#line 86
testRunner.When("I go to \"admin/blogs\"");
#line 87
testRunner.And("I follow \"My Blog\"");
#line 88
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table8 = new TechTalk.SpecFlow.Table(new string[] {
@@ -281,21 +285,21 @@ this.ScenarioSetup(scenarioInfo);
table8.AddRow(new string[] {
"Body.Text",
"Hi there."});
#line 87
#line 89
testRunner.And("I fill in", ((string)(null)), table8);
#line 91
testRunner.And("I hit \"Publish Now\"");
#line 92
testRunner.And("I go to \"my-blog/my-post\"");
#line 93
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.And("I hit \"Publish Now\"");
#line 94
testRunner.And("I should see \"Hi there.\"");
testRunner.And("I go to \"my-blog/my-post\"");
#line 95
testRunner.When("I go to \"admin/blogs\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 96
testRunner.And("I follow \"My Blog\"");
testRunner.And("I should see \"Hi there.\"");
#line 97
testRunner.When("I go to \"admin/blogs\"");
#line 98
testRunner.And("I follow \"My Blog\"");
#line 99
testRunner.And("I follow \"Blog Properties\"");
#line hidden
TechTalk.SpecFlow.Table table9 = new TechTalk.SpecFlow.Table(new string[] {
@@ -304,19 +308,19 @@ this.ScenarioSetup(scenarioInfo);
table9.AddRow(new string[] {
"Routable.Slug",
"my-other-blog"});
#line 98
#line 100
testRunner.And("I fill in", ((string)(null)), table9);
#line 101
testRunner.And("I hit \"Save\"");
#line 102
testRunner.And("I go to \"my-other-blog\"");
#line 103
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
testRunner.And("I hit \"Save\"");
#line 104
testRunner.When("I go to \"my-other-blog/my-post\"");
testRunner.And("I go to \"my-other-blog\"");
#line 105
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
testRunner.Then("I should see \"<h1[^>]*>.*?My Blog.*?</h1>\"");
#line 106
testRunner.When("I go to \"my-other-blog/my-post\"");
#line 107
testRunner.Then("I should see \"<h1[^>]*>.*?My Post.*?</h1>\"");
#line 108
testRunner.And("I should see \"Hi there.\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -327,11 +331,11 @@ this.ScenarioSetup(scenarioInfo);
public virtual void WhenViewingABlogTheUserAgentIsGivenAnRSSFeedOfTheBlogSPosts()
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("When viewing a blog the user agent is given an RSS feed of the blog\'s posts", ((string[])(null)));
#line 108
this.ScenarioSetup(scenarioInfo);
#line 109
testRunner.Given("I have installed Orchard");
#line 110
this.ScenarioSetup(scenarioInfo);
#line 111
testRunner.Given("I have installed Orchard");
#line 112
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table10 = new TechTalk.SpecFlow.Table(new string[] {
@@ -340,15 +344,15 @@ this.ScenarioSetup(scenarioInfo);
table10.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 111
#line 113
testRunner.And("I fill in", ((string)(null)), table10);
#line 114
testRunner.And("I hit \"Save\"");
#line 115
testRunner.And("I go to \"admin/blogs\"");
#line 116
testRunner.And("I follow \"My Blog\"");
testRunner.And("I hit \"Save\"");
#line 117
testRunner.And("I go to \"admin/blogs\"");
#line 118
testRunner.And("I follow \"My Blog\"");
#line 119
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table11 = new TechTalk.SpecFlow.Table(new string[] {
@@ -360,15 +364,15 @@ this.ScenarioSetup(scenarioInfo);
table11.AddRow(new string[] {
"Body.Text",
"Hi there."});
#line 118
#line 120
testRunner.And("I fill in", ((string)(null)), table11);
#line 122
testRunner.And("I hit \"Publish Now\"");
#line 123
testRunner.And("I am redirected");
#line 124
testRunner.And("I go to \"my-blog/my-post\"");
testRunner.And("I hit \"Publish Now\"");
#line 125
testRunner.And("I am redirected");
#line 126
testRunner.And("I go to \"my-blog/my-post\"");
#line 127
testRunner.Then("I should see \"<link rel=\"alternate\" type=\"application/rss\\+xml\" title=\"My Blog\" h" +
"ref=\"/rss\\?containerid=\\d+\" />\"");
#line hidden
@@ -382,15 +386,15 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Enabling remote blog publishing inserts the appropriate metaweblogapi markup into" +
" the blog\'s page", ((string[])(null)));
#line 128
this.ScenarioSetup(scenarioInfo);
#line 129
testRunner.Given("I have installed Orchard");
#line 130
testRunner.And("I have enabled \"XmlRpc\"");
this.ScenarioSetup(scenarioInfo);
#line 131
testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\"");
testRunner.Given("I have installed Orchard");
#line 132
testRunner.And("I have enabled \"XmlRpc\"");
#line 133
testRunner.And("I have enabled \"Orchard.Blogs.RemotePublishing\"");
#line 134
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table12 = new TechTalk.SpecFlow.Table(new string[] {
@@ -399,23 +403,23 @@ this.ScenarioSetup(scenarioInfo);
table12.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 133
#line 135
testRunner.And("I fill in", ((string)(null)), table12);
#line 136
testRunner.And("I hit \"Save\"");
#line 137
testRunner.And("I go to \"my-blog\"");
#line 138
testRunner.And("I hit \"Save\"");
#line 139
testRunner.And("I go to \"my-blog\"");
#line 140
testRunner.Then("I should see \"<link href=\"[^\"]*/XmlRpc/LiveWriter/Manifest\" rel=\"wlwmanifest\" typ" +
"e=\"application/wlwmanifest\\+xml\" />\"");
#line 139
testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\"");
#line 140
testRunner.Then("the content type should be \"\\btext/xml\\b\"");
#line 141
testRunner.When("I go to \"/XmlRpc/LiveWriter/Manifest\"");
#line 142
testRunner.Then("the content type should be \"\\btext/xml\\b\"");
#line 143
testRunner.And("I should see \"<manifest xmlns=\"http\\://schemas\\.microsoft\\.com/wlw/manifest/weblo" +
"g\">\"");
#line 142
#line 144
testRunner.And("I should see \"<clientType>Metaweblog</clientType>\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -428,13 +432,13 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when not at the root is reflected in the URL " +
"example for the slug field when creating a blog or blog post", ((string[])(null)));
#line 144
this.ScenarioSetup(scenarioInfo);
#line 145
testRunner.Given("I have installed Orchard at \"/OrchardLocal\"");
#line 146
testRunner.When("I go to \"admin/blogs/create\"");
this.ScenarioSetup(scenarioInfo);
#line 147
testRunner.Given("I have installed Orchard at \"/OrchardLocal\"");
#line 148
testRunner.When("I go to \"admin/blogs/create\"");
#line 149
testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/</span>\"");
#line hidden
TechTalk.SpecFlow.Table table13 = new TechTalk.SpecFlow.Table(new string[] {
@@ -443,17 +447,17 @@ this.ScenarioSetup(scenarioInfo);
table13.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 148
#line 150
testRunner.When("I fill in", ((string)(null)), table13);
#line 151
testRunner.And("I hit \"Save\"");
#line 152
testRunner.And("I go to \"admin/blogs\"");
#line 153
testRunner.And("I follow \"My Blog\"");
testRunner.And("I hit \"Save\"");
#line 154
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
testRunner.And("I go to \"admin/blogs\"");
#line 155
testRunner.And("I follow \"My Blog\"");
#line 156
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line 157
testRunner.Then("I should see \"<span>http\\://localhost/OrchardLocal/my-blog/</span>\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -466,13 +470,13 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("The virtual path of my installation when at the root is reflected in the URL exam" +
"ple for the slug field when creating a blog or blog post", ((string[])(null)));
#line 157
this.ScenarioSetup(scenarioInfo);
#line 158
testRunner.Given("I have installed Orchard at \"/\"");
#line 159
testRunner.When("I go to \"admin/blogs/create\"");
this.ScenarioSetup(scenarioInfo);
#line 160
testRunner.Given("I have installed Orchard at \"/\"");
#line 161
testRunner.When("I go to \"admin/blogs/create\"");
#line 162
testRunner.Then("I should see \"<span>http\\://localhost/</span>\"");
#line hidden
TechTalk.SpecFlow.Table table14 = new TechTalk.SpecFlow.Table(new string[] {
@@ -481,17 +485,17 @@ this.ScenarioSetup(scenarioInfo);
table14.AddRow(new string[] {
"Routable.Title",
"My Blog"});
#line 161
#line 163
testRunner.When("I fill in", ((string)(null)), table14);
#line 164
testRunner.And("I hit \"Save\"");
#line 165
testRunner.And("I go to \"admin/blogs\"");
#line 166
testRunner.And("I follow \"My Blog\"");
testRunner.And("I hit \"Save\"");
#line 167
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
testRunner.And("I go to \"admin/blogs\"");
#line 168
testRunner.And("I follow \"My Blog\"");
#line 169
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line 170
testRunner.Then("I should see \"<span>http\\://localhost/my-blog/</span>\"");
#line hidden
testRunner.CollectScenarioErrors();
@@ -504,11 +508,11 @@ this.ScenarioSetup(scenarioInfo);
{
TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("I set my blog to be the content for the home page and the posts for the blog be r" +
"ooted to the app", ((string[])(null)));
#line 170
this.ScenarioSetup(scenarioInfo);
#line 171
testRunner.Given("I have installed Orchard");
#line 172
this.ScenarioSetup(scenarioInfo);
#line 173
testRunner.Given("I have installed Orchard");
#line 174
testRunner.When("I go to \"admin/blogs/create\"");
#line hidden
TechTalk.SpecFlow.Table table15 = new TechTalk.SpecFlow.Table(new string[] {
@@ -520,15 +524,15 @@ this.ScenarioSetup(scenarioInfo);
table15.AddRow(new string[] {
"Routable.PromoteToHomePage",
"true"});
#line 173
#line 175
testRunner.And("I fill in", ((string)(null)), table15);
#line 177
testRunner.And("I hit \"Save\"");
#line 178
testRunner.And("I go to \"admin/blogs\"");
#line 179
testRunner.And("I follow \"My Blog\"");
testRunner.And("I hit \"Save\"");
#line 180
testRunner.And("I go to \"admin/blogs\"");
#line 181
testRunner.And("I follow \"My Blog\"");
#line 182
testRunner.And("I follow \"New Post\" where class name has \"primaryAction\"");
#line hidden
TechTalk.SpecFlow.Table table16 = new TechTalk.SpecFlow.Table(new string[] {
@@ -540,23 +544,23 @@ this.ScenarioSetup(scenarioInfo);
table16.AddRow(new string[] {
"Body.Text",
"Hi there."});
#line 181
#line 183
testRunner.And("I fill in", ((string)(null)), table16);
#line 185
testRunner.And("I hit \"Publish Now\"");
#line 186
testRunner.And("I am redirected");
#line 187
testRunner.And("I go to \"/\"");
testRunner.And("I hit \"Publish Now\"");
#line 188
testRunner.Then("I should see \"<h1>My Blog</h1>\"");
testRunner.And("I am redirected");
#line 189
testRunner.When("I go to \"/my-blog\"");
testRunner.And("I go to \"/\"");
#line 190
testRunner.Then("the status should be 404 \"Not Found\"");
testRunner.Then("I should see \"<h1>My Blog</h1>\"");
#line 191
testRunner.When("I go to \"/my-post\"");
testRunner.When("I go to \"/my-blog\"");
#line 192
testRunner.Then("the status should be 404 \"Not Found\"");
#line 193
testRunner.When("I go to \"/my-post\"");
#line 194
testRunner.Then("I should see \"<h1>My Post</h1>\"");
#line hidden
testRunner.CollectScenarioErrors();

View File

@@ -6,27 +6,27 @@
</listeners>
</trace>
<sources>
<source name="Default" switchValue="Warning">
<source name="Default" switchValue="Error">
<listeners>
<add name="CaptureTraceMessages" />
</listeners>
</source>
<source name="Orchard" switchValue="Verbose">
<source name="Orchard" switchValue="Error">
<listeners>
<add name="CaptureTraceMessages" />
</listeners>
</source>
<source name="Orchard.Data.SessionLocator" switchValue="Information">
<source name="Orchard.Data.SessionLocator" switchValue="Error">
<listeners>
<add name="CaptureTraceMessages" />
</listeners>
</source>
<source name="NHibernate.SQL" switchValue="Verbose">
<source name="NHibernate.SQL" switchValue="Error">
<listeners>
<add name="CaptureTraceMessages" />
</listeners>
</source>
<source name="Orchard.Mvc.ViewEngines.WebFormViewEngineProvider" switchValue="Warning">
<source name="Orchard.Mvc.ViewEngines.WebFormViewEngineProvider" switchValue="Error">
<listeners>
<add name="CaptureTraceMessages" />
</listeners>

View File

@@ -87,7 +87,7 @@ namespace Orchard.Blogs.Controllers {
if (!Services.Authorizer.Authorize(Permissions.PublishBlogPost, blog.ContentItem, T("Couldn't publish blog post")))
return new HttpUnauthorizedResult();
Services.ContentManager.Publish(blog.ContentItem);
Services.ContentManager.Publish(blogPost.ContentItem);
}
Services.Notifier.Information(T("Your {0} has been created.", blogPost.TypeDefinition.DisplayName));

View File

@@ -1,98 +0,0 @@
<#@ template language="C#" HostSpecific="True" #>
<#
MvcTextTemplateHost mvcHost = (MvcTextTemplateHost)(Host);
#>
using System.Web.Mvc;
using Orchard.Localization;
using Orchard;
namespace <#= mvcHost.Namespace #>
{
public class <#= mvcHost.ControllerName #> : Controller
{
public IOrchardServices Services { get; set; }
public <#= mvcHost.ControllerName #>(IOrchardServices services) {
Services = services;
T = NullLocalizer.Instance;
}
public Localizer T { get; set; }
<#
if(mvcHost.AddActionMethods) {
#>
public ActionResult Index()
{
return View();
}
public ActionResult Details(int id)
{
return View();
}
public ActionResult Create()
{
return View();
}
[HttpPost]
public ActionResult Create(FormCollection collection)
{
try
{
// TODO: Add insert logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
public ActionResult Edit(int id)
{
return View();
}
[HttpPost]
public ActionResult Edit(int id, FormCollection collection)
{
try
{
// TODO: Add update logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
public ActionResult Delete(int id)
{
return View();
}
[HttpPost]
public ActionResult Delete(int id, FormCollection collection)
{
try
{
// TODO: Add delete logic here
return RedirectToAction("Index");
}
catch
{
return View();
}
}
<#
}
#>
}
}

View File

@@ -6,7 +6,7 @@
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{$$ModuleProjectGuid$$}</ProjectGuid>
<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<ProjectTypeGuids>{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>$$ModuleName$$</RootNamespace>

View File

@@ -23,7 +23,7 @@ namespace Orchard.CodeGeneration.Commands {
"", "Content", "Styles", "Scripts", "Views", "Zones"
};
private static readonly string[] _moduleDirectories = new [] {
"", "Properties", "Controllers", "Views", "Models", "Scripts", "Styles", "CodeTemplates/AddController"
"", "Properties", "Controllers", "Views", "Models", "Scripts", "Styles"
};
private const string ModuleName = "CodeGeneration";

View File

@@ -14,6 +14,7 @@
<AssemblyName>Orchard.CodeGeneration</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<MvcBuildViews>false</MvcBuildViews>
<UseIISExpress>false</UseIISExpress>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -82,9 +83,6 @@
<ItemGroup>
<Content Include="CodeGenerationTemplates\Placement.info" />
</ItemGroup>
<ItemGroup>
<Content Include="CodeGenerationTemplates\Controller.tt" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@@ -28,7 +28,7 @@
//temporarily "disable" actions on core features
bool showActions;
<li class="category @categoryClassName">
<li class="@categoryClassName">
<h2>@categoryName</h2>
<ul>@{
var features = featureGroup.OrderBy(f => f.Descriptor.Name);
@@ -54,7 +54,7 @@
var missingDependencies = feature.Descriptor.Dependencies
.Where(d => !Model.Features.Any(f => f.Descriptor.Id == d));
showActions = categoryName.ToString() != "Core" && missingDependencies.Count() == 0;
<li class="feature @featureClassName" id="@featureId" title="@T("{0} is {1}", Html.AttributeEncode(featureName), featureState)">
<li class="@featureClassName" id="@featureId" title="@T("{0} is {1}", Html.AttributeEncode(featureName), featureState)">
<div class="summary">
<div class="properties">
<h3>@featureName</h3>

View File

@@ -36,7 +36,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="NuGet.Core, Version=1.0.11220.104, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Reference Include="NuGet.Core, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\lib\nuget\NuGet.Core.dll</HintPath>
<Private>True</Private>

View File

@@ -150,7 +150,6 @@ namespace Orchard.Setup.Services {
}
}
_shellSettingsManager.SaveSettings(shellSettings);
// in effect "pump messages" see PostMessage circa 1980
@@ -173,10 +172,7 @@ namespace Orchard.Setup.Services {
}
}
//// execute pending recipe steps
//while (_processingEngine.AreTasksPending())
// _processingEngine.ExecuteNextTask();
_shellSettingsManager.SaveSettings(shellSettings);
return executionId;
}

View File

@@ -2,6 +2,7 @@ using System.Web.Mvc;
using Orchard.Localization;
using Orchard.Mvc.Filters;
using Orchard.Security;
using Orchard.UI.Admin;
namespace Orchard.Users.Security {
public class FrontEndFilter : FilterProvider, IAuthorizationFilter {
@@ -22,7 +23,7 @@ namespace Orchard.Users.Security {
|| filterContext.ActionDescriptor.ActionName == "Register")
&& filterContext.ActionDescriptor.ControllerDescriptor.ControllerName == "Account";
if (!isAuthPage && !_authorizer.Authorize(StandardPermissions.AccessFrontEnd, T("Can't access this website"))) {
if (!AdminFilter.IsApplied(filterContext.RequestContext) && !isAuthPage && !_authorizer.Authorize(StandardPermissions.AccessFrontEnd, T("Can't access this website"))) {
filterContext.Result = new HttpUnauthorizedResult();
}
}

View File

@@ -179,7 +179,7 @@ namespace Orchard.Environment {
_cacheManager.Get("OrchardHost_Extensions",
ctx => {
_extensionMonitoringCoordinator.MonitorExtensions(ctx.Monitor);
// _hostLocalRestart.Monitor(ctx.Monitor);
_hostLocalRestart.Monitor(ctx.Monitor);
DisposeShellContext();
return "";
});

View File

@@ -21,20 +21,20 @@ namespace Orchard.Mvc.DataAnnotations {
protected override IEnumerable<ModelValidator> GetValidators(ModelMetadata metadata, ControllerContext context, IEnumerable<Attribute> attributes) {
var localizedAttributes = new List<Attribute>();
foreach ( var attribute in attributes ) {
// overriden messages have their localization in the scope of the class they are applied to
var tContainer = new Lazy<Localizer>(() => LocalizationUtilities.Resolve(context, metadata.ContainerType.FullName));
foreach (var attribute in attributes) {
Func<ValidationAttribute, Localizer, ValidationAttribute> localizedAttribute;
// overriden messages have their localization in the scope of the class they are applied to
var tContainer = LocalizationUtilities.Resolve(context, metadata.ContainerType.FullName);
// default translations use the attribute's scope, e.g., Orchard.Mvc.DataAnnotations.LocalizedRequiredAttribute
var tProvider = LocalizationUtilities.Resolve(context, attribute.GetType().FullName);
var tProvider = new Lazy<Localizer>(() => LocalizationUtilities.Resolve(context, attribute.GetType().FullName));
var validationAttribute = attribute as ValidationAttribute;
// substitute the attribute to its localized version if available
if ( _validationAttributes.TryGetValue(attribute.GetType(), out localizedAttribute) ) {
localizedAttributes.Add(localizedAttribute((ValidationAttribute)attribute, tProvider));
localizedAttributes.Add(localizedAttribute((ValidationAttribute)attribute, tProvider.Value));
}
else {
@@ -43,12 +43,12 @@ namespace Orchard.Mvc.DataAnnotations {
var propertyInfo = validationAttribute.GetType().GetProperty("T", typeof(Localizer));
if ( propertyInfo != null ) {
propertyInfo.SetValue(attribute, tProvider, null);
propertyInfo.SetValue(attribute, tProvider.Value, null);
}
}
if ( attribute is DisplayNameAttribute ) {
metadata.DisplayName = tContainer(metadata.DisplayName).Text;
metadata.DisplayName = tContainer.Value(metadata.DisplayName).Text;
}
localizedAttributes.Add(attribute);

View File

@@ -7,12 +7,11 @@ namespace Orchard.UI.PageTitle {
public class PageTitleBuilder : IPageTitleBuilder {
private readonly ISiteService _siteService;
private readonly List<string> _titleParts;
private readonly string _titleSeparator;
private string _titleSeparator;
public PageTitleBuilder(ISiteService siteService) {
_siteService = siteService;
_titleParts = new List<string>(5);
_titleSeparator = _siteService.GetSiteSettings().PageTitleSeparator;
}
public void AddTitleParts(params string[] titleParts) {
@@ -30,6 +29,10 @@ namespace Orchard.UI.PageTitle {
}
public string GenerateTitle() {
if (_titleSeparator == null) {
_titleSeparator = _siteService.GetSiteSettings().PageTitleSeparator;
}
return _titleParts.Count == 0
? String.Empty
: String.Join(_titleSeparator, _titleParts.AsEnumerable().Reverse().ToArray());