LotusScript to C API Programming Guide

rtLib Domino Rich Text Management template
Home
Show details for ContentContent
Purchase
Ready-to-use samples
Show details for Online resourcesOnline resources
Forum
Links
Happy readers

Anonymous

login


 

Hosted by Prominic.NET, Inc.
Main topic: Problems using Selective Replication Settings sample code on R5 database

Problems using Selective Replication Settings sample code on R5 database (by Andrew Luder, 01/23/2004 08:47:31 PM)

Making all the items of type TEXT to TEXTLIST has done the trick on the R5 database advanced relication settings design document. As you stated whether items were flagged as SUMMARY made no difference.

I have an Admin Toolbox database where one of its tools creates replicas of selected mail databases on ServerX onto ServerY. The new replicas on ServerY must not receive documents more than 14 days old from Any Server ("-") due to bandwidth limitations. A part of the code that deals with advanced replication settings that I'm now experimenting with reads as:

Dim s As New NotesSession

Dim ndb As NotesDatabase

dim targetserver As New NotesName("ServerY/SERVER/COMPANYZ/AU")

Dim ndbTarget As New NotesDatabase(targetserver.abbreviated,"maildb.nsf")

If Not ndbTarget.isOpen Then ndbTarget.open "",""

Dim docReplicationNote As NotesDocument   

Dim doc As NotesDocument, replication As replicationTable

Dim FormulaTextLength As Integer, rethFormula As Long,hNote As Long

Dim  retFormulaLength As Integer, retCompileError As Integer, wdc As Integer,irc As Integer

Dim formula As String    

Dim aRecServer As recServer

Set replication = New replicationTable(ndbTarget)

   

If replication.isValid Then

   Set docReplicationNote = replication.getFirst

   Do While Not docReplicationNote Is Nothing

   Set aRecServer = getServer (docReplicationNote)

   Set recServers (aRecServer.Title) = aRecServer

   Print "add server..." , aRecServer.Title          

   Set docReplicationNote = replication.getNext

   Loop

      

   Forall rs In RecServers         

   Forall ss In rs.Servers         

      Print "When server", rs.Title, "receives from:",ss.Title

      If rs.Title = targetserver.canonical And  

                   ss.Title = "-" Then   

         ss.Formula = {((@Today - @Created)/86400) < 15}

         rs.update

      End If                  

   End Forall            

   End Forall   

   'Make all the items of type TEXT to TEXLIST on selected R5 design document

   

   Set docReplicationNote = replication.getFirst

   Do While Not docReplicationNote Is Nothing   

   If docReplicationNote.~$TITLE(0)= targetserver.canonical _

        And  docReplicationNote.~$REPLSRCSERVERS(0) = "-" Then

      If W32_NSFNoteOpen (replication.hDb, Val("&h" & _  

              docReplicationNote.NoteID),OPEN_EXPAND, hNote)=0 Then               W32_NSFNoteUpdate hNote, 0            

         W32_NSFNoteClose hNote            

      End If

   End If

        Set docReplicationNote = replication.getNext

   Loop

End If   

The advanced replication settings sample code in the book may work with R4 and R6 databases but all the variations (executed from same/different databases) I tried with R5 databases through a R5 client didn't work.

Notes is a black art....

Thanks for your assistance.