' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' * ' * Selective replication settings ' * (class replicationTable code) ' * ' * sample code from ' * LotusScript to Lotus C API Programmer Guide by Normunds Kalnberzins, (c) 2000-2003 ' * ' * http://www.ls2capi.com ' * ' * Author: Normunds Kalnberzins ' * ' * This code has been written as a sample to illustrate aspects of handling of Lotus C API from LotusScript ' * and may be reused, modified on full responsibility of the developer and provided this notice is preserved ' * ' * The author does not guaranty it to fit any particular purpose and it is up to the developer ' * to modify, test it and determine the limits of its applicability ' * ' * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ' * * * * * * * * START (Class) [REPLICATIONTABLE] ' * * * * * * * * ' * ' * accesses replication notes in DB ' * Public Class replicationTable hDb As Long ndbTarget As NotesDatabase Public recServer List As srcServer rethList As Long ' list of replication notes noteid As Long retUntil As TIMEDATE ' search time irc As Integer ' temporary return code Public isValid As Variant ' * * * * * * * * START (Method) [NEW] ' * * * * * * * * ' * ' * init table of replication note ids ' * Public Sub new (ndb As Notesdatabase) Dim s As New NotesSession Dim retSince As TIMEDATE Set ndbTarget = ndb hDb = openDb(ndb) If hDB=0 Then Print "failed to open db" Else W32_TimeConstant TIMEDATE_MINIMUM, retSince IRC% = W32_NSFDbGetModifiedNoteTable (hDB , NOTE_CLASS_REPLFORMULA, retSince.innards(0) , retSince.innards(1) , retUntil, rethList) If irc%<>0 Then Print "%", getError(irc%) W32_NSFDbClose hDb Else Me.isValid = True End If End If End Sub ' * * * * * * * * END (Method) [NEW] ' * * * * * * * * ' * * * * * * * * START (Method) [GETFIRST] ' * * * * * * * * ' * ' * get replication note as notesdocument ' * Public Function getFirst As Notesdocument Dim irc As Integer If Me.isValid Then irc = W32_IDScan (Me.rethList, True, noteid) If irc Then Set getFirst = Me.ndbTarget.getDocumentByID(Hex$(noteid)) End If End Function ' * * * * * * * * END (Method) [GETFIRST] ' * * * * * * * * ' * * * * * * * * START (Method) [GETNEXT] ' * * * * * * * * ' * ' * get next replication note ' * Public Function getNext As Notesdocument Dim irc As Integer If Me.isValid Then irc = W32_IDScan (Me.rethList, 0, noteid) If irc Then Set getNext = Me.ndbTarget.getDocumentByID(Hex$(noteid)) End If End Function ' * * * * * * * * END (Method) [GETNEXT] ' * * * * * * * * ' * * * * * * * * START (Method) [DELETE] ' * * * * * * * * ' * ' * un unload relase resources ' * Public Sub delete If Me.isValid Then Call W32_IDDestroyTable (rethList) W32_NSFDbClose hDb End If End Sub ' * * * * * * * * END (Method) [DELETE] ' * * * * * * * * End Class' * replicationTable ' * * * * * * * * END (Class) [REPLICATIONTABLE] ' * * * * * * * *