Professional Documents
Culture Documents
Server
Objects
Client
Server API
HTTP
C lient-side
LotusS cript objects
Java Agents
Agents Events D IIO P ORB IIO P C lient O R B
Java LS C O R BA COM
Visual
Adapter A dapter Adapter Adapter
Basic
D om ino Back-End
C lasses H ost
Application
Java Servlets
Java servlet support: Domino Servlet Manager
Servlet URL path: /servlet
Class path: domino/servlet
Servlet file extensions:
Session state tracking: Enabled
Idle session time-out: 30 minutes
Maximum active sessions: 1024
Session persistence: Disabled
How to implement in Domino
• JSDK 2.0 documentation at java.sun.com
• Commercial Java development packages
• VisualAge for Java from IBM
• Put JSDK.jar into CLASSPATH
– (packaged with R5)
– javac
Writing a Servlet - 1
• Extend javax.servlet.http.HttpServlet
– Subclass of GenericServlet
• Choose the desired method
– doGet( ), doPost( ), init( ) & destroy( )
• Place class files into servlet directory
– <Notes data dir>\domino\servlet
• Invoke by URL
– /servlet/<name>
Writing a Servlet - 2
• <data dir>\servlets.properties
• Standard Java properties file format
• Directives:
– servlets.startup=<name1> <name2>
– servlet.<name>.initArgs=<name>=<value>
– servlet.<alias>.code=<class>
– servlet.<name>.extension=<ext>
Running the Servlet
• Servlet Manager ClassLoader loads servlet
– Uses domino\servlet path
• System ClassLoader loads other classes
– From file system
– Locates using CLASSPATH
• init( ) method executes
• service( ) method executes for each request
• Servlet classes REUSED
Java User Classes
• Notes.ini variable
• Couples system classloader to a classpath
• Path separators
– Semicolon for Win32/OS2
– Colon for UNIX
• Example:
– JavaUserClasses=c:\myjars\utils.jar;
c:\more\foo.jar
Languages
• CORBA applets & applications
– Java
– JDBC and Domino Driver
• Web agents
– Java
– LotusScript
– Formula language
• Servlets
– Java
Examples of code used
in an Agent
Import lotus domino.*
public class simpleagent extends AgentBase
{
public void NotesMain( )
{
try {
Session s = getSession( );
AgentContext ac = s.getAgentContext( );
// your code goes here
Document doc = ac.getDocumentContext( );
String qs=doc.getItemValueString("Query_String"); }
catch( NotesException e)
{ e.printStackTrace( ); }
}
}
Harmony for Lotus Domino
• OEM Java API to access information from Lotus
Domino.
– Comprehensive library of Java technology-based
components
– Developers can access and store information such as
appointments, todos, mail messages and contacts
through the Harmony for Lotus Domino Java
technology API.
JAVA and Soap in Domino
• Use XML to encode the data
• Format the remote calls using SOAP
• Use HTTP as the tranport
• Use JAVA as the language to tie it
together
Domino 6 – What’s New