COMMON
CLIENT
INTERFACE
(CCI)
)
( ( (
) ) )
------
oooooo
||
||
Common Client Interface (CCI) to Mosaic version 2.5 or higher can be
accomplished
in the CH language environment.
You can
download
the CH language environment.
The Common Client Interface (CCI) allows external applications
to communicate with Web browsers.
If you are not familiar with
this new experimental feature of CCI, please read
NCSA's
documentation on
Common Client Interface,
which contains both
tutorial and detailed specifications of CCI.
This slide show example will demonstrate Common Client Interface.
To perform this demo, you have to start a
Mosaic of version 2.5 or higher first.
After you start to run Mosaic in your local machine,
use the CCI option under
the File menu in the upper left corner of
Mosaic to instruct Mosaic to listen for CCI communication
on a specified port number. A
port number may be any number 1024 through 65535.
Change the port number in the entry field below to agree with
what Mosaic Web browser on your machine is listening for, if necessary.
First, start
Mosaic(V2.5 or higher) in your local machine.
Then,
set the
port number that CCI is listening for.
Next,
click the above Submit Port Number.
Finally,
click the spinning globe at the upper right corner of the Mosaic.
Three slides will be presented in your Mosaic web browser.
This slide show is accomplished by
a CH CGI script
slides.cgi run in a restricted shell.
A more elegent implementation of slide show which
integrates CCI/CGI dynamic CH applets is
presented in
World-Wide Distributed Computing.
CCI CH API
The CCI CH API is based on the
CCI C API developed at NCSA.
CCI in CH is still an experimental feature.
The main concern is whether allow CH applets for Common Client Interface directly
wihout even invoking programs located in a client.
At this point, CH applets sent from a Web server down to
a client cannot contain CCI code.
Once the implication of security by CCI is completely understood,
all functions specified by NCSA's CCI C API will be supported in CH.
The following constants are returned by most CCI functions
(almost the same as CCI C API).
#define CCI_OK 0
#define CCI_FAIL 1
#define CCI_OUTOFMEMORY 2
#define CCI_REQUEST_FAIL 3
#define CCI_NETWORK_ERROR 4
Like many others, these constants
are defined in www.h.
The following functions are supported in CH:
CCIPort CCIConnect(char *serverAddress, int port, void *reserved1,
void *reserved2)
This fuction is used to make an initial connection with a running
session of Web Browser. serverAddress is the hostname or IP
address on which Web Browser is running. port is the port number
on which Web Browser is listening for CCI connections. reserved1
and reserved2 are reserved for a callback function in the future.
CCIConnect returns a structure of type CCIPort, which is
used to refer to the CCI connection to Web Browser. Although Web Browser such as
NCSA Mosaic
is a Web client, in the case of a CCI connection, Mosaic is
referred to as a server.
int CCIIsConnected(CCIPort serverPort)
This function returns 1 if serverPort refers to a live network
connection, otherwise it returns 0.
int CCIGet(CCIPort serverPort, char *uri, int output, int absRelative,
char * additionalHeader)
This function instructs Web Browser to fetch a URL (URI) as if the user had
done so. serverPort refers to an active CCI connection.
uri is the URL to open. output instructs Web Browser what to
do with the output that is retrieved, and must be one of:
- CCI_DEFAULT, same as OUTPUT_CURRENT
- CCI_OUTPUT_NONE, do not display the output
- CCI_OUTPUT_CURRENT, display the output in the current window
- CCI_OUTPUT_NEW, display the output in a new window
absRelative instructs Web Browser to treat uri as either an
absolute or relative hyperlink, and must be one of:
- CCI_DEFAULT, same as CCI_ABSOLUTE
- CCI_ABSOLUTE
- CCI_RELATIVE
additionalHeader is a string that contains additional HTTP
header information to be passed to an HTTP server, normally set to
NULL.
CCIGet returns CCI_OK if successful.
int CCIDisconnect(CCIPort serverPort)
This function terminates the active CCI connection referred to by
serverPort.
(More to come)
The CH language Ennvironment
Integration Engineering Laboratory
Created by Harry H. Cheng, 12/29/1995
Last modification by Harry H. Cheng, 2/20/1996