Help on calling a Java app

I’m looking for some advice/help on calling a java program from the notes client.Note that I have NO java skillz so I don’t know if what I’m asking for is possible.

One of our externally supplied apps takes a file in a proprietary format and converts it to an XML format.

It is called as a DOS in the following way.

“c:\convert input_file output_file”.

Inside the batch file, two environment variables are set “CLASSDIR” and “CLASSPATH” and then the command:

“java org.app.readfile %1 %2”

CLASSDIR points to a file: converter.jar.

So far I’ve worked out that “converter.jar” is some kind of library and that java org.app.readfile %1 %2 is the function that takes two parameters.

So, my question is, it possible to run this from the notes client without involving DOS?

Can I load the library and call the function directly from Notes?

I’ve tried to get the library into Notes but I’m not sure where to go from there. Any help greatly appreciated.

Subject: Research LS2J…

  • This is “LotusScript 2 Java”, and it allows you to essentially put the .jar file into Domino and call it directly from LotusScript. It’s a non-trivial process, however, mainly due to numerous pitfalls. For instance, LS2J crashes (NSD on the client) if Java tries to pass a null back to it.

  • But since you’re simply giving it a path and getting a path back, you may be okay.

  • I’m not sure if the custom environment will even be necessary, as long as “converter.jar” is the only library you need to employ.

  • Alternatively, if you do go the command line route, I would look at using a system API call to run the process and avoid using Shell. My experience with Shell is it’s fine if everything works perfectly, but if even one little thing goes wrong, it’s about useless.

Hope this helps…

Subject: Re System API

Thanks for the system api suggestion. I was hoping I could wrap a java program around the library call and fire it off from a user action.

I don’t think there are any return values. If the function fails, no file is created and it’s easy enough the check to see if the file is there or not.

I’ll keep searching.