Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Classes and Notes

Status
Not open for further replies.

DRWishum

Programmer
Jun 18, 2001
11
US
I am trying to access a java class that I wrote outside of Note, but notes can not find thee definition of the class. Can this be done? If so, How?

I also tried to put the source file into the Note Designer, but it did not recognize some of the Sun classes. It seemed to be using an old version of the
SDK. Does anyone know hoe to fix this problem?
 
There are some points you will need to clarify first with Notes and Java:
- Domino R5 uses Java 1.1.8 API... more recent versions of Java do not generally work (this may have changed recently, but I usually work with Domino >= R5.0.7).
- If you have created an Agent as an external Class file, it must extend the lotus.notes.AgentBase class and instead of a "main()" method to invoke the application, it must have a "NotesMain()" method. There are some subtle points about how this works (or not) and you may need to experiment a little: look at the examples in the Java Classes Help in Designer for ideas.

As for accessing or importing Java Classes, Notes is capable of doing this if you carefully follow the instructions. (To access some useful information from Notes Help, open Domino Designer, press F1 for help, open the search pane (index the help file if it has not already been indexed), then key in "Creating Java programs for agents" and you can examine more details from there).

When you import Class files that you have created, you must import all files referenced by your classes also. That includes inheritance and usage relationships (except for those you use from existing packages, such as lotus.* or java.* as these are already embedded). The easiest way to do this is to put your class structure in a drive or directory, then choose this location as your "Base Directory" when you select "Import Files" (in the Designer). You must then specify every class file to be imported by its full package name (eg com.company.classes.MyClass will appear in the import list as com\company\classes\MyClass.class). If you need all the classes that you have created simply choose the Add/Replace button and all classes in all subdirectories will be added for you. Save your agent before testing it.

Finally, it often helps to have the Java Debug Console open when you do test runs so you can work out which method of which class is not working (open this from: File | Tools | Show Java Debug Console).

Hopefully this makes some sense!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top