Integrating Lotus Notes applications with web services

Share

I have spent some time recently trying to integrate Lotus Notes with an existing Java web services consumer. The web service consumer (ProjectRepository) was build on Apache Axis technology and provided the project names my application needed. So I created an Java agent that uses that existing code:

import java.util.Iterator;
import java.util.List;
 
import lotus.domino.AgentBase;
import lotus.domino.Session;
import wsdl.ProjectRepository;
 
public class JavaAgent extends AgentBase implements java.io.Serializable {
    public void NotesMain() {
	try {
	    Session session = getSession();
	    ProjectRepository pr = new ProjectRepository();
	    String myProjects = getDelimitedProjects(pr.getProjectNames());
	    session.setEnvironmentVar("projects", myProjects);
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }
 
    private String getDelimitedProjects(List projects) {
	return delimitProjects(projects, ";");
    }
 
    private static String delimitProjects(List projects, String delimiter) {
	if (projects.isEmpty()) {
            return "";
        } else {
            Iterator iter = projects.iterator();
            StringBuilder buffer = new StringBuilder();
            buffer.append(iter.next());
            while (iter.hasNext()) {
                buffer.append(delimiter).append(iter.next());
            }
            return buffer.toString();
        }
    }
}

Then I imported the necessary jar files(axis.jar, xercesImpl.jar, etc.) for the web service, and tried to execute my agent code. The code failed and I got multiple ClassNotFoundException errors. I found some ways to solve these issues.

One of them will be to use the available notes.ini parameter/key called JavaUserClassesExt. This key removes the limitations that the JavaUserClasses have (must fit on a single line and is limited to the 255 characters). The disadvantage is that isn’t sharable across clients.

JavaUserClassesExt=AXIS1,AXIS2,AXIS3,AXIS4,AXIS5,AXIS6,AXIS7,AXIS8,XERC
AXIS1=C:\Program Files\Axis\lib\axis.jar
AXIS2=C:\Program Files\Axis\lib\axis-ant.jar
AXIS3=C:\Program Files\Axis\lib\commons-discovery-0.2.jar
AXIS4=C:\Program Files\Axis\lib\commons-logging-1.0.4.jar
AXIS5=C:\Program Files\Axis\lib\jaxrpc.jar
AXIS6=C:\Program Files\Axis\lib\log4j-1.2.8.jar
AXIS7=C:\Program Files\Axis\lib\saaj.jar
AXIS8=C:\Program Files\Axis\lib\wsdl4j-1.5.1.jar
XERC=C:\Program Files\Xerces\xercesImpl.jar

Another way is to put the external JAR files in the jvm/lib/ext folder under your binary Notes directory.This provides the same universal availability of the classes as the JavaUserClassesExt setting but without having to manually edit the notes.ini file.

Both these solutions have one drawback, you have to make the changes on every machine.

Restart Domino Designer after you made these changes.

The agent obtains the project names and stores these names in a environment variable called “projects”. This variable is used then in a Combo box or a List box formula for populating with values:

proj:= @Explode(@Environment("projects"); ";");
@For(x := 1; x <= @Elements(proj);
x := x+1;
projectsList:= projectsList:@Trim(proj[x]));
projectsList

References:
Lotus Notes.ini Entry: JavaUserClassesExt
IBM JavaUserClasses related article

Finally, there’s another very important peculiarity of what does Cialis that brings it so high above its alternatives. It is the only med that is available in two versions – one intended for use on as-needed basis and one intended for daily use. As you might know, Viagra and Levitra only come in the latter of these two forms and should be consumed shortly before expected sexual activity to ensure best effect. Daily Cialis, in its turn, contains low doses of Tadalafil, which allows to build its concentration up in your system gradually over time and maintain it on acceptable levels, which, consequently, makes it possible for you to enjoy sex at any moment without having to time it.

By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close