Next: Discussion
Up: Results Achieved
Previous: Results Achieved
W-KLIC is composed by a collection of KLIC modules which provide
powerful high-level programming capabilities to access and manipulate
information on the Internet.
The modules in W-KLIC provide a programming layer which allow access to
the most important interfaces to fetch and exchange data over the Internet.
The current version of W-KLIC offers the ability to embed in KLIC
programs access to the most basic Internet protocols: HyperText Transfer
Protocol (HTTP), Common Gateway Interface (CGI), and Common Client
Interface (CCI).
W-KLIC contains different modules which provide access capabilities
to the basic protocols adopted for exchange of data over the Internet
as well as communication with existing browsers and other Internet
related tools.
- HTTP Interface:
W-KLIC offers a module http which allows basic access to communication
via HTTP. The module offers predicates to send requests using HTTP protocol
and obtain responses---in the format of strings of characters.
Auxiliary predicates have been developed which allow interconversion between
C strings and KLIC strings---a necessary feature for the implementation
of the HTTP module. Implementation of this feature has been necessary
since no equivalent capability is reported in the KLIC documentation.
- HTML Access:
The modules html and tohtml allow KLIC programs to perform
high-level management of HTML documents. These modules supply predicates
which allow conversion of string representing (part of) HTML documents
into KLIC terms and vice-versa. The term representation of HTML documents
allows easy generation of HTML documents within KLIC program, without
relying on unnatural string manipulation operations. Viceversa, the predicates
in this module allows to convert string-based representations of HTML
documents (e.g., obtained from the Internet using the http access) to
term representations. Term representations of HTML documents allows
incremental construction of HTML documents during program execution.
- CGI Access:
The module parse_hidden allows the parsing the string of
name-value pairs which are communicated to a Common Gateway
Interface (CGI) script. The predicates in this module allow to obtain
a list of pairs from a string produced by the HTTP server in reply
to a CGI connection.
The successive level of the CGI management is currently only partially
supported. Execution of communication via CGI requires two components:
(i) ability, within the server, to accept data incoming
from browsers which are activating a CGI communication;
(ii) ability to transfer data from the browser to the server.
A sufficiently general gateway script is presented in the
module cgi_copy, allowing transfer of data from browser to
an existing server.
The module server_copy contains a template to realize the
server side component of CGI communication. It shows how to receive
information from the gateway script, spawn a novel thread of computation
to serve the new communication and return an output to the gateway script.
It also shows how to allow using a predicate defined in the program
as script to serve a program in a dynamically generated document.
Embedding of these features in a separate collection of high-level
generic constructs is currently in progress.
- CCI Access
The module cci allows a KLIC application to communicate to any
Common Client Interface compliant application. The current version of the
CCI interface has been specifically designed to handle interactions with
running sessions of NCSA Mosaic.
The CCI interface allows the following activities:
- connection to a running session of Mosaic;
- tracking of the activities of such session---each URL visited
can be captured and transmitted to the connected computation;
- access to the data transferred to the Mosaic session;
- filtering of the data transmitted to Mosaic---e.g., capture all
the data belonging to a given MIME format and avoid their
direct visualization in Mosaic;
- forcing the Mosaic session to access and load URLs defined
by the connected computation (and not by the user of the
browser).
The recent brushup activity lead to the development of the following
additional features:
- the new module navigator has been developed, together with
the nplugin dynamic library. The goal of this component of
W-KLIC is to provide the ability to attach W-KLIC modules to HTML
documents. The modules are automatically downloaded and executed
on the client-side (i.e., they are spawned off the browser). The
W-KLIC modules developed for this purpose can use the navigator
module to obtain the capabilities to communicate with the browser. The
navigator module allows the KLIC module spawned from the browser
to perform the following activities:
- request the browser to load a specified URL and either render
the document on the browser window or transfer the content
to the module (either as an HTML term or as a string saved
in a file in the local Netscape cache);
- request the browser to post data to a given server;
- write explicitly a stream of data from the module to the browser.
These features are sufficiently powerful to provide a good degree
of interaction between browser and external module. The navigator
provides also the ability to retrieve the source code of the HTML document
which contains the spawned off module. This feature is important to allow
the generation of adaptive pages---i.e., pages which are self-adapting as
result of an arbitrary (KLIC) execution.
- the CGI capabilities have been refined to provide a new and simpler
way of dealing with CGI scripting. Two new predicates have been introduced:
- initcgi/0 which is used to initialize a KLIC module to be
used as CGI script;
- output/2 which is used to provide input/output operations
via a browser
The intuition is that a programmer can use these features to write
persistent
CGI scripts---i.e., CGI scripts which have a lifetime spanning different
interactions with the browser.
The brushup activity lead also to a revised version of the manual, including
- description of the additonal features (active pages and new CGI scripting
facilities)
- introduction of a tutorial section which presents a pool of examples and
code fragments for different features of W-KLIC
- introduction of a brief section dedicated to the internals of W-KLIC---explaining
some of the implementation techniques used in W-KLIC
Next: Discussion
Up: Results Achieved
Previous: Results Achieved
www-admin@icot.or.jp