# Presentation: 122124

## Collaborative Research Environment Application Programming Interface

- Deborah A. Payne
- 5/5/98
- Environmental Molecular Sciences Laboratory
- Computing & Information Sciences
- Pacific Northwest National Laboratory

## Overview

- Background
- Approach
- Java conversion rules
- Hello World Example

##       Projects

**Collaboration Management (ANL, PNNL): **Real-Time Session Management from both a session based metaphor and a space based metaphor.
**Electronic Notebooks (LBNL, ORNL, PNNL): ** We’re developing an Electronic Notebook system to provide a shareable, multimedia version of the traditional paper scientific notebook.
**Collaboratory Interoperability Framework (ANL, LBNL, PNNL, SNL): **Technologies to allow scientific instruments, notebooks, and real-time collaboration tools to work together.

_**Structural Biology LDRD**_** **
- Researchers collaborating electronically to perform NMR experiments.

_**DOE2000**_

_**EMSL Operations**_** **
- Use of the Collaboratory tool suite as a portion of the EMSL Research Facility.

## EMSL Collaborative Research Environment CORE2000

- real-time
- electronic
- Java
- multi-platform (Unix, PC, Mac)
- extends NCSA’s Habanero
- extensible

*(NOTE: I am covering the API for the *
*CORE2000 version C2K2.0 due for *
*release on 6/5/98.  This does not match *
*the current version available on our *
*download site. If you are ready to add*
*your own application via this API come *
*see me for a pre-release version.)*

## CORE2000 Provides:

-  communication
-  security
-  floor control
-  record and playback
-  session information
**Suite of Tools**
-  audio/video conferencing (vic, vat, CUSeeMe)
-  whiteboard
-  shared screen viewers (TeleViewer)
-  Chat
-  Voting Tool
**Extensible**
-  remote operation of an instrument
-  data analysis tool

**CORE2000 Provides:**

## Two Types of Tools

- 3rd Party
- startup
- shutdown
- Java Hablet
- converted from Java Applet or Application
- integral part of system

## Example of a Collaborative Application

- Kelly

- Jeff

## EMSL Collaborative Environment

**Client 3**

**CORE2000**
**Client 2**

**CORE2000**
**Client 1**

**EMSL Collaborative Environment**

**Client 1**
**Hablet A**

**Client 3**
**Hablet A**

**Client 2**
**Hablet A**

**CORE2000**
**Server**

**Hablet A Arbitrator**

**Hablet B Arbitrator**

**Client 1**
**Hablet B**

**Client 3**
**Hablet B**

**Client 2**
**Hablet B**

## Conversion Rules:

- Imports:
- import ncsa.habanero.*;
- import ncsa.habanero.streams.*;
- import java.io.IOException;
- Applet vs. Application
- applets extend Hablet
- applications implement ncsa.habanero.Wrapped,  and java.io.Externalizable

## Conversion Rules:

- Transfer the State
- At Tool Startup for Clients already in a session
- Clients Joining Late
- Hablet methods:
- protected void writeHablet (MarshallOutputStream out) throws IOException
- protected void readHablet (MarshallInputStream in) throws IOException
- Wrapped, Externalizable methods:
- public void writeExternal (java.io.ObjectOutput out) throws IOException
- public void readExternal (java.io.ObjectInput in) throws IOException
- Setup
- startInFrame(MirrorFrame m) is the method called from the CORE2000 environment at startup.  Override this method and include any startup code.
- If hablet call init() and start()
- Set default windows parameters

## Conversion Rules:

- Event Handling
- for java.awt.Event handling:
- static public void addSharedEventType(Class eventType, Mirrorable m)
- static public void addSharedEventType(Class eventType, int id, Mirrorable m) where id is a java.awt.Event ID
- example: addSharedEventType(Class.forName(“java.awt.event.MouseEvent”),MOUSE_DOWN,this);
- Put this call in your startInFrame method
- for User Defined Events:
- Habanero.sendEvent(myEvent) where myEvent is a user defined event class that extends ncsa.habanero.ComponentAction
- receiving class must have a processEvent(AWTEvent evt) method to catch the event

## Conversion Rules:

- Install Hablet into CORE2000 Environment
- GIF 32 x 32 pixels in rsc/env/co_images of CORE2000 installation
- create directory under *apps* with the same name as the package name for the hablet
- place all hablet files in this directory
- create a new file in habanero.rsc/toolsDir that tells CORE200 the name, picture, classname, version, and options help URL of the new tool
- Arbitrators
- Central Arbitrator - passes everything it receives (default arbitrator)
- Limit Arbitrator - provides locking

**tool.name=Hello**
**tool.picture=hello.gif**
**tool.classname=helloworld.Hello**
**tool.version=1.0**
**tool.help=http:/www.emsl.pnl.gov:2080/docs/collab**

## Hello.java Standalone Application

## CORE2000 Hello.java Hablet

## See Java Hello.java standalone code

**and Hello.java hablet.**

## EMSL Collaboratory Details

**EMSL Collaboratory Details**

**Deborah A. Payne**
**Shelly Harris**
**Shawn Merriman**

**James D. Myers**
**Elena Mendoza**
**Ken Yates**

**Kelly A. Keating**
**Ray A. Bair**
**Brett Didier**
**Tom Valdez**

**http://www.emsl.pnl.gov:2080/docs/collab**

**Web Address**

## Acknowledgments

- U.S. Department of Energy
- Mathematical, Information and Computational Sciences Division of the Office of Energy Research
- Office of Biological & Environmental Research of the Office of Energy Research
- Pacific Northwest National Laboratory (PNNL) Laboratory Directed Research and Development (LDRD)

- Pacific Northwest National Laboratory is a multiprogram national laboratory operated by Battelle Memorial Institute for the U.S. Department of Energy under Contract DE-AC06-76RLO 1830.