mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
#18683: Fixing blog command switch
Work Item: 18683 --HG-- branch : 1.4.x
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Xml.Linq;
|
using System.Xml.Linq;
|
||||||
using Orchard.Blogs.Models;
|
using Orchard.Blogs.Models;
|
||||||
using Orchard.Commands;
|
using Orchard.Commands;
|
||||||
@@ -39,7 +38,7 @@ namespace Orchard.Blogs.Commands {
|
|||||||
public string FeedUrl { get; set; }
|
public string FeedUrl { get; set; }
|
||||||
|
|
||||||
[OrchardSwitch]
|
[OrchardSwitch]
|
||||||
public int Id { get; set; }
|
public int BlogId { get; set; }
|
||||||
|
|
||||||
[OrchardSwitch]
|
[OrchardSwitch]
|
||||||
public string Owner { get; set; }
|
public string Owner { get; set; }
|
||||||
@@ -100,7 +99,7 @@ namespace Orchard.Blogs.Commands {
|
|||||||
|
|
||||||
[CommandName("blog import")]
|
[CommandName("blog import")]
|
||||||
[CommandHelp("blog import /BlogId:<id> /FeedUrl:<feed url> /Owner:<username>\r\n\t" + "Import all items from <feed url> into the blog specified by <id>")]
|
[CommandHelp("blog import /BlogId:<id> /FeedUrl:<feed url> /Owner:<username>\r\n\t" + "Import all items from <feed url> into the blog specified by <id>")]
|
||||||
[OrchardSwitches("FeedUrl,Id,Owner")]
|
[OrchardSwitches("FeedUrl,BlogId,Owner")]
|
||||||
public void Import() {
|
public void Import() {
|
||||||
var owner = _membershipService.GetUser(Owner);
|
var owner = _membershipService.GetUser(Owner);
|
||||||
|
|
||||||
@@ -120,10 +119,10 @@ namespace Orchard.Blogs.Commands {
|
|||||||
throw new OrchardException(T("An error occured while loading the feed at {0}.", FeedUrl), ex);
|
throw new OrchardException(T("An error occured while loading the feed at {0}.", FeedUrl), ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
var blog = _blogService.Get(Id,VersionOptions.Latest);
|
var blog = _blogService.Get(BlogId, VersionOptions.Latest);
|
||||||
|
|
||||||
if ( blog == null ) {
|
if ( blog == null ) {
|
||||||
Context.Output.WriteLine(T("Blog not found with specified Id: {0}", Id));
|
Context.Output.WriteLine(T("Blog not found with specified Id: {0}", BlogId));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user