public PublishLaterPartHandler( IPublishLaterService publishLaterService, IPublishingTaskManager publishingTaskManager) { _publishLaterService = publishLaterService; OnLoading <PublishLaterPart>((context, part) => LazyLoadHandlers(part)); OnVersioning <PublishLaterPart>((context, part, newVersionPart) => LazyLoadHandlers(newVersionPart)); OnRemoved <PublishLaterPart>((context, part) => publishingTaskManager.DeleteTasks(part.ContentItem)); OnPublishing <PublishLaterPart>((context, part) => { var existingPublishTask = publishingTaskManager.GetPublishTask(context.ContentItem); //Check if there is already and existing publish task for old version. if (existingPublishTask != null) { //If exists remove it in order no to override the latest published version. publishingTaskManager.DeleteTasks(context.ContentItem); } }); }
public DateTime?GetScheduledPublishUtc(BlogPostPart blogPostPart) { var task = _publishingTaskManager.GetPublishTask(blogPostPart.ContentItem); return(task == null ? null : task.ScheduledUtc); }
DateTime?IPublishLaterService.GetScheduledPublishUtc(PublishLaterPart publishLaterPart) { IScheduledTask task = _publishingTaskManager.GetPublishTask(publishLaterPart.ContentItem); return(task == null ? null : task.ScheduledUtc); }