Publishing and Date Last Updated
We're using RoboHelp 8.02 using the WebHelp SSL. There have been several discussions on how to effectively incorporate a "date last updated" in RoboHelp. I thought I'd found a strategy that worked, but now, publishing seems to have some random behavior that's throwing a kink into the strategy. Help me understand if my understanding of what "publish" does in RoboHelp is correct and what I may be doing wrong. My strategy is:
- I add a JavaScript script at the bottom of each page that pulls in, formats, and displays the file's Date Modified attribute.
- I generate the project locally.
- I publish the project to the server. (We're in a LAN environment where I can publish directly to the Web server.) The Publish settings are:
- Check for deleted files: Selected
- Prompt before overwriting files: Unselected
- Republish all: Unselected
It has been my understanding that, with Republish all turned off, RoboHelp would only move files that had been changed to the server when publishing. In that way, the old files on the server (and hence displayed to the reader) would continue to show the an older date, and the newly published files would show the newer date.
However, when we recently published one project, it appears that RoboHelp randomly moved some files that had not been modified to the server. Interestingly, it wasn't all the unmodified files, just some of them, and a random selection at that. Am I missing something, or is the behavior a bug?
For those who might be interested, the JavaScript that I use is:
<script type="text/JavaScript"
language="JavaScript"><!--
//
// format date as dd-mmm-yy
// example: 12-Jan-99
//
function date_ddmmmyy(date)
{
var d = date.getDate();
var m = date.getMonth() + 1;
var y = date.getYear();
// handle different year values
// returned by IE and NS in
// the year 2000.
if(y >= 2000)
{
y -= 2000;
}
if(y >= 100)
{
y -= 100;
}
// could use splitString() here
// but the following method is
// more compatible
var mmm =
( 1==m)?'Jan':( 2==m)?'Feb':(3==m)?'Mar':
( 4==m)?'Apr':( 5==m)?'May':(6==m)?'Jun':
( 7==m)?'Jul':( 8==m)?'Aug':(9==m)?'Sep':
(10==m)?'Oct':(11==m)?'Nov':'Dec';
return "" +
(d<10?"0"+d:d) + "-" +
mmm + "-" +
(y<10?"0"+y:y);
}
//
// get last modified date of the
// current document.
//
function date_lastmodified()
{
var lmd = document.lastModified;
var s = "Unknown";
var d1;
// check if we have a valid date
// before proceeding
if(0 != (d1=Date.parse(lmd)))
{
s = "" + date_ddmmmyy(new Date(d1));
}
return s;
}
//
// finally display the last modified date
// as DD-MMM-YY
//
document.write(
"This page was last updated on " +
date_lastmodified() );
// --></script>
