Search DominoPower's 11,443 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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.


« Previous  ·  1  ·  2
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Syncing Notes with Android phones
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
Latest Lotus Headlines
Xpages not loading? JVM errors? - Solution
How to implement an iCalendar feed into your Notes calendar with XPages
DWA Hotfixes for Domino 8.5.1FP1 - A Gotcha
IBM Adds DB2 to Lotus Foundations SMB Package
SNTT : XPages onclick Ghosts in the machine
Ports used by Lotus Sametime 8.5 servers
Exploring a Domino Date Bug
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Online safety for virtual learning
David Gewirtz Online: CNN commentary and analysis
OutlookPower: Seek and find: Strategies to locate filed-away emails fast
-- 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!

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login