In a recent blog I documented a new
DominoBES class that has been added to the .Domino Framework. Due to a current limitation with LotusScript , this class had to be written in Java. After doing some experimentation I found a way of abstracting the Java Implementation of the class by "extending" the Java class with a LotusScript class. In theory this allows me to not only publish a Java class as a LotusScript class but to extend the Java class with additional methods/properties developed using LotusScript.
Why bother? For one thing it is typically not a good idea to mix and match programming languages in an application as code maintenance then requires a developer with multiple programming language skills. For another, at the site where I am making use of this class there are about 30 full-time Notes developers and several hundred part-time Notes "developers", almost none of whom program in Java. By choice I am developing the .Domino Framework using LotusScript wherever I can and using Java where it makes sense to do so because the pool of Note LotusScript developers greatly exceeds the pool of Notes Java developers.
The following is the code that can be found in the latest beta version of the .Domino Framework for extending the DominoBES class. (Note: I believe both the LotusScript and Java classes can have the same name)
Option Public
Option Declare
Uselsx "*javacon"
Use "base.Domino.MailServices.BES.java"
Use "Domino.Applications"
' C L A S S b a s e D O M I N O B E S ___________________________________________________________________________ C L A S S
'/**
' * Communication with BES Server
'*
' * @author Peter Presnell
' */
Class baseDominoBES As DominoBaseClass
Private JavaSession As JAVASESSION
Private JavaClass As JAVACLASS
Private DominoBESJava As JavaObject
Private MDSHost As String
Private MDSPort As Integer
'/**
' * Constructor
' */
Sub New(),DominoBaseClass("")
Dim ApplicationSettings As New DominoApplicationSettings(Nothing)
Set JavaSession = New JAVASESSION()
Set JavaClass = JavaSession.GetClass("DominoBES")
Set DominoBESJava = JavaClass.CreateObject()
MDSHost$ = ApplicationSettings.BESServer$
MDSPort% = ApplicationSettings.BESPort%
End Sub
'/**
' * Push a browser channel to a Blackberry device. Displays one of two icons on application menu that link to a designated URL opened in teh BB browser.
' *
' * @param Email The email name of the blackberry user
' * @param PushURL The URL to be launched when the icon is selected
' * @param UnreadIconURL URL for the icon to be displayed until the BB user selects the icon
' * @param ReadiconURL URL for the icon to be displayed after te BB user selects the icon
' * @param PushID A unique ID to represent this channel on the BB device
' * @param PushTitle Text displayed along with the icons for the channel
' */
Sub BrowserChannelPush(Email As String,PushURL As String, UnreadIconURL As String, ReadIconURL As String, PushID As String, PushTitle As String)
Call DominoBEsJava.browserChannelPush(MDSHost$,MDSPort%,Email$,PushURL$,UnreadIconURL,ReadIconURL,PushID$,PushTitle$)
End Sub
End Class