Today | RSS | RDF | Atom | Other
 
Advanced Search
lekkimworld.com
lotus notes/domino, sametime, java...

Tags - Categories : All | IBM | Java | LotusScript | LotusScript.doc | Misc. | Sametime | SnTT | Web | XML
November 2006
MonTueWedThuFriSatSun
   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

spacer
(click to learn who I am)

spacer
(I spoke at Lotusphere 2007 - click here for demos, presentation etc.)

spacer
(Java in Notes/Domino Explained)

spacer spacer spacer spacer spacer

spacer
(click to see the blog disclaimer)

Recent Blog Entries
Beware of object scoping in Visual Basic
Microsoft Exchange protocol has been opened up
Slow blogging season
Anyone who have used the Deftype statement in LotusScript?
Problem managing your feeds? Look to the dinasaur report!
Small regexp tip
Comment feed for developerWork blogs?
TCP connection leakage with Corba sessions?

Recent Responses
Re: Beware of object scoping in Visual Basic
And there you have the explanation - I guess there's to more to the difference between VB and LotusScript than simply a little bit of syntax... Thank you for the comment! :-)

Re: Beware of object scoping in Visual Basic
Not a matter of being inside or outside the loop. Dim's are always performed at script startup no matter where they are written. So its not really a scope matter either. :). First example only creates one person object upon startup.

Re: Lotusphere 2007: Sametime 7.5 and Notes 8 sidebar compability
This implies, that current customized plug-in projects needs to be rewritten/re-targete...

Re: Anyone who have used the Deftype statement in LotusScript?
I have run across code where in the Options section there was the following: Defcur c Defdbl d Defint i Deflng l Defsng g Defstr s Defvar v Then, the coder would declare variables like this... Dim cEarnedAnnPremAccm Dim cDedAmtPerAcc Dim cDedAmtAgg...

Re: Anyone who have used the Deftype statement in LotusScript?
I have not used it, but I know people sometimes like to use the first letter to signify type, as in fCost is a float and iCount is an integer, but dCost is a double and lCount is a long.

Re: Small regexp tip
I ran into problems with reluctant qualifiers recently - it seems as if older versions of Python did not implement regex properly. It nearly drove me nuts trying to figure out what was going on. That being said, once I found out about them I went abo...

<< Force Notes to use mail.box when multiple mail.boxes are enabled | Home | Practical Web Services in IBM Lotus Domino 7: What are Web services and why are they important? >>
Permalink
[LotusScript]
Using OpenAudit to save my hair... :-)

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

TrackBacks[0] Comments[4] Posted by lekkim on 07 November 2006 22:25:52 CET

Reply | Permalink Re: Using OpenAudit to save my hair... :-)
Consider this the talk, I will add your enhancements.
Comment from Chad Schelfhout on 08 November 2006 22:32:53 CET
Reply | Permalink Re: Using OpenAudit to save my hair... :-)

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... ;-)

Comment from Mikkel Heisterberg on 08 November 2006 22:42:37 CET
Reply | Permalink Re: Using OpenAudit to save my hair... :-)
I found the issue with alias and also fixed issue with case in form name. Will be fixed with 1.2.0 which I am testing and documenting now. The relative path has been added for both the LotusScript and Log list using Formula.
Comment from Chad Schelfhout on 29 November 2006 06:54:54 CET
Reply | Permalink Re: Using OpenAudit to save my hair... :-)
Nice! :-)
Comment from Mikkel Heisterberg on 29 November 2006 17:05:01 CET


Add a comment

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).

TrackBack to lekkimworld.com/addTrackBack.action?entry=1162934752880

Powered by Pebble 1.9 (20112005 2119) [ Login ] Content © Mikkel Heisterberg (lekkim [at] lekkimworld [dot] com)
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.