« Domino Environment Part II: Library Templates | Main| Dynamic Domino Web Form Design »

Domino Extended 1.1

Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 

I was working on some updates to Open Audit, specifically the ability to delete audit logs when a document is deleted and archive audit logs when the document is archived.  One thing that I did not want to have to worry about when I was deleting or archiving (deleting -because it is being moved to another database) is if the audit log was already deleted.  Yes, I have in the past always gotten the next document before deleting the current document but I did not want have to worry about this and I know I would have to worry about it twice (archive & delete). So I created a new Domino Extended class to handle it.  This will be called NoteDocumentCollectionExtended, not a fancy name but it does all the necessary error checking!!!  I also included an example of the test code for your enjoyment.

Along the way I have updated the other Domino Extended (NotesSystem and NotesDocumentExtended) classes so I have include them also nothing major but a couple of improvements.

NotesSystem oveview

Private Class NotesSystem
        Public SubNew()
        Public Function hasWorkspace() As Boolean
        Public Function ThisWorkspace() As NotesUIWorkspace
        Public Function ThisDatabase() As NotesDatabase
        Public Function hasDocument() As Boolean
        Public Function ThisDocument() As NotesDocument
        Public Function hasUIDocument() As Boolean
        Public Function ThisUIDocument() As NotesUIDocument
        Public Function ThisSession() As NotesSession
        Public Function CurrentUser() As NotesName
        Public Function CurrentUserCommon() As String
        Public Function CurrentUserAbbreviated() As String
EndClass

NotesDocumentExtended oveview

Public Class NotesDocumentExtended
        Public Function getFieldValues ( fieldName As String) AsVariant
        Public Function getFieldItem ( fieldName As String) As NotesItem
        Public Sub replaceField ( fieldName As String , Var As Variant)
        Public Function getFieldText ( fieldName As String) As String
        Public Function getFieldAbstraction ( fieldName As String)As String
        Public Function getFieldUnformattedText ( fieldName As String) As String
        Public Function getFieldFormattedText ( fieldName As String, tabstrip As Boolean, lineLength As Integer )As String
        Public Function Public Function hasField ( fieldName AsString )As Boolean
        Public Function hasFieldText ( fieldName As String) AsBoolean
        Public Function hasDoc ( )As Boolean
        Public Function hasDocument () As Boolean
        Public Sub setDoc ( Doc As NotesDocument )
        Public Function Doc() As NotesDocument
        Public Sub setDocument ( Document As NotesDocument )
        Public Function Document As NotesDocument
EndClass

NotesDocumentCollectionExtended oveview

Public Class NotesDocumentCollectionExtended
       Public SubNew()
        Public SubClear()
        Public Sub LoadCollection ( docCollection  As NotesDocumentCollection )
        Public Function getNavFirst () As NotesDocument
        Public Function getNavLast () As NotesDocument
        Public Function getNavNext () As NotesDocument
        Public Function getNavPrev () As NotesDocument
        Public Function getCurrentDocument( )As NotesDocument
        Public Function getPrevDocument( )As NotesDocument
        Public Function getNextDocument( )As NotesDocument
        Public Function hasCurrentDocument( )As Boolean
        Public Function hasPrevDocument( )As Boolean
        Public Function hasNextDocument( )As Boolean
        Public Function hasCollection( )As Boolean
EndClass

LotusScript script library

Select All

Testing Code

Select All

Comments

1 - How about including a method 'DBColumn' in the class NotesDocumentCollectionExtended, to retrieve the values of a fields from all the documents in that collection?

2 - I will look into adding this but until then consider some work that Jerry has done:{ Link }

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)