Live Publishing Status


See publishing status in SiteEdit � live

Live Publish Status (LPS) allows you to view the items that are currently being published without refreshing, this information is displayed on all pages of staging/Development servers and allows instant access to the following information, How many items in the publish queue and who it is publishing, if the page you are looking at is scheduled for publishing etc, when the page was last published to staging/Development and how long it took to publish the last time.

How it works

Once the code is running on your server, you will get a status window on each page that will look like this.

Don�t forget to put the password in the publishstatus.asp page.

1. Create a TBB with the following code in it

Dim IS_PREVIEW_MODE: IS_PREVIEW_MODE = (Instr(1, RenderMode, "preview", 1) > 0)

Function InitializePublishStatus()

             If Not IS_PREVIEW_MODE Then

                         WriteOut "<%If Instr(Request.ServerVariables(""SERVER_NAME""),""staging."") > 0 Then%>"& VBNEWLINE

                         WriteOut "          <script type=""text/javascript"">"& VBNEWLINE

                         WriteOut "          document.write(""<div id='PublishStatus'></div>"");"& VBNEWLINE

                         WriteOut "          xmlhttpPost('URL_TO_PUBLISH_STATUS_PAGE_ON_STAGING_PRESENTATION_SERVER.asp?tcm="& objContext.ID &"');"& VBNEWLINE

                         WriteOut "    </script>"& VBNEWLINE

                         WriteOut "<%End If%>"& VBNEWLINE

             End If

End Function

2. Create a JS file and include it on all webpages

function xmlhttpPost(strURL) {

     var xmlHttpReq = false;

     var self = this;

     // Mozilla/Safari

     if (window.XMLHttpRequest) {

         self.xmlHttpReq = new XMLHttpRequest();

     }

     // IE

     else if (window.ActiveXObject) {

         self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");

     }

     self.xmlHttpReq.open('POST', strURL, true);

     self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');

     self.xmlHttpReq.onreadystatechange = function() {

         if (self.xmlHttpReq.readyState == 4) {

             updatepage(self.xmlHttpReq.responseText);

         }

     }

     self.xmlHttpReq.send();

             var f = function() {xmlhttpPost(strURL); };

             setTimeout(f, 2000);

}

function updatepage(str){

     document.getElementById("PublishStatus").innerHTML = str;

}


3. Add the following lines to page templates that should have LPS on

#include "tcm:X-XX-2048" ' TBB with InitializePublishStatus function in

InitializePublishStatus()%]


Developer
Company
:    SDL
License agreement
Download package
Tags
:    live,  publish,  status,  queue,  refresh,  instant
Version
:   1.0
Source
:   Yes

About the Author
Mark Richardson
Web Manager

I am responsible for developing SDL's web presence and capabilities through the SDL Tridion CMS platform. Me and my team own the development of sdl.com, lspzone.com, translationzone.com, sdltridion.com and will be migrating sdltrisoft.com into our SDL Tridion platform. I also manage the integration from websites to SalesForce.

SDL