Ever since Sitecore 8.2 was released, I have been planning to look at the new Publishing Service. One of the primary reasons was for me to find out the impact it has on my Publish Exclusions module. And I finally managed to get the time this weekend to look into the Publishing Service. Setting up the service has been well documented in Sitecore Developer Portal and is also nicely explained by Jonathan in his post here.
Over the next few posts, I will try to share whatever I have learned about Publishing Service. Hopefully some of you may find it useful. In this post specifically, I would like to discuss about the different Publish Types available with the Publishing Service.
Legacy Publish Modes
To set the context, let us revisit the publish modes available with the legacy publishing approach. In fact, I should not be calling it “legacy”, as this is still the default publishing option when you install Sitecore.
- Incremental ⇒ publishes any changes that have happened since the last publish, and thereby makes it the fastest publishing option. This approach makes use of the PublishQueue table for tracking content changes and the Properties table to track the last publish time.
- Smart ⇒ publishes differences between the source and target database by comparing the Revision field of the items between the databases.
- Full ⇒ does a complete republish irrespective of whether items have changed or not, and thereby is the slowest publish option.
- Single Item ⇒ this approach publishes a content item along with the option to publish its children and any related items. The single item publish can be done by either using a Smart Publish or using a Republish option.
New Publish Types
When you have installed and configured the new Publishing Service, you will notice that the Publishing Dialogs and the publish modes in them are no longer the same – you do not see Incremental or Smart publish option. This section should throw some light on the new publish types available and how they function.
1. Single Item
This is used when you publish a single item, along with the option to publish its children (sub-items) as well as related items. This publish approach compares the Revision field of the item across the two databases to determine if the item has changed in the authoring database and then does a publish accordingly. So it is primarily same as the Smart Publish option we had with the legacy approach.
The Single Item publish is invoked from the Content Editor or Experience Editor.
2. Full Publish
In this case, all content in the Sitecore instance is published using a Smart Publish approach, i.e., based on Revision field comparison. So this effectively the Single Item publish with “publish subitems” option and the item being “/sitecore”.
This publishing option is invoked from the publishing dashboard by administrators.
3. Full Re-publish
All content in the Sitecore instance is completely re-published irrespective of whether items have changed or not. Unlike the above publish types, this option does not use the Smart Publish approach.
This publishing option is also invoked from the publishing dashboard by administrators.
Note: apparently you can configure the Sitecore roles that will need access for pull publish and re-publish in Sitecore.Publishing.Service.config, but I have not been able to get this working for non-administrators even with the configuration.
<api> <services> <allowedFullPublishRoles> <!--This is a list of the roles that are able to perform a Full Re-publish--> <!-- <role>sitecore\Sitecore Client Publishing</role> --> </allowedFullPublishRoles> </services> </api>
4. Site Publish
This approach does an incremental publish of the entire Sitecore instance since the last publish, by leveraging changes recorded in the Publishing Queue. Do note that the Publish Queue used here is not the same as what the legacy approach uses, but instead it is a completely different table (Publishing_PublisherOperation). I will talk a bit more about the database changes in a future post.
The Site Publish is invoked from the Content Editor.
In conclusion, the new Publish Types are quite similar to the legacy Publish Modes in terms of how it functions, but is implemented and invoked differently. Atleast that has been my understanding so far based on the exploration I have done so far… 🙂