Client-side CGI (CSCGI) differs from CGI in that it does not involve a remote system, a web server, an Internet connection, or local Internet software such as TCP or PPP. In CSCGI, HTML form data and results can be passed directly between the web browser and an external CGI program on the local system:
In CGI, the flow of data goes from the calling HTML page, to the web browser, to the Internet software and hookup, to the remote web server, and then to the remote CGI program. In CSCGI, the flow of data goes from the calling HTML page, to the web browser, to a Netscape plugin, and then directly to the CGI programs on the local system.
Some of the important features of this architecture are:
To enable CSCGI, a feature of Netscape 3-4 called LiveConnect is used, which essentially allows the creation of a Java interface for a C plugin. Unfortunately, this means that CSCGI applications currently run only under Netscape 3-4 (version 4 strongly recommended). At present, a Netscape plugin and associated CSCGI programs are written for the Windows95 operating system, although Macintosh support is expected soon.
It was our goal to build a turnkey system which would search the text-file PDS database included on the CDs and return images and file information based on search crieteria entered from an HTML page. It was envisioned that this system would work much like a search program on the web such as AltaVista, with the addition of a built-in image and file information viewing capability.
This system was built using the CSCGI technology described above. The search and display engines are stand-alone C programs which do not require an Internet connection, a remote computer, nor a web server. The overall system consists of a small number of HTML pages, Java applets, and C programs, rather than a large monolithic application. The main components of the system are an HTML search form, one or more search result pages created by the search engine, and a Java-based PDS image and file viewer:
The web pages consist of:
Below is an example of one of the search result pages created by the search engine. These pages are written "on the fly" by the stand-alone search program called by the search form. They contain a summary of the search query, and an ordered list of those PDS records which best match the search criteria. Search results are saved to disk (e.g. "sresults1.htm") so that the most recent search can be revisited by simply loading an HTML page. Thumbnail images of each PDS image are also decompressed from the CD-ROM and displayed "on the fly" by a set of Java applets embedded in the page. One or more such pages can be returned:
Selecting one of the thumbnail images or links in a search result page launches a PDS image viewer and file information page (those images which are in the database, but are not on the currently mounted CD-ROM, do not create links or thumbnails). Again, the PDS image is decompressed from CD-ROM and displayed by a Java applet, at one of several magnifications. Another CSCGI program reads the text database, and creates an HTML page containing a listing of the record which corresponds to the displayed image:
Here is a graphical summary of how this system fits together:
This PDS example was meant only as a test case for CSCGI, although it may become an independent product or a prototype for a more generic on-line image database search and display system. Other examples of using a component CSCGI system might also include adding file reading and writing capabilities to normal Java applets, or maintaining and interacting with a large, live, database using "continuous connect" CSCGI mode.