Guided Tour of the Common Lisp Hypermedia Server
The server supports a full range of features.
It can serve images like:
Yosemite Valley.
It can serve audio like Sound Bite.
It can serve video like Video Bite.
You can compute and generate
HTML dynamically using computed
URLs and the HTML generation
tools, e.g., View Headers.
It can export whole
directories of text, html or multimedia at single directory level or
recursively. See CL-HTTP Distribution or
standards related to the World Wide Web. Directory exports can be eager
or lazy (the default) as needed for start-up time requirements and DNS
speed.
Standard abstractions can be adapted to compute pages
of interest, such as Basic Icons.
Common Lisp source code directories are also
conveniently exported:
- Configuration Examples
- Portable Server Sources
- Portable Client Sources
- Portable Proxy Sources
- Platform-specific Source
The object-oriented
architecture spans URLs, exceptional conditions, server instances, as well as
authentication objects. See basic class
structure.
Fill-out Forms and
search URLs provide a convenient way to accept user input to functions
that compute responses to
requests. For example, response functions defined in http:examples;exports.lisp
allow you to:
Dynamic computation of fill-out forms
allows the queries asked to vary according to the data driving an application
such as Computed Form.
Input types provide a high-level
abstraction for eliciting user input using the full power of the HTML 2.0
fill-out form facility. The Input Type System is a basic presentation system
that has is upward compatible with the Common Lisp Interface Manager in the
Lisp Machine version. See HTML:ACCEPT-INPUT.
A modular and extensible
logging facility allows Server Log Files to
be maintained in any of several formats, including common logfile
format. The variable http:*log-access-log-class*
controls the format used. It possible to have multiple logs on a single
port or different log formats on different ports. The log window example
illustrates an interesting extension of logging.
.
IP Subnet security is available globally
for the entire server and locally for specific URLS. See HTTP:EXPORT-URL.
Usernames and passwords are
available for user
authentication, using both the basic and digest authentication methods.
View Realms shows the defined realms,
users, groups, URL access groups, but you must know the Webmaster
password for the server and your browser must support Digest
Authentication. See http:examples;access-control.lisp.
Conditional GET is implement so that
caching proxy servers can merely check the headers of a document to see if it
has changed rather than reloading it when its expiration time arrives. User
control is available via the expiration arguments to HTTP:EXPORT-URL.
The server can export image maps and supports both
the NCSA and CERN file formats.
Direct image searches allow a
response function to invoke functionality based on the coordinates of a mouse
click. See: HTML:IMAGE
and try clicking on:

Netscape 1.1 extensions to HTML
2.0 implement Server
Push and Client Pull (see
discussion). See the
implmenetation in http:server;netscape-1-1.lisp. Server
push is illustrated for Netscape and Mozilla clients by Choose Color Schemes. The example also demostrates HTML 3.2+ tables, and multipart MIME
generation (see http:examples;exports.lisp).
Clients from HTML 3.2
(and Netscape
2.0) include client-side images and frames. CL-HTTP writes client-side
image maps from server-side image maps with html:with-client-image-map.
Direct control is available with html:with-client-image-map. Either way, the name client-side image maps
can be invoked with html:image. Lisp examples that generate client-side image maps and frames are available in http:examples;exports.lisp. For further
information, see the full set of HTML operators.
HTML that invokes Java Applets can be synthesized with html:with-java-applet, and http:export-url knows how to export both Java
source and byte code. The TwistDown Tree
Example illustrates how Lisp can generate dynamic invocations of predefined Java classes.
JavaScript scripts can be embedded in HTML streams for HTML 3.2+ clients using html:with-script (also with ns2.0:with-embedded-script for
Netscape 2.0+ Clients. CL-HTTP encapsulates scripts with html:define-script. Scripts can then be
called by passing events constructed with HTML:with-event-handlers. The marquee headers page illustrates the use of these facilities. See
http:examples;exports.lisp for example code.
A plug-in
facility (Latest Plug-ins) is
supported by the Netscape
2.0 Client. New export types and mime types are easily defined to allow
CL-HTTP to serve data from files or computed on the fly for client-side
plug-ins. One example is inline speech synthesis using the Talker plug-in
for the Macintosh. See the example in http:examples;exports.lisp
for example code.
VRML 1.0 Synthesis Tools
generate 3D scenes with the Virtual Reality
Modeling Language. VRML scenes can be viewed inline with a variety of
plug-ins available for major browsers. The Introduction to VRML Generation works
through lisp examples in http:examples;vrml;.
The W3P Presentation System provides a portable
and fast subset of functionality in The Common Lisp Interface Manager, 2.0. Now, all CL-HTTP
platforms can use presentation types for presenting and accepting data via
HTML fill-out forms, and thus, minimize code duplication while simplifying the
coding associated with Web interfaces. The Color Mixer in http:examples;exports.lisp
illustrates the use of presentation types.
Web-based server
configuration allows binary images containing the server to be configured
by non-programmers. To use this, you need to set security policy for
http:export-web-configuration-interface, which is called near the top of
http:examples;exports.lisp.
The W4
Constraint-Guided Web Walker provides a declarative architecture for control and action in a Web
robot. After loading the system (see http:w4;), you can run the
example. Sunil
Mishra has developed a HTML streamed
parser for use with the web walker. The current release of W4 is considered beta test, so
please report any bugs, successes, or issues to bug-w4@nospam.cl-http.org.
The
CL-HTTP Mail HyperArchive exports email
message archives for public or personal use just as easily as exporting any
file. For an example, see the hyperarchives for WWW-CL@csail.mit.edu. Not only does
the hyperarchive include conversation threading and cross references, but it
also supports color schemes to make the synthesized pages conform to the look
and feel of a site. The hyperarchive dynamically computes pages directly from
a message archive created by an SMTP mailer. Because there is no batch
processing like more primitive tools, Web pages are always current.
Naturally, implementation using CLOS multimethods makes the facility easily
extensible through method and class specialization. When you load the
hyperarchive facility from http:examples;mail-archive.lisp,
it adds the new export type :mail-archive to http:export-url. (This
is a good example of how to define complex export types and use direct file
access for database purposes.) Full-text search over messages is available by
loading LambdaVista.
Virtual Hosts are supported on
a single IP address. Separate URL's are exported for virtual host and
port. HTTP 1.1 conformant clients are required, e.g. Netscape 2.0.2 or
higher.
PUT & DELETE Methods
for HTTP 1.0 and 1.1 can now be used with clients other that the basic
HTTP client that comes with the server. For example, Mozilla and Netscape support the PUT
method. Setting Up Web
Directories explains how to get started. Together with Web
directories, generic file copying provided by http:copy-file greatly
enhances Common Lisp.
Distributed AI applications
are possible using HTTP to communicate between a CL-HTTP server and client.
The standard HTTP POST method is trivially used for communication
between remote Lisp processes. A simple example is available in http:examples;client.lisp.
Client-side cookies allow an application to
maintain user state across HTTP transactions or user sessions.
Netscape 4.0 provides a
sophisticated layering capability in the browser, which is accessible
via ns4.0:with-layer.
A client-side form illustrates simple
use of layers and JavaScript. See the source code in http:examples;exports.lisp.
Site
Indexing & Information Retrieval is provided by LambdaVista, a hybrid
classification and retrieval system. It provides full-text retrieval for
CL-HTTP sites, including email HyperArchives.
The HTML
4.0 generation facility provides the latest standardize markup capabilities from The Web Consortium, including Cascading Style Sheets for control of document look and
feel. HTML 4.0 generation, like all tools for generating earlier HTML version, is backward
compatible when using the transitional DTD.
A reference manual generation framework named LispDoc, illustrates use of HTML 4.0
and CCS 2 generation under program control.
An XHTML
1.0 generation facility enables applications to generate pure XML user interfaces.
John C.
Mallery -- jcma@nospam.csail.mit.edu
M.I.T. Computer Science & Artificial
Intelligence Laboratory