|
|
|
|
|
|
|
|
|
|
|
|
|
|
Domino 5.0 LotusScript enhancements: the NotesReplication class (continued)
The properties are very easy to manipulate. The NotesReplication class is derived from the NotesDatabase class, so you must instantiate a NotesDatabase object before you can work with the replication settings via a NotesReplication object.
The following example manipulates the various properties of the NotesReplication class.
First, we'll define our data items and declare the NotesReplication object.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rep As NotesReplication
Set db = session.CurrentDatabase
|
Next, instantiate the NotesReplication object using the ReplicationInfo property of the NotesDatabase class:
Set rep = db.ReplicationInfo
It's always a good idea to see if the object was created. If so, continue by setting all of the properties. The WITH statement is a useful tool that prevents you from having to code long property declarations.
If Not (rep Is Nothing) Then
With rep
.Abstract = True
.CutoffDelete = True
.CutoffInterval = 10
.Disabled = False
.DoNotBrowse = False
.DoNotCatalog = True
.HideDesign = False
.IgnoreDeletes = False
.IgnoreDestDeletes = True
.MultiDBIndex = True
.NeverReplicate = False
.NoChronos = False
|
Next, set the replication priority to medium.
.Priority = DB_REPLICATION_PRIORITY_MED
|
The possible priority values are DB_REPLICATION_PRIORITY_LOW, DB_REPLICATION_PRIORITY_MED, DB_REPLICATION_PRIORITY_HIGH, and DB_REPLICATION_PRIORITY_NOTSET.
Finally, save the replication settings via the Save method. Then wrap up the various data blocks:
Call .Save()
End With
End If
|
Methods We've seen the Save method in action in the previous example. The Save method saves the replication settings. This method must be called for replication settings to take effect. There are two other methods at our disposal:
- ClearHistory: Clears the replication history. The system will think the database has never been replicated;
- Reset: Resets the replication properties to their last saved values.
The next example resets the replication settings for a database and clears its history:
Dim session As New NotesSession
Dim db As NotesDatabase
Dim rep As NotesReplication
Set db = session.CurrentDatabase
Set rep = db.ReplicationInfo
If Not (rep Is Nothing) Then
Call rep.Reset()
Call rep.ClearHistory()
End If
|
That concludes our look at replication and the new NotesReplication class. While it does not allow us to control the replication formula, it does grant us access to the numerous replication settings for a database.
John Carini is the Chief Software Architect at iEnterprises, Inc. iEnterprises is the developer of iExtensions for Notes, a Domino-based CRM solution. Prior to joining iEnterprises, Mr. Carini was a principal at Corporate Systems Design, Inc. a software consulting entity. Earlier in his career, Mr. Carini developed a commodities trading system on the IBM iSeries for a worldleading commodity trading firm. He received his bachelor's of science degree in Engineering Sciences from St. John's University and is a Certified Lotus Professional in Notes Releases 4 and 5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Struggling with exporting Notes data to spreadsheets? No More!
Try IntelliPRINT, The world's leading Reporting, Dashboards, and Analysis solution for Notes & Domino
- Don't spend unproductive time maintaining different versions of the same spreadsheet
- Preserve data integrity and security in multi-user environments
- Create reports in minutes INSIDE Notes
- Get freedom from iterative report requests, deliver self-serve capabilities
Experience Reporting, Dashboards, and Analysis INSIDE Notes.
Try IntelliPRINT NOW! |
|
|
|
|
|
|
|
|
|
|