X

Register now for unlimited access to Sitecore resources.


Already have an account? Log in now

*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
X

Request a demo

It’s easy to get started. Sign up for a personalized demo.

*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.
Sitecore Blog: @sitecorejohn blog

Manage Publication of Deletions with the Sitecore ASP.NET CMS

By John West, September 19, 2011 | Rating:  | Comments (5)

This blog post describes how the Sitecore ASP.NET CMS publishes items that you delete from the Master database used for content management to the publishing target database(s) supporting content delivery. The Publish deleted items thread and many other threads on the Sitecore Developer Network (SDNforums prompted me to write this blog post. For more information about publishing and publishing targets, see my blog post All About Publishing Targets in the Sitecore ASP.NET CMS.

By default, Sitecore has no workflow for deleted items. Some publishing operations, such as incremental, smart of republishing of the entire site, publish all deleted items to the publishing target databases. Other publishing operations, such as the commands on the ribbon in the Content Editor to publish individual items and branches, do not always publish all deletions, but only deleted items that were children or otherwise descendants of the published item. Publishing a deleted item publishes the deletion of its descendants in the same way that deleting an item deletes its descendants. For more information about workflow with Sitecore, see the Workflow Reference and the Workflow Cookbook on SDN.

I can imagine several potential alternative strategies for managing deletion, but I'm not sure which would be most desirable. For example, you could:

  1. Override deletion commands in the user interface to not delete the item, but place it in a workflow containing a workflow action for the final state that deletes the item and publishes that deletion. In fact, SDN contains a Delete Item Workflow Action for Sitecore 5.3 that might be useful for this task, but may require some updates to work with current versions.
  2. Override deletion commands (at least, for most users and items), and add a Delete command to one or more workflows to trigger a deletion action as described above. Remember to set access rights on the workflow command that triggers deletion.
  3. Override the workbox to list items in the recycle bin, and the publishItem processor to respect the workflow state of deleted items. This would probably be a considerable effort. For an example publishItem processor, see my blog post Intercept Item Publishing with the Sitecore ASP.NET CMS.
  4. Add publishing commands to the recycle bin.

 

There are probably numerous other approaches depending on varying requirements. You may not have noticed the post number in the last post linked in the introduction to this blog post. This issue goes back to at least 2006. Sitecore Customer Service almost certainly has one or more solutions available.

Please comment on this forum thread if you have any experience with or ideas about managing publication of deleted items with the Sitecore ASP.NET CMS, or to indicate the strategy you favor for managing deletion.

Tags: Architecture, Infrastructure

Comments

  • Hi John,

    I'm new to Sitecore. I was just wondering if you can point me in the right direction for Sitecore DMS 2.0 tutorial.

    Much appreciated,
    Dyni

    - Dyni Mao
    September 26, 2011 at 12:51 PM

  • @Dyni: Start with the "Engagement" titles under http://sdn.sitecore.net/Reference/Sitecore%206.aspx and post again if those don't seem to be what you need or if you still have questions.

    - John West
    October 12, 2011 at 11:15 AM

  • You made some good points there. I did a search on the topic and found most people will agree with your blog. Thanks

    - Karnataka Bank
    January 24, 2012 at 11:10 PM

  • Hi John, I just run into this post because some contentmanagers of our customer keep forgetting to publish the parentitem after deleting an item.
    Instead of adding workflow, is it also possible to change the concept of deleting an item from what is is now (delete, and manually publish the parent) to "delete and publish the deleted item"?

    Would that work? I mean.. is it possible to intercept the delete event and publish the deleted item immediately? I am sure that most contentmanagers do not have any problem when they know that a delete command will perform a delete-and-publish.

    - Nico Lubbers
    August 06, 2013 at 2:38 AM

  • @Nico: I don't know if you can explicitly publish the deletion of a single item. I don't know what would happen if you passed the ID or some other format of a deleted item through the relevant APIs; I would expect an exception. Maybe you could publish the parent (and descendants?) of the deleted item, assuming any updates to those items are in workflow or have other publishing restrictions as appropriate. Or publish something irrelevant (the /sitecore item without descendants?). Another option would be to trap deletion or override deletion commands to remove the item from all publishing target databases, but that would not trigger output cache clearing by default.

    - John West
    August 06, 2013 at 9:21 AM

*{0} must be filled in.
*{0} must be filled in.
*{0} must be filled in.