A WWW Collaboration System
Keiron Skillett, BEng Project 2000

 

Background

2.1 Objectives

The objectives of this project are to design a WWW collaboration system with the following features.

  • Personal and shared address books for groups that the user is a member of.
  • Personal and shared files spaces for all groups that the user is a member of.
  • Personal and shared calendars for all groups that the users is a member of.
  • A messaging board (for all members of a group).

2.2 Design Brief

More and more people are working away from the office. A collaboration (or meeting) system, which will allow people to work together when they are apart, is required. Many international companies have offices in several different time zones now, the theory behind a system like this one is that people all over the world can work together, passing information back and forth as if they were in the same room at the same time, where in reality a group could consist of people from multiple time zones across the world who are never in the office at the same time (and have possibly never met).

A collaboration system should have all the basic essentials of a personal organiser and an office. An address book, calendar, notice board and file storage space, both for the individual and team members, even if the individual is a member of several teams.

The Internet has rapidly becoming the fastest way to communicate, people can e-mail instead of making a telephone call or sending a fax. They may send a file attachment of documents instead of using the postal system, and the recipient can receive, edit and reply in minutes.

How do groups of people work together across the Internet?
In the current situation this is not easy. One scenario is that the author of a document e-mails it to all members of his/her team. They each edit it individually and send it back to the author; the result is multiple documents (all with minor changes) for the author to collate into a final document. Obviously this situation is far from ideal. A system like this would allow one document to be edited and stored in a central location, for editing by any member of the team. This means that only the most recent version is edited.
 

2.3 Research

2.3.1 The Internet

The Internet is the largest network of computers worldwide and connects thousands of users to information sources across the world daily, the main point of access being the World Wide Web. Before the “Internet Boom” in the past couple of years client/server data access was on a relatively small scale. Internal company databases with a mixture of various technologies were common, making it difficult for developers and allowing restricted access to the data sources.

The Internet has reduced all of these problems, by creating standard interfaces, platforms and protocols. Hypertext Markup Language (HTML) has become the standard interface for displaying data, when combined with the client platform of a Web browser (such as Microsoft Internet Explorer or Netscape Communicator) and data is transferred from a Web server using the standard Hypertext Transfer Protocol (HTTP) this produces a very easy to use interface, known as the World Wide Web.

The Web has opened the floodgates for millions of users to access data by an easy to use interface. With the Internet spanning almost every country worldwide data access no longer has geographical boundaries.
 

2.3.2 Client/Server

Client/server data access is the name given to the methods required to access data on a host computer (the server), from a client computer anywhere on a computer network. Access does not just mean viewing data, but having the ability to add, edit or delete data when necessary. In the context of this project the computer network will be the Internet and the client computer will be any computer capable of running a web browser and connected to the Internet.
 

2.3.3 Databases & The Internet

A database allows the storage of data in an orderly fashion that allows information to be retrieved from it. The easiest and now standard way of retrieving data is by using Structured Query Language (SQL), the scope of which is well beyond this report (see Database Systems). SQL allows databases to be queried, updated and edited relatively simply, however it can be used to design very sophisticated queries and updates.

The following sections discuss the three most common ways of accessing databases across the Internet.

2.3.3.1 Common Gateway Interface (CGI)

The Common Gateway Interface defines how scripts communicate with Web servers’. A CGI script will receive data and return it in a CGI compliant manner. CGI scripts are non-interactive, they are initiated and run to completion, retrieve their results and return the results to the user. This is currently the most widely used method for interfacing Web applications to data sources.

2.3.3.2 Active Server Pages (ASP) {Internet1}

Active Server pages are a server-side scripting technology for building web pages that are both dynamic and interactive. An active server page is a text file with the extension .asp, this file contains HTML, client- and server-side script. 

The implementation of ASP was created by Microsoft and is intended as an open technology server-side framework, allowing developers to create websites from the many Component Object Model(COM) data sources available to them, such as Microsoft Access.

ASP is designed to be easy to understand and program, yet support interaction between page user and server, allow access to databases and directory services via web pages, and allow the use of powerful COM components.  It is server-based and browser independent, leaving only the questions of which client-side script (JavaScript, VBScript or JScript) and stylesheet to use.

2.3.3.3 Java

Java is one of the newest and rapidly developing programming languages. The World Wide Web gives the ideal platform for Java to create interactive applications; these are no longer just scripts running on the Web server. They are fully interactive and allow for all the functionality of an application programmed in any of the other major programming language (e.g. Visual Basic or C++), but can be downloaded and are portable. Any application written in Java will run on all major platforms with a Java-based browser, different versions are no longer required for different machines.

These applications can be written and embedded into web pages (these applications are known as applets). These programs are then interactive; they can respond to user input, mouse movement, etc. this is an executable program, not just a script.

The virtual machine is what makes Java so portable, where other programming languages would compile source code into machine code (platform and architecture dependant), Java compiles into bytecodes. Bytecodes can be read by any Java Virtual Machine, but machine code is very much dependant on the computer, it’s operating system and architecture. The Java Virtual Machine runs as part of any Java enabled Web browser and converts bytecodes into a language that the machine can understand, knows as “write once, and run anywhere”. Java also has it’s own memory management techniques which make it useful when downloading code from a server and running on a client machine.

JDBC {Internet2}

JDBC (which is a trademark, not an acronym; although often thought of as “Java Database Connectivity”) is a set of Java classes and interfaces for executing SQL statements, which provide developers with a standard method for connecting to databases. With JDBC database commands can be sent to any relational database (One program will access databases from various different vendors).  Java’s ability to automatically download over a network makes it ideal for network database applications with no software other than a web browser (mostly coming as standard with the operating system) being required on the client-side.  Java’s property of write once, run anywhere allows many machines of different types (Macintosh, PC’s running Microsoft Windows or Unix) to connect to the same database across any network, either the Internet or an intranet.

In it’s simplest form JDBC does three things.

  • Connects to a database.
  • Sends an SQL Statement.
  • Processes the results.

Below is a brief code fragment which demonstrates this.

Connection con = DriverManager.getConnection ("jdbc:odbc:wombat", 
                                      "login", "password");
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT a, b, c FROM Table1");
while (rs.next()) 
{
      int      x = rs.getInt("a");
      String   s = rs.getString("b");
      float    f = rs.getFloat("c");
}

Using JDBC with the JDBC-ODBC Bridge, instead of using ODBC directly (which involves installing drivers on every machine) provides an automatically installable, portable and secure client-server database platform.

The JDBC API supports both two-tier and three-tier models for database access.


Figure 2.1 - A two-tier architecture using JDBC

A two-tier architecture allows an Application or Applet to access a database directly. This requires a specific driver for the database in question to be installed on the client machine and then the server can be access across a company intranet or the Internet.

Figure 2.2 - A three-tier architecture using JDBC.

A three-tier architecture (Figure 2.2) allows commands to be sent to a middle tier, which then makes the connection and SQL calls to the database. This approach is particularly appealing to programmers because it allows updates to be made to the server without it affecting the client applet (so long as the function calls remain the same).

Remote Method Invocation (RMI){Internet3}

Remote Method Invocation allows distributed applications that are Java-to-Java to be created. By using this method it is possible to create remote objects, these object methods can then be invoked from another Java virtual machine (whether it be on the same host or a different one). Java programs can make a call on a remote object by looking it up in the RMI Registry or by receiving it as an argument or return value.

It is possible for a client to call a remote object on the server, and that server also to be a client of other remote objects, making calls to them.

For RMI to work the interface of the remote object must be available on the server and the implementation of the object should have registered itself with the already running RMI Registry. The remote object should have installed the RMI security manager and be running. The client side applet can then access all methods of the remote object once a reference has been created.


Figure 2.3 - Client-Server Environment

Below are examples of the interface, implementation and client for a simple “Hello World” program using RMI.

Below are examples of the interface, implementation and client for a simple “Hello World” program using RMI.

Interface

package examples.hello;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Hello extends Remote
{

String sayHello() throws RemoteException;

}

Implementation

package examples.hello;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;
public class HelloImpl extends UnicastRemoteObject implements Hello

{

public HelloImpl() throws RemoteException

{

super();

}

public String sayHello()

{

return "Hello World!";

}

public static void main(String args[])

{

if (System.getSecurityManager() == null)

{

System.setSecurityManager(new RMISecurityManager());

}
try
{

HelloImpl obj = new HelloImpl();
// Bind this object instance to the name "HelloServer"
Naming.rebind("HelloServer", obj); System.out.println("HelloServer bound in registry");

} catch (Exception e)
{

System.out.println("HelloImpl err: " + e.getMessage());

e.printStackTrace();

}

}

}

Client

package examples.hello;
import java.applet.Applet;
import java.awt.Graphics;
import java.rmi.Naming;
import java.rmi.RemoteException;
public class HelloApplet extends Applet {

String message = "blank";
// "obj" is the identifier that we'll use to refer
// to the remote object that implements the "Hello"
// interface

Hello obj = null;

public void init() {

try {

obj = (Hello)Naming.lookup("//" + getCodeBase().getHost() + "/HelloServer");

message = obj.sayHello();

} catch (Exception e) {

System.out.println("HelloApplet exception: " + e.getMessage()); e.printStackTrace();

}

}

public void paint(Graphics g) {

g.drawString(message, 25, 50);

}

}

The remote object as well as being compiled with the Java Compiler (javac.exe) must be compiled with the RMI tool (rmic.exe). This produces a stub and a skeleton, which are required when using RMI.


Figure 2.4 - RMI Architecture1

As shown in figure 2.4, an application is initialised on the Server (Virtual Machine A), this is known as the remote object. The remote object registers itself with the RMI Registry (another Java application that stores references to remote objects).

When the client (on Virtual Machine B) tries to reference a method within the remote object, it accesses the RMI Registry (on the Server) through a TCP socket connection. When the registry confirms that the method is valid it will return the remote object to the client in the form of a stub.

The client now invokes a method that is contained within the remote object’s stub, this can involve passing of parameters and return values. Parameters are forwarded to the remote object through a skeleton object. When the remote object completes the method, any necessary return values are sent back through the skeleton and stub objects and received by the client.