Annotation of libwww/Library/src/WWWApp.html, revision 2.6

2.1       frystyk     1: <HTML>
                      2: <HEAD>
2.2       frystyk     3: <TITLE>Non-Mandatory Application Include File</TITLE>
2.6     ! frystyk     4: <!-- Changed by: Henrik Frystyk Nielsen,  8-Dec-1995 -->
2.1       frystyk     5: <NEXTID N="z11">
                      6: </HEAD>
                      7: <BODY>
                      8: 
2.2       frystyk     9: <H1>Non-Mandatory Application Include File</H1>
2.1       frystyk    10: 
                     11: <PRE>
                     12: /*
                     13: **     (c) COPYRIGHT MIT 1995.
                     14: **     Please first read the full copyright statement in the file COPYRIGH.
                     15: */
                     16: </PRE>
                     17: 
                     18: In addition top the basic W3C Reference Library include file called <A
                     19: HREF="WWWLib.html">WWWLib.h</A> you <EM>can</EM> also include this
                     20: file called WWWApp.h depending on the needs of your
                     21: application. However, it is not required and none of the files
                     22: included below are ever used in the core part of the Library
                     23: itself. Only if this file is included, the extra modules will get
                     24: included in the linked object code. It is also possible to include
                     25: only a subset of the files below if the functionality you are after is
                     26: covered by them.
                     27: 
                     28: <PRE>
                     29: #ifndef WWWAPP_H
                     30: #define WWWAPP_H
                     31: </PRE>
                     32: 
                     33: <PRE>
                     34: #ifdef __cplusplus
                     35: extern "C" { 
                     36: #endif
                     37: </PRE>
                     38: 
                     39: <H2>Initialization</H2>
                     40: 
                     41: The core parts of the Library is a framework for adding
2.3       frystyk    42: functionality. It has hooks for adding protocol modules, like for
2.1       frystyk    43: example HTTP, FTP, and also for adding streams that can convert from
                     44: one media type to some other type, or presenting the result to the
                     45: user. In the distribution file of the Library you will find a large
2.3       frystyk    46: set of protocol modules and streams already implemented. However, in
2.1       frystyk    47: order to use these you need to initialize them. This can be done by
                     48: using the files in the <A HREF="HTInit.html">HTInit</A> module. You
                     49: can modify this module as you like to fit your particular needs.
                     50: 
                     51: <PRE>
2.2       frystyk    52: #include "<A HREF="HTInit.html">HTInit.h</A>"
2.6     ! frystyk    53: #include "<A HREF="HTInit.html">HTBInit.h</A>"
2.2       frystyk    54: </PRE>
                     55: 
2.3       frystyk    56: <H3>Generating the First Anchor</H3>
2.2       frystyk    57: 
                     58: This module provides some "make life easier" functions in order to get
                     59: the application going. They help you generate the first anchor, also
                     60: called the <EM>home anchor</EM>. It also contains a nice set of
                     61: default WWW addresses.
                     62: 
                     63: <PRE>
                     64: #include "<A HREF="HTHome.html">HTHome.h</A>"
2.1       frystyk    65: </PRE>
                     66: 
2.3       frystyk    67: <H2>Before a Request</H2>
                     68: 
2.4       frystyk    69: When a request has been issued there are a number of things that an
2.3       frystyk    70: application might want to do with the request before it actually goes
                     71: on the wire, for example to talk to a remote HTTP server. Examples are
                     72: checking if the object already is kept in a cache managed by the
                     73: application, if the request should be redirected to a proxy or a
                     74: gateway, or there is some other kind of translation of the URL taking
                     75: place. The Library provides a variety of modules that handles many
                     76: common place translations such as <EM>redirection of URLs</EM> and
2.4       frystyk    77: <EM>caching</EM>.<P>
2.3       frystyk    78: 
                     79: These modules are not part of the <A HREF="WWWCore.html">Library
                     80: Core</A> as the registration process depends on the application. It
                     81: can for example use a database or some other means of registering
                     82: translation rules, proxy servers. etc. The Library implementations are
                     83: deliberately made as platform independent as possible and will cover
2.4       frystyk    84: most situations. You can find a function called
2.5       frystyk    85: <CODE>HTLoadStart</CODE> in the <A HREF="HTHome.html">HTHome module</A>
2.4       frystyk    86: that enables all the functionality for translating URLs.
2.3       frystyk    87: 
                     88: <H3>Rule File Management</H3>
                     89: 
                     90: Another way to initialize applications is to use a rule file, also
                     91: known as a configuration file. This is for example the case with the
                     92: W3C httpd and the W3C Line Mode Browser. This module provides basic
                     93: support for configuration file management and the application can use
                     94: this is desired. The module is not referred to by the Library. Reading
                     95: a rule file is implemented as a stream converter so that a rule file
                     96: can come from anywhere, even across the network!
                     97: 
                     98: <PRE>
                     99: #include "<A HREF="HTRules.html">HTRules.h</A>"
                    100: </PRE>
                    101: 
                    102: <H3>Proxies and Gateways</H3>
                    103: 
                    104: Applications do not have to provide native support for all protocols,
                    105: they can in many situations rely on the support of proxies and
                    106: gateways to help doing the job. Proxy servers are often used to carry
                    107: client requests through a firewall where they can provide services
                    108: like corporate caching and other network optimizations. Both Proxy
                    109: servers and gateways can serve as "protocol translators" which can
                    110: convert a request in the main Web protocol, HTTP, to an equivalent
                    111: request in another protocol, for example NNTP, FTP, or Gopher. In case
                    112: a proxy server or a gateway is available to the application, it can
                    113: therefore by use of HTTP forward all requests to for example a proxy
                    114: server which then handle the communications with the remote server,
                    115: for example using FTP about the document and return it to the
                    116: application (proxy client) using HTTP.
                    117: 
                    118: <PRE>
                    119: #include "<A HREF="HTProxy.html">HTProxy.h</A>"
                    120: </PRE>
                    121: 
                    122: <H3>Cache Manager</H3>
                    123: 
                    124: Caching is a required part of any efficient Internet access
                    125: applications as it saves bandwidth and improves access performance
                    126: significantly in almost all types of accesses.  The Library supports
                    127: two different types of cache: The memory cache and the file cache. The
                    128: two types differ in several ways which reflects their two main
                    129: purposes: The memory cache is for short term storage of graphic
                    130: objects whereas the file cache is for intermediate term storage of
                    131: data objects. Often it is desirable to have both a memory and a file
                    132: version of a cached document, so the two types do not exclude each
                    133: other.
                    134: 
                    135: <PRE>
                    136: #include "<A HREF="HTCache.html">HTCache.h</A>"
                    137: </PRE>
                    138: 
                    139: <H2>After a Request</H2>
                    140: 
                    141: When a request is terminated, the application often has to do some
                    142: action as a result of the request (and of the result of the
                    143: request). The Application part of the Library provides two following
                    144: modules to handle <EM>logging</EM> and <EM>history
                    145: management</EM>. You can register a <EM>POST request handler</EM> in
                    146: the <A HREF="HTNet.html">Net Manager</A> as described in the <A
2.4       frystyk   147: HREF="../User/Using/Overview.html">User's Guide</A>. <P>
                    148: 
                    149: You can find a function called <CODE>HTLoadTerminate</CODE> in the <A
2.5       frystyk   150: HREF="HTHome.html">HTHome module</A> that enables all the functionality
2.4       frystyk   151: for handling a request result.
2.3       frystyk   152: 
                    153: <H3>Logging</H3>
2.1       frystyk   154: 
                    155: Often it is required to log the requests issued to the Library. This
                    156: can either be the case if the application is a server or it can also
                    157: be useful in a client application. This module provides a simple
                    158: logging mechanism which can be enabled if needed.
                    159: 
                    160: <PRE>
2.2       frystyk   161: #include "<A HREF="HTLog.html">HTLog.h</A>"
2.1       frystyk   162: </PRE>
                    163: 
2.3       frystyk   164: <H3>History Management</H3>
2.1       frystyk   165: 
                    166: Another type of logging is keeping track of which documents a user has
                    167: visited when browsing along on the Web. The Library history manager
                    168: provides a basic set of functionality to keep track of a linear
                    169: history list.
                    170: 
                    171: <PRE>
2.2       frystyk   172: #include "<A HREF="HTHist.html">HTHist.h</A>"
2.1       frystyk   173: </PRE>
                    174: 
                    175: End of application specific modules
                    176: 
                    177: <PRE>
                    178: #ifdef __cplusplus
                    179: } /* end extern C definitions */
                    180: #endif
                    181: 
                    182: #endif
                    183: </PRE>
                    184: 
                    185: End of WWWAPP definition
                    186: 
                    187: </BODY>
                    188: </HTML>

Webmaster