Datasource Workflow Module

Image

Greetings Readers,I have been working in sitecore all the way since version 6.0 and the way that the sitecore solutions are being designed have also been evolved. At Horizontal Integration, one of the standards we enforce in our solutions is ensuring we develop around the concept of Component Based Architecture. Jens Mikkelsen has a great blog talking about this topic.Over the years, Sitecore also have tremendously improved the Experience Editor (a.k.a Page Editor) experience and allowing content editors to author and manage their work via a WYSIWIG interface.You may think that all this is good but what it has to anything to do with this blog post?As we embraced component based approach in our solutions enabling the authors to leverage experience editor to add/manage all the components on the fly, everything was great until content governance and workflow came into the picture.A lot of content editors who are editing and managing their website in Experience Editor often complain about managing the components/data source workflow on the item itself where the components are placed. for example you have page called "News" and the content author places a component onto the page called "Awards". Now in order for the "Awards" component to be published and visible on the live site, the author will have to navigate away from the "News" item, go the "Awards" item and then approve the "Awards" item via workflow. This often causes confusion where the editor does not know the path or does not even know that the "Awards" component is not in a final workflow state and will not be visible even after publishing the "News" item.Challenge : Provide a way for content author to manage the workflow of all the data source components on the item itself.Solution : as the saying goes "A picture is worth a thousand words", so here in a snapshot what the Datasource Workflow Module does.The below image shows that the Experience Editor now adds the capability to manage the workflow of the data source components right on the item itself

PageEditor

The below image shows that the module also supports the Content Editor

ContentEditor

The module also ships with a validation action which allows us to restrict the content editor from accidentally approving the item when the data source items are in pending workflow state 

Validation Warning

Module Implementation DetailsSupports : Sitecore 7.0 through Sitecore 8.0 Update 5The gist of the module relies on getting the list of data source items from the item presentation details, my colleague Brent Svac who co developed this module with me has written a series of blog post on how to get a list of data source items from a item.How to Programmatically Get Datasource Items of a Sitecore ItemProgrammatically Get Personalization Datasource Items of a Sitecore ItemProgrammatically Get Multi Variate Test Datasource Items of a Sitecore ItemAs you can see from the above blog posts that we not only took  the datasource items present on the item, but also took into account the personalized data source and Multi variate test data sources into account.Once we have the list of data source items , then all we need is to tap into the getPageEditorNotifications pipeline to output the required notifications in the experience editor

PageEditorPipeline

For the content editor notifications, we need to tap into the getContentEditorWarnings pipeline to output the required notifications in the content editor

ContentEditorPipeline

One interesting thing about the module that only contains 3 files and can be easily maintainedInclude Config File : Website\App_Config\Include\Z_EditorDataSourceWorkflowNotifications.configDLL : Website\bin\HI.Shared.DataSourceWorkflowModule.dllSitecore Item : /sitecore/system/Settings/Validation Rules/Item Rules/Item/Components in Final Workflow StatePlease get the module hereVersion 7.0 through 7.2 : https://github.com/skjain1983/DataSourceWorkflowModule/blob/master/Packages/7/Datasource%20Workflow%20Module%207.zipVersion 7.5 and Version 8.0 (Update 1 to 5) : https://github.com/skjain1983/DataSourceWorkflowModule/blob/master/Packages/8/Datasource%20Workflow%20Module%208.zipIf you like to contribute or like to have access to the source code, here is the link https://github.com/skjain1983/DataSourceWorkflowModule