Swapped out Orchard.Core's Common Routable for the work in progress replacement, Orchard.Core's Routable (seperate core module now)

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-07-13 02:52:02 -07:00
parent 1ff677d24d
commit 501d72afab
46 changed files with 217 additions and 582 deletions

View File

@@ -2,14 +2,13 @@
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.Linq;
using Orchard.Blogs.Models;
using Orchard.Commands;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.Core.Common.Models;
using Orchard.Core.Navigation.Models;
using Orchard.Core.Routable.Models;
using Orchard.Security;
using System.IO;
using Orchard.Blogs.Services;
using Orchard.Core.Navigation.Services;
@@ -55,8 +54,8 @@ namespace Orchard.Blogs.Commands {
var blog = _contentManager.New("Blog");
blog.As<ICommonAspect>().Owner = admin;
blog.As<RoutableAspect>().Slug = Slug;
blog.As<RoutableAspect>().Title = Title;
blog.As<IsRoutable>().Slug = Slug;
blog.As<IsRoutable>().Title = Title;
if ( !String.IsNullOrWhiteSpace(MenuText) ) {
blog.As<MenuPart>().OnMainMenu = true;
blog.As<MenuPart>().MenuPosition = _menuService.Get().Select(menuPart => menuPart.MenuPosition).Max() + 1 + ".0";
@@ -98,8 +97,8 @@ namespace Orchard.Blogs.Commands {
var post = _contentManager.New("BlogPost");
post.As<ICommonAspect>().Owner = admin;
post.As<ICommonAspect>().Container = blog;
post.As<RoutableAspect>().Slug = Slugify(postName);
post.As<RoutableAspect>().Title = postName;
post.As<IsRoutable>().Slug = Slugify(postName);
post.As<IsRoutable>().Title = postName;
post.As<BodyAspect>().Text = item.Element("description").Value;
_contentManager.Create(post);
}

View File

@@ -1,18 +1,13 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.Routing;
using JetBrains.Annotations;
using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Models;
using Orchard.Core.Common.Services;
using Orchard.Localization;
using Orchard.Mvc.ViewModels;
using Orchard.UI.Notify;
namespace Orchard.Blogs.Drivers {
[UsedImplicitly]

View File

@@ -5,7 +5,7 @@ using Orchard.Blogs.Models;
using Orchard.Blogs.Services;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Drivers;
using Orchard.Core.Common.Services;
using Orchard.Core.Routable.Services;
using Orchard.Localization;
namespace Orchard.Blogs.Drivers {

View File

@@ -3,6 +3,7 @@ using Orchard.Blogs.Drivers;
using Orchard.Blogs.Models;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Common.Models;
using Orchard.Core.Routable.Models;
using Orchard.Data;
namespace Orchard.Blogs.Handlers {
@@ -11,7 +12,7 @@ namespace Orchard.Blogs.Handlers {
public BlogHandler(IRepository<BlogRecord> repository) {
Filters.Add(new ActivatingFilter<Blog>(BlogDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<CommonAspect>(BlogDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<RoutableAspect>(BlogDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<IsRoutable>(BlogDriver.ContentType.Name));
Filters.Add(StorageFilter.For(repository));
}
}

View File

@@ -8,6 +8,7 @@ using Orchard.Blogs.Services;
using Orchard.ContentManagement;
using Orchard.Core.Common.Models;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Routable.Models;
using Orchard.Localization;
namespace Orchard.Blogs.Handlers {
@@ -24,7 +25,7 @@ namespace Orchard.Blogs.Handlers {
Filters.Add(new ActivatingFilter<BlogPost>(BlogPostDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<CommonAspect>(BlogPostDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<ContentPart<CommonVersionRecord>>(BlogPostDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<RoutableAspect>(BlogPostDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<IsRoutable>(BlogPostDriver.ContentType.Name));
Filters.Add(new ActivatingFilter<BodyAspect>(BlogPostDriver.ContentType.Name));
OnLoaded<BlogPost>((context, p) => p.ScheduledPublishUtc = _blogPostService.GetScheduledPublishUtc(p));

View File

@@ -1,6 +1,6 @@
using System.Web.Mvc;
using Orchard.Core.Common.Models;
using Orchard.ContentManagement;
using Orchard.Core.Routable.Models;
namespace Orchard.Blogs.Models {
public class Blog : ContentPart<BlogRecord> {
@@ -8,14 +8,14 @@ namespace Orchard.Blogs.Models {
public int Id { get { return ContentItem.Id; } }
public string Name {
get { return this.As<RoutableAspect>().Title; }
set { this.As<RoutableAspect>().Title = value; }
get { return this.As<IsRoutable>().Title; }
set { this.As<IsRoutable>().Title = value; }
}
//TODO: (erikpo) Need a data type for slug
public string Slug {
get { return this.As<RoutableAspect>().Slug; }
set { this.As<RoutableAspect>().Slug = value; }
get { return this.As<IsRoutable>().Slug; }
set { this.As<IsRoutable>().Slug = value; }
}
public string Description {

View File

@@ -3,6 +3,7 @@ using System.Web.Mvc;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.Core.Common.Models;
using Orchard.Core.Routable.Models;
using Orchard.Security;
namespace Orchard.Blogs.Models {
@@ -13,13 +14,13 @@ namespace Orchard.Blogs.Models {
}
public string Title {
get { return this.As<RoutableAspect>().Title; }
set { this.As<RoutableAspect>().Title = value; }
get { return this.As<IsRoutable>().Title; }
set { this.As<IsRoutable>().Title = value; }
}
public string Slug {
get { return this.As<RoutableAspect>().Slug; }
set { this.As<RoutableAspect>().Slug = value; }
get { return this.As<IsRoutable>().Slug; }
set { this.As<IsRoutable>().Slug = value; }
}
public string Text {

View File

@@ -6,6 +6,7 @@ using Orchard.Blogs.Drivers;
using Orchard.Blogs.Models;
using Orchard.Core.Common.Models;
using Orchard.ContentManagement;
using Orchard.Core.Routable.Models;
using Orchard.Data;
using Orchard.Tasks.Scheduling;

View File

@@ -5,6 +5,7 @@ using Orchard.Blogs.Models;
using Orchard.Blogs.Routing;
using Orchard.Core.Common.Models;
using Orchard.ContentManagement;
using Orchard.Core.Routable.Models;
namespace Orchard.Blogs.Services {
[UsedImplicitly]

View File

@@ -2,9 +2,7 @@
<%@ Import Namespace="Orchard.Mvc.ViewModels"%>
<%@ Import Namespace="Orchard.Blogs.Extensions"%>
<%@ Import Namespace="Orchard.Blogs.Models"%>
<h1><a href="<%: Url.BlogForAdmin(Model.Item.Slug) %>"><%: Html.TitleForPage(Model.Item.Name) %></a>
</h1>
<h1><a href="<%: Url.BlogForAdmin(Model.Item.Slug) %>"><%: Html.TitleForPage(Model.Item.Name) %></a></h1>
<% Html.Zone("manage"); %><%--
<form>
<div class="actions bulk">