private void DocumentOnAfterUnPublish(Document sender, UnPublishEventArgs unPublishEventArgs) { // todo: check whether this event is thrown when node is automatically unpublished by umbraco (after certain datetime) ClearCaches(sender); }
public void UnPublish() { UnPublishEventArgs e = new UnPublishEventArgs(); FireBeforeUnPublish(e); if (!e.Cancel) { _published = ApplicationContext.Current.Services.ContentService.UnPublish(Content); FireAfterUnPublish(e); } }
private static void OnDocumentUnpublished(Document sender, UnPublishEventArgs e) { var page = CmsService.Instance.GetItem<Page>(new Id(sender.Id)); if (page == null) return; if (!page.Template.Path.StartsWith("/WebPage")) return; SearchBackgroundCrawler.QueueDocumentDelete(page); }
/// <summary> /// Raises the <see cref="E:BeforeUnPublish"/> event. /// </summary> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected virtual void FireBeforeUnPublish(UnPublishEventArgs e) { if (BeforeUnPublish != null) BeforeUnPublish(this, e); }
/// <summary> /// Raises the <see cref="E:AfterUnPublish"/> event. /// </summary> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> protected virtual void FireAfterUnPublish(UnPublishEventArgs e) { if (AfterUnPublish != null) AfterUnPublish(this, e); }
private void OnAfterUnPublish(Document sender, UnPublishEventArgs e) { ClearSitemapCache(sender); }
protected void Document_AfterUnPublish(Document sender, UnPublishEventArgs e) { ClearCache(); }
public void UnPublish() { UnPublishEventArgs e = new UnPublishEventArgs(); FireBeforeUnPublish(e); if (!e.Cancel) { SqlHelper.ExecuteNonQuery(string.Format("update cmsDocument set published = 0 where nodeId = {0}", Id)); _published = false; FireAfterUnPublish(e); } }