 |
Software > Lotus >
|
 |
 |
 |
Revision history date displays in a different format than the Document Profile date
|
| | | | Problem | | For a Lotus Domino Document Manager server running on i5/OS, the Revision History date displays in an unexpected format. The server locale on an iSeries v5r3 is set to YMD. The Document Profile created date displays as 2006-05-29; however, the Revision History date displays as 06-5-29. You expect the revision date to display the same as the document created date in the Document Profile. | | | | |  | | | Cause | | On iSeries, the QDATE is made up of QYEAR, QMONTH, and QDAY, but not QCENTURY. QYEAR is a 2-digit year. Because Domino Document Manager builds a table based on a general date, the date appears as 06-5-29. This is a limitation of the iSeries operating system. | | | | | Resolving the problem | | To work around the display limit, you can make a change in the RevisionHistory class in the script library of the File Cabinet template (filecab.ntf), then propagate the change to every file cabinet on the system. The change is made to the RevisionHistory class and involves two lines that are used to format the date and time.
function: Format$(dt.LSLocalTime, "General Date") changes to: Format$(dt.LSLocalTime, "yyyy-mm-dd hh:mm:ss")
======================================= Script Library /Document2 /Declarations /Revision History
Public Class RevisionHistory As ErrorObject
Sub New(doc As NotesDocument, IsWeb As Integer), ErrorObject("RevisionHistory")
Dim db As NotesDatabase
Dim verview As NotesView
Dim item As NotesItem
Dim dt As NotesDateTime
Dim username As NotesName
If doc Is Nothing Then
Exit Sub
End If
On Error Goto ProcessError
Set db = doc.ParentDatabase
If doc.DocID(0) = "" Then
Exit Sub
End If
Set revStuff = New NotesRichTextItem(doc, "dynamicTable")
Dim link$, table$, webUserName$
Set revNum = New NotesRichTextItem(doc, "r")
Set revDateTime = New NotesRichTextItem(doc, "revDateTime")
Set revUser = New NotesRichTextItem(doc, "revUser")
Set revComments = New NotesRichTextItem(doc, "revComments")
Set verview = db.GetView("(Versions)")
Set verdoc = verview.GetDocumentByKey(doc.DocId(0))
If IsWeb Then
table$ = "<TABLE BORDER=0 CELLSPACING=0>"
table$ = table$ + "<TR VALIGN=top><TD NOWRAP=NOWRAP WIDTH=""60""><LEFT><B><U>" + esNumRevHistTableLable + "</U></B></CENTER></TD><TD NOWRAP=NOWRAP WIDTH=""150""><B><U>" + esDateTimeRevHistTableLable + "</U></B></TD>"
table$ = table$ + "<TD NOWRAP=NOWRAP WIDTH=""200""><B><U>" + esUserRevHistTableLable + "</U></B></TD><TD NOWRAP=NOWRAP WIDTH=""370""><B><U>" + esCommentsRevHistTableLable + "</U></B></TD></TR>"
End If
Do While Not (verdoc Is Nothing)
If verdoc.DocId(0) <> doc.DocId(0) Then
Exit Do
End If
verdisp$ = Str$(verdoc.Version(0)) & "." & Str$(verdoc.Draft(0))
If IsWeb Then
Set item = verdoc.GetFirstItem("LastModDate")
Set dt = item.DateTimeValue ' changed format$ from "General Date"
link$ = "<a href= /" + GetRelDbPath() + "/All+Documents/" + verdoc.UniversalID + "?OpenDocument>" + (Format$(dt.LSLocalTime, "yyyy-mm-dd hh:mm:ss")) + "</a>"
Set username = New NotesName(verdoc.LastModBy(0))
If username.IsHierarchical Then
webUserName$ = username.Abbreviated
Else
webUserName$ = username.Common
End If
If verdoc.UniversalID = doc.UniversalID Then
table$ = table$ + "<TR VALIGN=top><TD NOWRAP=NOWRAP WIDTH=""60""><LEFT><Font Size=""2"">*" + verdisp$ + "<Font></CENTER></TD>"
Else
table$ = table$ + "<TR VALIGN=top><TD NOWRAP=NOWRAP WIDTH=""60""><LEFT><Font Size=""2"">" + verdisp$ + "</Font></CENTER></TD>"
End If
table$ = table$ + "<TD NOWRAP=NOWRAP WIDTH=""150""><Font Size=""2"">" + link$ + "</Font></TD>"
table$ = table$ + "<TD NOWRAP=NOWRAP WIDTH=""200""><Font Size=""2"">" + webUserName$ + "</Font></TD>"
table$ = table$ + "<TD NOWRAP=NOWRAP WIDTH=""370""><Font Size=""2"">" + verdoc.VerComment(0) + "</Font></TD></TR>"
End If
If Not IsWeb Then
If verdoc.UniversalID = doc.UniversalID Then
revNum.AppendText("*")
End If
Call revNum.AppendDocLink(verdoc, "")
Call revNum.AppendText(verdisp$)
Set item = verdoc.GetFirstItem("LastModDate")
Set dt = item.DateTimeValue ' changed format$ from "General Date"
Call revDateTime.AppendText(Format$(dt.LSLocalTime, "yyyy-mm-dd hh:mm:ss"))
Set username = New NotesName(verdoc.LastModBy(0))
If username.IsHierarchical Then
Call revUser.AppendText(username.Abbreviated)
Else
Call revUser.AppendText(username.Common)
End If
displayComment$ = Left$( verdoc.VerComment( 0 ) , 180 )
Call revComments.AppendText( displayComment$ )
Call revNum.AddNewLine(1)
Call revDateTime.AddNewLine(1)
Call revUser.AddNewLine(1)
Call revComments.AddNewLine(1)
End If
If IsWeb Then
Call revStuff.AppendText(table$)
table$ = ""
End If
Set verdoc = verview.GetNextDocument(verdoc)
Loop
If IsWeb Then
table$ = table$ + "</TABLE>"
Call revStuff.AppendText(table$)
End If
Exit Sub
ProcessError:
Call Me.LogError(Err, Error$, Erl, "New")
Exit Sub
End Sub
End Class
==================================== | | | | | | | | |
 |
| IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml. |
 |
 |
 |
| Please take a moment to complete this form to help us better serve you. |
 |
 |
 |
|
|
|
 |
 |
| Product categories: |
 |
| | Software |  |
| | Enterprise Content Management |  |
| | Content Management |  |
| | Lotus Domino Document Manager |  |
| | Documents Actions |  |
 |
| Operating system(s): |
| |
i5/OS
|
 |
| Software version: |
| |
6.5.1, 7.0
|
 |
| Reference #: |
| |
1239572
|
 |
| IBM Group: |
| | Software Group |
 |
| Modified date: |
| | 2009-02-09 |
 |
|