2009-12-22 01:55:34 +00:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using Orchard.Blogs.Controllers;
|
2009-11-24 02:03:13 +00:00
|
|
|
using Orchard.Core.Common.Models;
|
2009-12-21 20:29:53 +00:00
|
|
|
using Orchard.ContentManagement.Handlers;
|
2010-01-11 21:05:24 +00:00
|
|
|
using Orchard.Core.Common.Records;
|
|
|
|
|
using Orchard.Data;
|
2009-11-20 23:31:49 +00:00
|
|
|
|
|
|
|
|
namespace Orchard.Blogs.Models {
|
2009-12-22 01:55:34 +00:00
|
|
|
[UsedImplicitly]
|
2009-12-08 10:34:03 +00:00
|
|
|
public class BlogPostHandler : ContentHandler {
|
2010-01-11 21:05:24 +00:00
|
|
|
public BlogPostHandler(IRepository<CommonVersionRecord> commonRepository) {
|
2009-12-22 01:55:34 +00:00
|
|
|
Filters.Add(new ActivatingFilter<BlogPost>(BlogPostDriver.ContentType.Name));
|
|
|
|
|
Filters.Add(new ActivatingFilter<CommonAspect>(BlogPostDriver.ContentType.Name));
|
|
|
|
|
Filters.Add(new ActivatingFilter<RoutableAspect>(BlogPostDriver.ContentType.Name));
|
|
|
|
|
Filters.Add(new ActivatingFilter<BodyAspect>(BlogPostDriver.ContentType.Name));
|
2010-01-11 21:05:24 +00:00
|
|
|
Filters.Add(new StorageFilter<CommonVersionRecord>(commonRepository));
|
2009-12-07 09:39:09 +00:00
|
|
|
|
2009-12-10 07:41:31 +00:00
|
|
|
OnCreated<BlogPost>((context, bp) => bp.Blog.PostCount++);
|
2009-12-09 23:07:00 +00:00
|
|
|
}
|
2009-11-20 23:31:49 +00:00
|
|
|
}
|
|
|
|
|
}
|