Today | RSS | RDF | Atom | Other |
Advanced Search |
November 2006 | ||||||
Mon | Tue | Wed | Thu | Fri | Sat | Sun |
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | |||
Oct | Today | Dec |
At the moment I'm doing old school Notes development and needed to implement audit logging the in application. What better and easier to do than to head over to OpenNTF, grab the latest version of OpenAudit and implement it. Given I had some issues with some form aliases which I need to talk to Chad Schelfhout about it took me all of 90 minutes to implement. The component is now seamlessly embedded in the application - nice, quick and easy...
For me the the number one benefit of using open source is to be able to tweak the code to fit the exact problem domain. When creating applications I like to keep all databases for the application in a separate directory and hence group associated databases. When doing this it makes sense that the databases can automatically find the other databases of the application thus eliminating the need for additional configuration. This goes for Julians OpenLog application as well as OpenAudit. I previously implemented this for OpenLog and hence needed to do the same for Open Audit.
It proved very easy. A simple hack of the setAuditDb-method in the "Open Audit"-script library made it possible. Now when specifying "*/" at the start of the path name in the audit configuration (e.g. */OpenAudit.nsf) the method will assume that the database can be found in the same directory as the calling database.
My changes are in bold:
Public Sub setAuditDb(sServer As String, Byval sDatabase As String, sReplicaID As String) On Error Goto ErrorHandler If ( dbAudit Is Nothing ) Then If sServer = "*" Then sServer = System.ThisDatabase.Server End If If Left(sDatabase, 2) = "*/" Then 'get database relative to current directory Dim session As New NotesSession Dim current_directory As String Dim sep As String If Left(session.Platform, 3) = "Win" Then sep = |\| Else sep = |/| End If current_directory = Strleftback(System.ThisDatabase.FilePath, sep) sDatabase = current_directory + sep + Right(sDatabase, Len(sDatabase)-2) End If Set dbAudit = New NotesDatabase( sServer, sDatabase ) If dbAudit.isopen Then Else Call dbAudit.OpenByReplicaID( sServer , sReplicaID ) If dbAudit.isopen Then Else Set dbAudit = System.ThisDatabase End If End If End If Exit Sub 'Catches any invalid Replica IDs, and will uses the current database then errorHandler: Set dbAudit = System.ThisDatabase Exit Sub End Sub
Well what I wanted to discus with you was that I had some strange behavior where the AuditForm field was incorrectly calculated for my OpenAudit Configuration form. The form is called Workflow and had also Workflow as an alias (simply entered as "Workflow|Workflow" in the form property box).
For some reason (I haven't been able to reproduce it afterwards) the lookup key in the "(Open Audit Config)"-view got messed up and hence I didn't get any audit logs generated. After figuring out that this was the issue I removed the alias and re-save the form which resolved the issue. Then I added the form alias once again but then I was unable to reproduce the issue.
I'll let you know if I find a consistent way to reproduce. Thanks you to a great component and for saving my hair! :-)
P.S.: Nicely commented code... ;-)
Title | |
Body |
HTML : b, i, blockquote, br, p, pre, a class="", ul, ol, li
|
Name | |
E-mail address | |
Website | |
Remember me | Yes No |
E-mail addresses are not publicly displayed, so please only leave your e-mail address if you would like to be notified when new comments are added to this blog entry (you can opt-out later). |
|