A great use for LS2J 19 Dec, 2004
For some time I’ve tinkered with the Lotusscript Java wrapper code (known as “LS2J”) in Notes 6.x, but have, until now, been somewhat non-plussed by it. The idea is a cool one, but genuinely useful code a little harder to discern, and the actual low-level implementation is somewhat iffy in places (just search the developerWorks Lotus forums for “LS2J” to see what I mean!).
Having said all that, the perfect use for LS2J has been brought to my attention by none other than Julian in his excellent LS2J examples database (go get it now!)
A while back I posted some stuff about the forthcoming version of OpenWiki on the OpenNTF site. Sadly real work took over, and I just didn’t get a chance to do any coding. Well, this weekend that changed. I’ve broken the back of it: I’ve completely re-written the wiki parser so that it uses regular expressions, and LS2J; Julian’s code made this possible. I now have a base custom Lotusscript class which utilises the power of the Apache Jakarta ORO regexp libraries to format and present wiki mark-up. So far so good, and I hope to unveil the new OpenWiki early in the New Year. Leveraging great code like this rocks…
In particular, I'm curious about performance. One thing I've noticed about Java in Notes 6.x (in general) is that the first time I run any Java agent after I've started the client, the agent takes about 3-5 seconds to "ramp up". After that, all the Java things that I do seem to run right away. While it's a big improvement from R5 (where everything seemed to have a delay), it's still a little annoying.
Anyway, I'm glad you liked the code and found a good use for it. If nothing else, the nice thing about LS2J is that you can use all your Java toys and still access the Domino objects in LotusScript, avoiding all the recycle mess you'd normally need to deal with in Java.
- Julian
Julian Robichaux#
Interesting, because Designer compiles when you save, or at least that's always been my impression (maybe the status bar lies! ;-) )
The lag is akin to a web page taking its time due to new JSPs compiling the first time anyone hits that page. Odd.Ben Poole#
I'm working with LS2J and I'm having a hard time! I've got a number of java classes and a number of LS agents. I need to make use of the Java classes, however I found out it's not possible to pass a "NotesDocument" or a "NotesSession" as a parameter to a Java class. For example, I have a java class whose contructor is:
public class Test(lotus.domino.Session)
I found out we cannot do something like:
Dim session As New notessession
Set jSession = New JavaSession
Set pbClass = jSession.GetClass("Test")
Set pb = pbClass.CreateObject("(Llotus/domino/Session)V", session)
Is there a way to map this objects?
Thanks a lot!Aurelio Calegari#
Any hints?Brendan#
LS2J sucks…Brian#