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);
 }
Example #2
0
        public void UnPublish()
        {
            UnPublishEventArgs e = new UnPublishEventArgs();

            FireBeforeUnPublish(e);

            if (!e.Cancel)
            {
                _published = ApplicationContext.Current.Services.ContentService.UnPublish(Content);
                
                FireAfterUnPublish(e);
            }
        }
Example #3
0
 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);
 }
Example #4
0
 /// <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);
 }
Example #5
0
 /// <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);
 }
Example #6
0
 private void OnAfterUnPublish(Document sender, UnPublishEventArgs e)
 {
     ClearSitemapCache(sender);
 }
 protected void Document_AfterUnPublish(Document sender, UnPublishEventArgs e)
 {
     ClearCache();
 }
 protected void Document_AfterUnPublish(Document sender, UnPublishEventArgs e)
 {
     ClearCache();
 }
		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);
		}
Example #10
0
        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);
            }
        }