Sean Holmesby

.NET and Sitecore Developer

By

Sitecore Publish Queue and Incremental Publish

I’ve recently been looking into the Publish Queue and using Incremental publish on our projects.
Out of the site publish modes available, Incremental publish is the quickest publishing option.

I wanted to look into how this works.
In the past we’ve always made our updates and individually published every changed item on it’s own. This can be very time consuming so I wanted to see if there’s a better way.

Ways to View the Publish Queue

Using the Sitecore API

I found some different ways to view the publish queue.

Beginning with Brian Pedersen’s blog post I wrote an application that simply lists the publish queue using his ‘current view’ method.

Sitecore.Data.Database master = Sitecore.Data.Database.GetDatabase("master");
Sitecore.Data.Database web = Sitecore.Data.Database.GetDatabase("web");
 
Sitecore.Publishing.PublishOptions options = new Sitecore.Publishing.PublishOptions(master, web, Sitecore.Publishing.PublishMode.Incremental, Sitecore.Globalization.Language.Parse("en"), DateTime.Now);
 
// Get all the publishing candidates
System.Collections.Generic.IEnumerable candidates = Sitecore.Publishing.Pipelines.Publish.PublishQueue.GetPublishQueue(options);

Using Sitecore Rocks

In Rocks you can access the publish queue through the context menu by right clicking on an item in Sitecore Explorer and choosing
Tools -> Publishing -> Publish Queue
Publish Queue - Sitecore Rocks
Publish Queue - Sitecore Rocks

Note: You can also access this quickly using Commandy or by adding the selection to your favourites if you use it often enough.

Looking at the SQL table dbo.PublishQueue

If you open up SQL Server and locate the Publish Queue table in your master database you can view all the entries that Sitecore has made to it.
Publish Queue - SQL Table

Comparing all the queues

When looking at these three options I found that I was getting slightly different subsets in each.
The largest set of results came from the SQL Server table, while the smallest set came from the API code.

I noticed the following:-

  • The SQL table could contain multiple references to the same item. I assume this means that the one item could have been edited multiple times, and been added to the table each time.
  • The Rocks Publishing Queue viewer contained singular references to all items found in the SQL table.
  • The API code gave a subset of the Rocks queue, and only listed items that had been updated relatively recently.

How does incremental publish work with the Publish Queue

The incremental publish works the same way as the API code above. I found that the API code only grabs items that were updated more recently than the date and time of the last incremental publish.
Sitecore stores the date and time of the last publish in the dbo.Properties table for every target database and language.
This can also be accessed in code using:-

Database.Properties.GetLastPublishDate(Database target, Language language)

Code Reference

This is also how the Incremental Publish works. Sitecore grabs all the items from the Publish Queue table that were modified more recently than the last publish date.

By doing this, only recently changed items (in the final workflow state) will be published.

By

Sitecore Access Denied Exception in the Content Editor

Recently I noticed a lot of the following errors coming through from our Sitecore content entry server.

System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Sitecore.Exceptions.AccessDeniedException: Application access denied.
at Sitecore.Diagnostics.Assert.HasAccess(Boolean accessAllowed, String message)
at Sitecore.Shell.Applications.Analytics.TrackingField.TrackingFieldDetailsPage.OnLoad(EventArgs e)
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> Sitecore.Exceptions.AccessDeniedException: Application access denied.
at Sitecore.Diagnostics.Assert.HasAccess(Boolean accessAllowed, String message)
at Sitecore.Shell.Applications.Security.SecurityDetails.SecurityDetailsPage.OnLoad(EventArgs e)

Read More

By

Razl Dazl: The Sitecore Database Compare Tool

A while back I blogged about getting the latest data from production back into your local Sitecore instance.
In the post I showed how it was possible to do using Hedgehog Development‘s Team Development for Sitecore.

Now there’s another tool out there that allows you to do this, in a far cleaner way.
The geniuses at Hedgehog have released Razl, a Sitecore database compare tool, which allows you to port content back and forth between Sitecore installations.

Read More

By

Sitecore Rocks: Presentation with the Layout Designer

I originally published this post on the Igloo blog.

Recently I’ve been attempting to setup pages by adding sublayouts and renderings through the interface in Sitecore Rocks. I thought I’d share some of my experiences.

Note: When explaining my findings here I am referring how Sitecore Rocks deals with presentation settings in version 0.7.15.3. These features may change in future versions.

Read More