Agenda Domino JAVA development environments Today Domino and

  • Slides: 45
Download presentation
Agenda Domino JAVA development environments – Today – Domino and JAVA - embedded Applets

Agenda Domino JAVA development environments – Today – Domino and JAVA - embedded Applets – Domino and Javascript – Domino toolkit for JAVA/Corba – Harmony for Domino - EJB from Sun – JAVA and SOAP web services on Domino JAVA in Domino 6 – Tomorrow – – – Domino and JAVA in Release 6 Domino and J 2 EE Domino and Websphere integration Examples – – – Help Desk Application Web Services using SOAP SPAM filters Sites to find more information

Lotus Notes and Domino – A Level Set • Notes is the Client code

Lotus Notes and Domino – A Level Set • Notes is the Client code – a groupware product that supports email, calendaring, document management, workflow and web access • Domino is the backend server that runs services such as HTTP, POP, SMTP, LDAP, Database, Routing, JAVA Servlets, Replication, etc.

Domino Development – Brief Overview • The key programming functions in Domino are: –

Domino Development – Brief Overview • The key programming functions in Domino are: – Formula, Lotus. Script, Java, and Java. Script code – You attach code to various objects depending on need. • You use attach formulas to fields and sections on forms and views. • You attach Java. Script code to the on. Focus event of a field which would then execute whenever a user places focus on the field. • Macros can be developed to perform common functions on all objects • There is an IDE programming interface to development environments that support COM and OLE. • There is a programming interface for Java applications and applets. – Java applications and applets can operate locally by accessing installed Domino software or remotely by connecting to a Domino server using CORBA with IIOP protocols.

Domino Object Model (DOM) • What is it? – Hierarchical organization of the Domino

Domino Object Model (DOM) • What is it? – Hierarchical organization of the Domino objects. • It consists of back-end and front-end classes. – 25 back-end classes (two new classes in R 5). – 7 front-end classes • Formerly referred to as: – Notes object model, Notes object interface or NOI – Lotus. Script classes (the back-end classes were called the Database level classes, while the front-end classes were called the UI level classes)

Where to Use JAVA in Domino • Embedded Applets & Servlets • CORBA Applets/Applications

Where to Use JAVA in Domino • Embedded Applets & Servlets • CORBA Applets/Applications • Web Agents & Web development – use Java applets (like e. Suite Dev. Pack) and Java Servlets. • Connecting to Relational Databases – use JDBC in Java Applications and Java agents. • Integrating with Legacy Systems – use Java Applications and Java agents. • Reduce development time by purchasing ready to use Java classes written specifically for Domino developers

Java Objects in Notes R 5 Server Objects Client CORBA Server API IIOP CORBA

Java Objects in Notes R 5 Server Objects Client CORBA Server API IIOP CORBA

Domino and JAVA - embedded Applets • Domino ships with 4 pre-built JAVA applets

Domino and JAVA - embedded Applets • Domino ships with 4 pre-built JAVA applets – Outline applet • The outline applet lets Web users work with outlines embedded in a page or form. – View applet • The view applet lets Web users use many of the Domino view features, including column resizing, multiple document selection, and section collapse/expand without page regeneration. – Action bar applet • The action bar applet lets users scroll and easily view and select sub-actions. – Editor applet • The editor applet lets Web users change the font, color, size, and style for text in rich text fields.

View Applet

View Applet

Outline & View Combined

Outline & View Combined

Editor Applet

Editor Applet

“Rolling Your Own” Applet

“Rolling Your Own” Applet

Extending Classes CREATING AN APPLET INVOLVES EXTENDING THE APPLET CLASS: • Import the class

Extending Classes CREATING AN APPLET INVOLVES EXTENDING THE APPLET CLASS: • Import the class files: import java. applet. Applet – Importing the applet class file gives you a starting point to build from, a bit like a template. • Extend: public class Catalogue extends Applet – Your code extends the java. applet. Applet class files. • Void: public void init() – In order to add your own code to the methods available in a applet class file, you need to override the existing methods.

Object Actions CREATING OBJECTS INVOLVES THREE ACTIONS: • Declaration: type name – "Button next.

Object Actions CREATING OBJECTS INVOLVES THREE ACTIONS: • Declaration: type name – "Button next. Product" is a variable declaration that declares that the name next. Product will be used to refer to a object of the button type (class name). • Instantiation: new – the new operator (like Lotus. Script) is used in Java to create a new object, in this case a new button. • Initialization: constructor call – "Button(“Next Product”)" calls the button class constructor which will initialize the next. Product object.

Referencing Variables • All objects of the same type have the same variables: –

Referencing Variables • All objects of the same type have the same variables: – These are created when the object is instantiated and initialized. – This is similar to Lotus. Script, that is all Notes. Document objects have the same properties and methods. (The values stored in the properties vary). • To reference a variable: – object. Name. method. Name

Handling Events • Applets inherit a group of event handling methods from the AWT

Handling Events • Applets inherit a group of event handling methods from the AWT class: java. awt. Event. • Establishing event handling methods involves three steps: 1. Implement the appropriate Listener interfaces: public class X extends Applet implements Action. Listener 2. Register each object with the event Listener: object. Name. add. Action. Listener(this); 3. Implement the methods of the appropriate Listener interface: public void action. Performed(Action. Event event)

Basic Syntax • Unlike Java. Script, which is untyped, all data variables in Java

Basic Syntax • Unlike Java. Script, which is untyped, all data variables in Java have a type – The type determines what values the variable can contain and the operations that can be performed on it. • Variable scope is similar to Lotus. Script: – Variables defined in the “(declarations)” event are available to all events in the same module. This is like a member variable in Java. – Variables declared in the “initialize” event are only available for the duration of that event. This is like a local variable in Java.

Steps to Create an Applet • Create the Source File – This can be

Steps to Create an Applet • Create the Source File – This can be done in any text editor. – Must save the file with an *. java extension. • Compile the Source File – This converts the text file into Byte. Code which can be read by the JVM. – Use the JDK (Java Developers Kit) or a Java IDE, such as IBM’s Visual Age • Embed the Applet into an HTML page or a Domino Document, Form or Page.

Displaying Images in Applet • Import the AWT Image and Graphics class files. •

Displaying Images in Applet • Import the AWT Image and Graphics class files. • Loading the Image: – Use imagename = get. Image(get. Document. Base(), ”image. gif”); • Drawing the Image using: – – Use g. draw. Image(imagename, 0, 0, this); where g represents the Java graphics object. 0, 0 are the x, y co-ordinates for the image. this indicates that this object should be notified as more of the image becomes available.

Lotus. domino. * • All Java programs use the Domino Java Classes to write

Lotus. domino. * • All Java programs use the Domino Java Classes to write code that instantiates Domino Objects. • lotus. domino. * is a Java package that gives Java programmer’s access to the Domino Object Model. • The package does not include the Front-end classes as a Java program cannot be attached to front-end objects, such as form events (unlike Lotus. Script). • This same package is used in Java Applets, Applications and Agents.

Domino Java Classes METHODS: • Java methods are identical to Lotus. Script methods except

Domino Java Classes METHODS: • Java methods are identical to Lotus. Script methods except that they start with lowercase. PROPERTIES: • In Java, properties are also methods, so the Lotus. Script properties needed to be converted into equivalent methods: – Boolean properties have two equivalent methods - one to set/change it, which starts with the word “set”, and one to read it, which starts with the word “is”. – Other properties convert to “get” methods in Java.

Class Examples • lotus. domino. Session – get. Database • lotus. domino. Database –

Class Examples • lotus. domino. Session – get. Database • lotus. domino. Database – get. View • lotus. domino. View – get. First. Document() – get. Next. Document(Object document)

Adding an Applet into your App • Embed the applet into a Domino form,

Adding an Applet into your App • Embed the applet into a Domino form, page or document. • Check the “Applet uses the Notes CORBA classes” property. • Check the “Applet uses CORBA SSL security” property if required. • Execution in a Browser invokes CORBA, in a Notes Client the applet simply access the local Domino APIs.

Lotus Domino Toolkit for Java/CORBA • Tools, samples, and documentation to create Java programs

Lotus Domino Toolkit for Java/CORBA • Tools, samples, and documentation to create Java programs using Domino data and services. • Domino Collaboration Objects for Java (DCO) – Java beans (classes) that add Domino messaging and calendaring services to programs. – You provide any needed user interface; the DCO beans provide easy Domino access to: • User login and authentication • Sending an email • Working with calendar entries • The DCO beans help Web developers tap into Domino services by consolidating the necessary Domino back-end Java classes into a few Java components. • Developers not familiar with Domino can rapidly integrate Domino services into Java applications such as servlets and Java. Server Pages (JSPs). • http: //www. lotus. com/developers/devbase. nsf/homedata/homejava

Domino JAVA Servlets • A Domino Java servlet is a program run by the

Domino JAVA Servlets • A Domino Java servlet is a program run by the Domino Web server in response to a browser request. • Domino supports both Java servlets and Java applets for Web applications. • The most important difference between these types of Java programs is how they are run. • Servlets are "server-side" programs – a servlet's Java class is loaded and run entirely within the Domino server and the result from the servlet, usually a page of HTML, is returned to the browser • Applets are "client-side" programs – An applet's Java class is downloaded to the browser and is run by the browser • Applets require Java support in the browser, but servlets do not. • Servlets for Domino must conform to the Java Servlet API Specification, an open standard published by Sun Microsystems, Inc.

Java Servlets – Backend Architecture

Java Servlets – Backend Architecture

How is the Servlet Invoked? • Triggered by HTTP request – /servlet/<servlet name> •

How is the Servlet Invoked? • Triggered by HTTP request – /servlet/<servlet name> • Mapped to a specific file extension • Built-in Java Servlet Engine for JSDK 2. 0 • IBM Web. Sphere 2. 0 compatible

Domino Servlet Configuration Screen

Domino Servlet Configuration Screen

How to implement in Domino • • JSDK 2. 0 documentation at java. sun.

How to implement in Domino • • JSDK 2. 0 documentation at java. sun. com Commercial Java development packages Visual. Age for Java from IBM Put JSDK. jar into CLASSPATH – (packaged with R 5) – javac

Writing a Servlet - 1 • Extend javax. servlet. http. Http. Servlet – Subclass

Writing a Servlet - 1 • Extend javax. servlet. http. Http. Servlet – Subclass of Generic. Servlet • Choose the desired method – do. Get( ), do. Post( ), init( ) & destroy( ) • Place class files into servlet directory – <Notes data dir>dominoservlet • Invoke by URL – /servlet/<name>

Writing a Servlet - 2 • <data dir>servlets. properties • Standard Java properties file

Writing a Servlet - 2 • <data dir>servlets. properties • Standard Java properties file format • Directives: – servlets. startup=<name 1> <name 2> – servlet. <name>. init. Args=<name>=<value> – servlet. <alias>. code=<class> – servlet. <name>. extension=<ext>

Running the Servlet • Servlet Manager Class. Loader loads servlet – Uses dominoservlet path

Running the Servlet • Servlet Manager Class. Loader loads servlet – Uses dominoservlet path • System Class. Loader 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

Java User Classes • Notes. ini variable • Couples system classloader to a classpath • Path separators – Semicolon for Win 32/OS 2 – Colon for UNIX • Example: – Java. User. Classes=c: myjarsutils. jar; c: morefoo. jar

Languages • CORBA applets & applications – Java – JDBC and Domino Driver •

Languages • CORBA applets & applications – Java – JDBC and Domino Driver • Web agents – Java – Lotus. Script – Formula language • Servlets – Java

Examples of code used in an Agent Import lotus domino. * public class simpleagent

Examples of code used in an Agent Import lotus domino. * public class simpleagent extends Agent. Base { public void Notes. Main( ) { try { Session s = get. Session( ); Agent. Context ac = s. get. Agent. Context( ); // your code goes here Document doc = ac. get. Document. Context( ); String qs=doc. get. Item. Value. String("Query_String"); } catch( Notes. Exception e) { e. print. Stack. Trace( ); } } }

Harmony for Lotus Domino • OEM Java API to access information from Lotus Domino.

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

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 • Creating JSPs from the JSP tag libraries –

Domino 6 – What’s New • Creating JSPs from the JSP tag libraries – large set of tags for Java Server Pages (JSP) • Enhancements to the Java APIs to make it easier to get into and out of Domino. • IDE enhancements for importing JAVA applets and servlets

Domino 6 – More integration with Websphere • IBM has announced that Lotus Domino

Domino 6 – More integration with Websphere • IBM has announced that Lotus Domino 6 customers will be able to download a free version of Web. Sphere Application Server (WAS) from the IBM Lotus Passport Advantage site. – Delivers Java 2 Platform, Enterprise Edition (J 2 EE) Advances IBM's Web services strategy by delivering J 2 EE capabilities to Lotus Domino customers and business partners embracing a J 2 EE architecture. – The free WAS download can only be installed on the same machine as Domino 6, and it can only access Domino objects. In addition, developers won't be able to use Web. Sphere connection pooling or EJBs

Is Domino Worth It? • Lotus has sold about 85 million seats, it has

Is Domino Worth It? • Lotus has sold about 85 million seats, it has about 50 thousand customers, and it contributes about 20 percent of the total revenue of IBM Software Group (comprised of Lotus, Web. Sphere, DB 2 and Tivoli brands).

After Domino 6 - ? ? • Lotus President Al Zollar says the plan

After Domino 6 - ? ? • Lotus President Al Zollar says the plan is to modularize products and exploit J 2 EE and Web services. • The product roadmap to Lotus Next. Gen Contextual Collaboration has four levels, from most to least "application richness, " evolving over time: – – Lotus Domino JAVA APIs Next. Gen collaborative infrastructure Next. Gen collaborative components RAD for J 2 EE based on Eclipse

Sites for more information • • http: //www. lotus. com http: //javaadvisor. com/Articles. nsf/aid/DEVEG

Sites for more information • • http: //www. lotus. com http: //javaadvisor. com/Articles. nsf/aid/DEVEG 02 http: //javaadvisor. com/Articles. nsf/aid/SMITT 728 http: //www 10. lotus. com/ldd/sandbox. nsf/e 26 da 15 be 91 bde 91852566 f 0006941 d 9/04 ba 48 2 a 57 b 4131 d 8525673100760 f 75? Open. Document http: //industry. java. sun. com/solutions/products/by_product/0, 2348, all-560413, 00. html http: //www. notestips. com/80256 B 3 A 007 F 2692/0/92 D 392 DC 6 B 2972898025 6 BA 5007 FBAA 3? Open. Document http: //industry. java. sun. com/solutions/products/by_product/0, 2348, all-116299, 00. html http: //www. lotus. com/products/rnext. nsf/873769 A 79 D 9 C 5 B 2285256 A 0800 720 B 96/D 14669 BE 33 B 75 CB 585256 C 4700659 FDC? Open. Document

Want to hear more? • Patricia Egen – Patricia Egen Consulting, LLC – www.

Want to hear more? • Patricia Egen – Patricia Egen Consulting, LLC – www. egenconsulting. com – 423 -875 -2652 – Pregen@egenconsulting. com