Backed out changeset: d566877ae7c9

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-02-24 13:01:54 -08:00
parent de2cc815ef
commit 9ba008ec32
3 changed files with 5 additions and 31 deletions

View File

@@ -58,19 +58,13 @@ namespace Orchard.Blogs.Controllers {
return View((object)viewModel);
}
public ActionResult Item(string blogPath, PagerParameters pagerParameters) {
public ActionResult Item(int blogId, PagerParameters pagerParameters) {
Pager pager = new Pager(_siteService.GetSiteSettings(), pagerParameters);
var correctedPath = _blogPathConstraint.FindPath(blogPath);
if (correctedPath == null)
var blogPart = _blogService.Get(blogId, VersionOptions.Published).As<BlogPart>();
if (blogPart == null)
return HttpNotFound();
var blogPart = _blogService.Get(correctedPath);
//var blogPart = _blogService.Get(blogId, VersionOptions.Published).As<BlogPart>();
//if (blogPart == null)
// return HttpNotFound();
_feedManager.Register(blogPart);
var blogPosts = _blogPostService.Get(blogPart, pager.GetStartIndex(), pager.PageSize)
.Select(b => _services.ContentManager.BuildDisplay(b, "Summary"));

View File

@@ -35,7 +35,7 @@ namespace Orchard.Blogs.Handlers {
{"Area", "Orchard.Blogs"},
{"Controller", "Blog"},
{"Action", "Item"},
{"blogPath", context.ContentItem.As<IAliasAspect>().Path}
{"blogId", context.ContentItem.Id}
};
context.Metadata.CreateRouteValues = new RouteValueDictionary {
{"Area", "Orchard.Blogs"},

View File

@@ -6,15 +6,12 @@ using Orchard.Mvc.Routes;
namespace Orchard.Blogs {
public class Routes : IRouteProvider {
private readonly IBlogPathConstraint _blogPathConstraint;
private readonly IArchiveConstraint _archiveConstraint;
private readonly IRsdConstraint _rsdConstraint;
public Routes(
IBlogPathConstraint blogPathConstraint,
IArchiveConstraint archiveConstraint,
IRsdConstraint rsdConstraint) {
_blogPathConstraint = blogPathConstraint;
_archiveConstraint = archiveConstraint;
_rsdConstraint = rsdConstraint;
}
@@ -180,23 +177,6 @@ namespace Orchard.Blogs {
},
new MvcRouteHandler())
},
new RouteDescriptor {
Priority = 11,
Route = new Route(
"{*blogPath}",
new RouteValueDictionary {
{"area", "Orchard.Blogs"},
{"controller", "Blog"},
{"action", "Item"},
},
new RouteValueDictionary {
{"blogPath", _blogPathConstraint}
},
new RouteValueDictionary {
{"area", "Orchard.Blogs"}
},
new MvcRouteHandler())
},
new RouteDescriptor {
Route = new Route(
"{*path}",