For using an agent developed in java but needed to be used in the LotusScript to enable benefit in Lotus Notes I've found some useful (may be not complete) factors to configure various settings in the and coding as discussed below:
For using the java class in LotusScript LS2J is the way to use it. For this purpose developer is needed to add a string in the start of the lostus script code of the module.
i.e.
1. Add line : - Uselsx "*javacon"
2. Create a java based script library under the 'Script Library' in the template and click on the button 'Edit Project' and browse the location containing the needed class files and then add files to current script library.
3. Add line Use "your java based script library" in the lotusscript code like (1).
4. Also create a jar file with all the classes to be used and the corresponding other jar files used in those classes and add to the directory "......\Lotus\Notes\jvm\lib\ext", where notes is the directory containing the Lotus Notes Executable. The jar files in 'ext' folder will cause all the needed classes to be loaded when lotus notes started.
Above steps are used to configure the environment to use the java based agent, now to use the java based module in lotus script, first a session to java is needed to be established then objects of type JavaClass and Java Object are needed to be created and all these objects can be for java based agent. the following are the code step examples that can be used to facilitate the call to the java agent:
Dim myJSession As JavaSession
Dim myClass As JavaClass
Dim myObject As JavaObject
Set myJSession = New JavaSession
Set myClass = myJSession.getClass("your class name")
Set myObject = myClass.CreateObject("(Ljava/lang/String;I)V", stringArgument,IntegerArgument)
'Ljava/lang/String' and 'I' are the signature of the data type of the argurment of the called constructor of the class.
returnVal = myObject.fnName(arg1, arg2, arg3)
where returnVal is the result obtained from the java agent that can be used as required.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment