Applicable in Service-class directives.
The index-common function generates a formatted list of files in the requested directory. The list is sorted alphabetically. Files beginning with a period (.) are not displayed. Each item appears as an HTML link. This function displays more information than index-simple, including the size, date last modified, and an icon for each file. The listing might also include a header or readme file.
The Init-class function cindex-init in magnus.conf specifies the format for the index list, including where to look for the images.
If obj.conf contains a call to index-common in the Service stage, magnus.conf must initialize indexing by invoking cindex-init during the Init stage.
Indexing occurs when the requested resource is a directory that does not contain an index file or a home page, or no index file or home page has been specified by the functions find-index or home-page.
The icons displayed are .gif files dependent on the content-type of the file, as listed in the following table
Table 5–103 content-type icons
Content-type |
Icon |
---|---|
"text/*" |
text.gif |
"image/*" |
image.gif |
"audio/*" |
sound.gif |
"video/*" |
movie.gif |
"application/octet-stream" |
binary.gif |
directory |
menu.gif |
all others |
unknown.gif |
The following table describes the parameters specific to the index-common function.
Table 5–104 index-common parameters
Parameter |
Description |
---|---|
(Optional) Path relative to the directory being indexed and name of an HTML or plain file text that is included at the beginning of the directory listing to introduce the contents of the directory. The file is first tried with .html added to the end. If that name is found, the file is incorporated near the top of the directory list as HTML. If the file name is not found, it is tried without the .html and incorporated as preformatted plain text bracketed by <PRE> and </PRE> tags. |
|
(Optional) Path relative to the directory being indexed and name of an HTML or plain text file to append to the directory listing. This file might give more information about the contents of the directory, or indicate copyrights, authors, or other information. The file is first tried with .html added to the end. If that name is found, the file is incorporated at the bottom of the directory list as HTML. If the file name is not found, it is tried without the .html and incorporated as preformatted plain text bracketed by <PRE> and </PRE> tags. |
|
method |
(Optional) Common to all Service-class functions. |
query |
(Optional) Common to all Service-class functions. |
UseOutputStreamSize |
(Optional) Common to all Service-class functions. |
flushTimer |
(Optional) Common to all Service-class functions. |
ChunkedRequestBufferSize |
(Optional) Common to all Service-class functions. |
ChunkedRequestTimeout |
(Optional) Common to all Service-class functions. |
bucket |
(Optional) Common to all obj.conf functions. |
Service fn=index-common method=(GET|HEAD) header=hdr readme=rdme.txt |