Many people are already aware of the incredible flexibility and rapid application development that Lotus Domino provides, and Java is a major factor in this scenario. Therefore, its time to make people aware of the powerful combination that Domino and Java provide in tandem.
The History of Domino and Java Integration
Domino has been enabled with Java support since Release 4.5. Access to the Notes back- end classes and the ability to run Java agents were added in Release 4.6, and the capability of running Java servlets was added in Release 4.6.1. On the AS/400 platform, Release
4.6.2 is required to get the servlet support because Release 4.6.1 was never offered for the AS/400.
Release 5.0 (R5) of Domino expanded almost every aspect of its Java support: more classes, Common Object Request Broker Architecture (CORBA) support, and the ability of applets to access Domino objects. This ability to access Domino objects from applets is very powerful. There are four base applets that ship with R5: the editor applet, the outline applet, the view applet, and the action bar applet.
Notes back-end classes are used to manipulate the Lotus Notes/Domino environment, which includes Notes databases, documents, forms, views, and agents. The Domino object interface is not language-specific. Either the Java or LotusScript APIs can be used to access the underlying objects.
Reasons to Use Java
Java is not just a programming language: It is a platform that can be used to create and deliver information over any network. Java is designed to be portable and architecture- neutral for any system implementing the Java Virtual Machine (JVM).
Java is an object-oriented language that is similar to C++. Java enables the development of new client/server functions in Internet applications, while enforcing a discipline that makes software management possible across almost any hardware platform.
As already stated, the biggest benefit of using Java is that it is platform- independent, just as Domino is. Java is a multithreaded language that allows you to take advantage of n-way processors (multiprocessors). Because Java is an object-oriented language, it provides rapid development and code reuse. This is very important in todays
environment of fast product deployment. Java also does its own garbage collection, which is a huge plus for your developers.
Rather than use the JVM that ships with Domino, as most platforms do, the AS/400 uses its own integrated JVM. This provides better performance, as the JVM is integrated into the operating system. The AS/400s integrated JVM has additional benefits: It has advanced garbage collection algorithms and provides the capability to compile Java programs into executables through the Java transformer. The Java transformer, included with the AS/400s JVM, is responsible for optimizing platform-independent Java class files to take the greatest advantage of the AS/400s processing architecture. You can create Java programs by using the Create Java Program (CRTJVAPGM) command.
Applications
A Java application, sometimes referred to as a standalone Java application, is a program written in Java that executes locally on a server or workstation. Java applications can be used to develop small utilities, front-end applications, and multi-tier clients and to complete data processing tools.
Applications run within a JVM, allowing them access to the services of the underlying system, which is typically subject to the authority of the user running the application. This means that Java classes loaded as part of an application can access the local file system, create and accept network connections with other systems, and perform other tasks that are permitted only to trusted code.
Java classes can also be created as agents in a Notes database and are executed like any other Domino agent. Java agents have full agent scheduling and triggering ability from both the client and the server. They can be run in either the foreground or the background, and they can be replicated. Java agents also have full agent security, such as signing and restricted/unrestricted execution. Because of their reliance on the Notes APIs, execution of the Domino object classes requires that Domino or Notes be installed on the machine upon which the Java agent is running.
Agents are quite different from applications. They can be thought of as batch processes that run within the context of a Domino server. Agents are used for a variety of reasons, such as retrieving documents, deleting old documents, and accessing DB2 UDB to update documents. R5 introduced the ability of the Domino Designer to edit and compile Java agents within the integrated development environment (IDE) itself, but interactive debugging is not yet supported.
Java applets are small programs that are downloaded to and executed on a Web browser or network computer. Since Domino Release 4.5, the Notes client has been able to run Java applets. With Release 4.6, you could insert a Java applet directly on a form so that the applet was included in each document created from the form, or you could insert an applet in a rich text field or document to include it only in that document. When a form or document containing a Java applet is displayed using a Web browser, the applet is under the control of the Web browser.
Until R5, applets could not easily communicate with the Domino server or contain integration capabilities. A new set of applets is now shipping with R5 to make development of Domino Web-enabled applications much easier: the outline applet, the editor applet, the view applet, and the action bar applet. These applets are customizable and programmable using the Domino Designer and are compliant with the Java Development Kit (JDK) Version 1.0.2. (They can be used in 3.x and 4.x browsers.)
Agents
Applets
Outline Applet
The outline applet lets you organize the structure of your application. The outline has two parts: the outline design, which lists the application design elements and links between elements, and the outline control (the outline embedded on a page), which allows users to navigate through the application.
Editor Applet
The editor applet allows users to define how a rich text field displays for editing in a browser. This applet supports bold, italics, underlining, single-level indent, ordered and unordered lists, color selection, limited size and font selection, and URL-link hot spots.
View Applet
The view applet is a view that has been embedded on a page or form. Once the view is embedded on the page or form, a user can sort views by column, scroll up and down by using the view scroll bars, and resize headers by dragging the edges of the column headers to change the column widths dynamically. The view applet also allows users to expand any number of twisties, which allow users to drill down and see information in multiple categories at once. Another new feature allows you to select multiple documents in the view and perform actions on those documents from the view.
Action Bar Applet
In R5, actions can also have subactions that you can access by clicking on the action buttons on the action bar. A drop-down menu containing subactions will then appear. Without the action bar applet, this drop-down capability would be nearly impossible for Web users to use.
Java servlets are platform-independent, server-side software components written in Java. Servlets run on a Java-enabled Web server. They dynamically extend the capabilities of the server because they provide services over the Web, using the request-response paradigm.
From a high-level perspective, the servlet process flows in the following way:
1. The client sends a request to the server.
2. The server sends the request for information to the servlet.
3. The servlet builds a response and passes it to the server. The response is dynamically built, and the contents of the response usually depend on the clients request.
4. The server sends the response back to the client.
Because they run inside servers, servlets do not need a GUI; in this sense, servlets are faceless objects.
Servlets are persistent and can be reused to handle many requests in their lifetime. Unlike agents, which run within an existing session in a Notes context, servlets must initialize with Notes and obtain a session for their own use; this means that servlets are also responsible for their own authentication and access control.
Typically, servlets are used to examine the URL that triggered the retrieval of the current page, to do some application-specific processingsuch as a relational database lookupand to insert enterprise data into the page that goes back to the client.
For the AS/400, you need Domino Release 4.6.2 or later and OS/400 V4R3 or later to implement servlets.
Additional Java Support in Release 5.0.4
With the availability of Domino Release 5.0.4, you will have the capability of using either Dominos HTTP stack or the WebSphere HTTP stack. This integration creates the ability to
Servlets
design a new breed of Domino applications. Domino provides the unique aspects of collaboration, and WebSphere provides transactional capabilities.
Currently, there are three different server editions in the WebSphere product family: Standard Edition, Advanced Edition, and Enterprise Edition. The Standard Edition will come installed with Domino Release 5.0.4 and provides base support for servlets and JavaServer Pages (JSPs). Advanced Edition builds on Standard Edition and adds support for Enterprise JavaBeans (EJBs). This environment allows you to write applications that take advantage of complex server featuressuch as two-phase commit transactions, which is particularly important when performing transactions against back-end data stores. Finally, Enterprise Edition adds CORBA support to the EJB functionality of Advanced Edition. CORBA support allows remote access, thereby enabling distributed computing with EJBs.
The Coffee Is Brewed
As you can see, there are many different ways to use Java in the Domino environment. There are many tools and articles that will help you on your journey with the Java capabilities of Domino. One such tool is the Lotus Domino Toolkit for Java/CORBA, a comprehensive source of samples, documentation, and software that help you create Java applets, applications, servlets, and agents for local and remote (CORBA) access to Domino data (www.lotus.com/developer). Good luck in the enrichment of your Domino applications with all of the Java capabilities that are currently available.
LATEST COMMENTS
MC Press Online