|
|
|
|
|
|
|
|
|
|
|
|
|
|
Using Python to create a command line interpreter for Notes (continued)
There are two main ways in which a scripting language like LotusScript or Python can control remote programs via COM. The explanation here should also clear up some confusion caused by the recent announcement of COM support for Notes.
The simplest method is known as "late-bound COM" and requires the scripting environment to know practically nothing about the remote program. It simply creates an object and every time a method or property is called, it makes long-winded checks that the remote object does, in fact, support that method and that the parameters are passed correctly for it.
This method is easiest for developers of scripting languages to implement and easiest for you to use in your script, but since there's so much checking of procedures and parameters on every call, it's very inefficient and hence slow. Some languages, such as VBScript, are limited to late-bound COM, and this is also what Lotus Notes clients and Domino servers have supported since the very early days. In fact, the Lotus and Microsoft teams practically developed this sort of functionality between them, in the days when it was known as OLE and COM servers were known as "OLE Automation Servers."
The alternative is "early-bound COM," which requires the COM Server to list all of its public classes, methods, and constants in a standard file (suffixed with a TLB file extension). This allows remote programs (whether they be LotusScript calling Excel, or Python controlling Notes), to understand the structure of the remote classes; cut down drastically on the amount of run-time checking; and allow programmers access to the same constants (such as color codes or outline entry types), as are available in the remote program's own development environment. When programming in LotusScript, you can see the results of this for other COM Servers in the "OLE Classes" browser, as shown in Figure B.
FIGURE B
 
Here you see the COM browser in the LotusScript IDE. Roll over picture for a larger image.
When Lotus recently announced that, with R5.0.2b, Notes would support COM, what they really meant was that Notes would support early-bound COM calls by other languages. It has always supported the earlier type of COM interface. Also, to cut out another area of possible confusion, early-bound and late-bound COM are two variants of IDispatch COM objects. COM also includes objects more suited to C++ than scripting languages, which are used in a completely different way from the COM objects described here.
In Visual Basic, the pre R5.0.2b late-bound COM call might look like this:
Dim workspace as Variant
Set workspace = CreateObject("Notes.NotesUIWorkspace")
|
Meanwhile, in early-bound COM, Visual Basic knows all about Notes classes and will let you declare classes directly. Note that from R5.0.2b onwards, both early-bound COM and late-bound COM classes have the "Lotus." prefix.
Dim session As NotesSession
Set session = CreateObject("Lotus.NotesSession")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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 --
Integrate your Notes Applications with Microsoft Office and Symphony
Integra for Notes Integrates Microsoft Office and/or IBM Lotus Symphony
Requires NO change to the design of the appliation or Installations of DLL's and EXE's
- Integra is a ready to use solution, enhance static reports with Excel data analysis, pivot tables, macros
- User friendly aproach, using a point and click access to features
- Reports from any Lotus Notes databases
- Runs reports through a Notes client, web browser and scheduled basis
- Allows use of LotusScript for advanced data manipulation
- Enables self service reporting capabilities to end-users
Learn more at www.integra4notes.com. |
|
|
|
|
|
|
|
|
|
|