agenda domino java development environments – today –domino and java - embedded applets...

45
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 J2EE Domino and Websphere integration Examples Help Desk Application Web Services using SOAP SPAM filters Sites to find more information

Post on 22-Dec-2015

287 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

AgendaDomino 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 J2EE– Domino and Websphere integration

Examples– Help Desk Application– Web Services using SOAP– SPAM filters

Sites to find more information

Page 2: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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.

Page 3: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Domino Development – Brief Overview

• The key programming functions in Domino are:– Formula, LotusScript, Java, and JavaScript code – You attach code to various objects depending on need.

• You use attach formulas to fields and sections on forms and views. • You attach JavaScript code to the onFocus 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.

Page 4: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 R5).– 7 front-end classes

• Formerly referred to as:– Notes object model, Notes object interface or NOI

– LotusScript classes (the back-end classes were called the Database level classes, while the front-end classes were called the UI level classes)

Page 5: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

– use Java applets (like eSuite DevPack) 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

Page 6: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Java Objects in Notes R5

IIOPIIOP CORBACORBA

Server APIServer API

ServerServerObjectsObjects

CORBACORBA

Client Client

Page 7: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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.

Page 8: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony
Page 9: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony
Page 10: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony
Page 11: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

View Applet

Page 12: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Outline & View Combined

Page 13: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Editor Applet

Page 14: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

“Rolling Your Own” Applet

Page 15: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Extending ClassesCREATING 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.

Page 16: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Object ActionsCREATING OBJECTS INVOLVES THREE ACTIONS:

• Declaration: type name– "Button nextProduct" is a variable declaration that

declares that the name nextProduct will be used to refer to a object of the button type (class name).

• Instantiation: new– the new operator (like LotusScript) 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 nextProduct object.

Page 17: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 LotusScript, that is all NotesDocument objects have the same properties and methods. (The values stored in the properties vary).

• To reference a variable:– objectName.methodName

Page 18: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 ActionListener

2. Register each object with the event Listener:objectName.addActionListener(this);

3. Implement the methods of the appropriate Listener interface:

public void actionPerformed(ActionEvent event)

Page 19: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Basic Syntax• Unlike JavaScript, 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 LotusScript:– 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.

Page 20: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 ByteCode 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.

Page 21: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

– Use imagename = getImage(getDocumentBase(),”image.gif”);

• Drawing the Image using:– Use g.drawImage(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.

Page 22: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 LotusScript).

• This same package is used in Java Applets, Applications and Agents.

Page 23: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Domino Java ClassesMETHODS:• Java methods are identical to LotusScript methods

except that they start with lowercase.PROPERTIES:• In Java, properties are also methods, so the

LotusScript 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.

Page 24: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Class Examples

• lotus.domino.Session– getDatabase

• lotus.domino.Database– getView

• lotus.domino.View– getFirstDocument()– getNextDocument(Object document)

Page 25: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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.

Page 26: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 JavaServer Pages (JSPs).

• http://www.lotus.com/developers/devbase.nsf/homedata/homejava

Page 27: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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.

Page 28: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Java Servlets – Backend Architecture

LotusScriptAgentsEvents

JavaAgents Client ORB

Applet

Client-side objects

Domino Server

Browser Client

IIOP

LSAdapter

JavaAdapter

Domino Back-EndClasses

CORBAAdapter

COMAdapter

Host Application

VisualBasic

DIIOP ORB

Web Server HTTP

HT

TP

Foreign Client

JavaServlets

Page 29: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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 WebSphere 2.0 compatible

Page 30: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Domino Servlet Configuration Screen

Java ServletsJava servlet support: Domino Servlet ManagerServlet URL path: /servletClass path: domino/servletServlet file extensions:Session state tracking: EnabledIdle session time-out: 30 minutesMaximum active sessions: 1024 Session persistence: Disabled

Page 31: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

Page 32: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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>

Page 33: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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>

Page 34: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

Page 35: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

Page 36: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Languages• CORBA applets & applications

– Java– JDBC and Domino Driver

• Web agents– Java– LotusScript– Formula language

• Servlets– Java

Page 37: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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( ); }}}

Page 38: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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.

Page 39: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

Page 40: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

Page 41: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Domino 6 – More integration with Websphere

• IBM has announced that Lotus Domino 6 customers will be able to download a free version of WebSphere Application Server (WAS) from the IBM Lotus Passport Advantage site. – Delivers Java 2 Platform, Enterprise Edition (J2EE) Advances

IBM's Web services strategy by delivering J2EE capabilities to Lotus Domino customers and business partners embracing a J2EE 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 WebSphere connection pooling or EJBs

Page 42: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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, WebSphere, DB2 and Tivoli brands).

Page 43: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

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

modularize products and exploit J2EE and Web services.

• The product roadmap to Lotus NextGen Contextual Collaboration has four levels, from most to least "application richness," evolving over time: – Lotus Domino JAVA APIs– NextGen collaborative infrastructure – NextGen collaborative components – RAD for J2EE based on Eclipse

Page 44: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Sites for more information• http://www.lotus.com• http://javaadvisor.com/Articles.nsf/aid/DEVEG02• http://javaadvisor.com/Articles.nsf/aid/SMITT728• http://www-10.lotus.com/ldd/sandbox.nsf/

e26da15be91bde91852566f0006941d9/04ba482a57b4131d8525673100760f75?OpenDocument

• http://industry.java.sun.com/solutions/products/by_product/0,2348,all-5604-13,00.html

• http://www.notestips.com/80256B3A007F2692/0/92D392DC6B29728980256BA5007FBAA3?OpenDocument

• http://industry.java.sun.com/solutions/products/by_product/0,2348,all-1162-99,00.html

• http://www.lotus.com/products/rnext.nsf/873769A79D9C5B2285256A0800720B96/D14669BE33B75CB585256C4700659FDC?OpenDocument

Page 45: Agenda Domino JAVA development environments – Today –Domino and JAVA - embedded Applets –Domino and Javascript –Domino toolkit for JAVA/Corba –Harmony

Want to hear more?

• Patricia Egen– Patricia Egen Consulting, LLC– www.egenconsulting.com– 423-875-2652– [email protected]