About This Code
Brief Description:
CNotes - LotusScript extension Script Library using Notes C API calls
Contributor:
Mika Heinonen
Document Release:
0.2.5 BETA
Notes Version:
R4.x, R6.x, R5.x, R7.x
Last Modified:
10 Apr 2006
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
CNotes is an extension to LotusScript, using only C API calls.
CNotes is used as a script library called "CNotes".
The source code is only meant for developers who want to participate in the development of CNotes.
The source code is not needed by programmers who use CNotes in their applications, nor users who use the applications. Programmers just copy the compiled CNotes script library into their template or database.
See CNotes home page for disclaimer and documentation:
http://siipi.com/cnotes
Source Code for CAPI.lss, which is used as include file in CNotes Script Library:
http://siipi.com/cnotes/capi.lss
Usage / Example
'EXAMPLE 1: Rebuild Notes View:
(Options)
Use "CNotes" ' Download CNotes Script Library from http://siipi.com/cnotes
Sub Initialize
Dim cdb As New CDatabase
cdb.Open "ServerName", "Directories/Database.nsf"
Set cvw = cdb.GetView("ViewName")
cvw.Rebuild
End Sub
'EXAMPLE 2: Change Database Replica ID:
(Options)
Use "CNotes" ' Download CNotes Script Library from http://siipi.com/cnotes
Sub Initialize
Dim cdb As New CDatabase
cdb.Open "ServerName", "Directories/Database.nsf"
cdb.SetReplicaID "1234567800ABCDEF"
End Sub
'EXAMPLE 3: Plugin into already opened NotesView:
(Options)
Use "CNotes" ' Download CNotes Script Library from http://siipi.com/cnotes
Sub Initialize
Dim db As New NotesDatabase ("", "")
Dim cvw As New CView
db.Open "Server","Directories/Database.nsf"
Set view = db.GetView ("ViewName")
cvw.Plugin view
MsgBox cvw.GetTitle
End Sub
'EXAMPLE 4: Set database replication settings to replicate only selected views:
(Options)
Use "CNotes" ' Download CNotes Script Library from http://siipi.com/cnotes
Sub Initialize
Dim cdb As New CDatabase
cdb.Open "ServerName", "Directories/Database.nsf"
cdb.SetReplicationViews "ViewName1;ViewName2;ViewName3"
End Sub
Comments
Posted by Rob Axelrod on 01/29/2008 10:51:32 AMGREAT STUFF! Thanks Mika!
The replication sub was exactly what I needed.
Rob