ComPactHTTPd can interpret url-paths of the form:
Path?Arg1=Val1&...&ArgN=ValN
where
Arg1=Val1&...&ArgN=ValN
is called the query (the arguments) of Path. All identifiers
are matched case insensitively. The server does only recognize HTTP-GET-Requests. The Path and actual arguments can be build from:
Table 15-1. HTTP Get requests recognized by ComPactHTTPd
| Path | Mandatory Arguments | Optional Arguments | Semantics |
|---|---|---|---|
| FN.gif | ContextArgs SpecialArgs | Return the GIF-resource with filename FN.gif | |
| FN.jpg, FN.jpeg | ContextArgs SpecialArgs | Return the named JPEG-resource | |
| FN.html, FN.htm | ContextArgs SpecialArgs | Return the named (static) HTML resource, and process any SpecialArgs in the context identified by ContextArgs. | |
| {empty} | ContextArgs SpecialArgs | Return the page defined by httpd-home-page (index.htm by default) after dynamic expansion | |
| Reload | ContextArgs SpecialArgs | Return the last generated HTML page. This usually makes only sense in single session/single context applications of ExHTML. Process any SpecialArgs in the context identified by ContextArgs. | |
| ReInit | ContextArgs SpecialArgs Page | Re-Initialize the sessions specified by the ContextArgs or the default session. The resources compactrc, compact-env-rc, HTTPdActions, PkgBase.DefaultData are re-loaded and interpreted. As far as it is possible, the value changes are incorporated into the running server process. If Page is not specified, the last generate page is returned. Process any SpecialArgs in the context identified by ContextArgs. | |
| Terminate | ContextArgs SpecialArgs Page | Terminate the session idetified by ContextArgs. If Page is specified, return its dynamically expanded contents, else return the httpd-terminate-page. Process any SpecialArgs in the context identified by ContextArgs. | |
| Edit | ContextArgs SpecialArgs Page F Wd Wait | Call the editor defined by httpd-editor to edit the file(s) specified by the F variables. If Wd is specified, use this as the editors working directory. If no F is present, use the values from the context environment list selectedFiles. If Page is specified, expand and return it, else return the MIME-NoData response. Before, process any SpecialArgs in the context identified by ContextArgs. If Wait is defined and true, then the reply to the request is postponed until the called editor has exited. | |
| Show | ContextArgs SpecialArgs Page F Wd | Dynamically load and expand the page Page or httpd-source-page, if the former is not specified. Initialize the source output reader for this request with the contents of the file(s) specified by F, or, if not defined, by the values from the context environment list selectedFiles. Before, process any SpecialArgs in the context identified by ContextArgs. | |
| Load | Page | ContextArgs SpecialArgs VarArgs | Dynamically load the page specified by Page and pass it to the browser. If any variables are passed as VarArgs, defined them in the context identified by ContextArgs. Before, process any SpecialArgs in the context identified by ContextArgs. |
| Execute | Action | ContextArgs SpecialArgs Page | Execute the action from HTTPdActions specified by Action in the context defined by ContextArgs. Then process any SpecialArgs in the context identified by ContextArgs. |
| NewSession | USER HOME Page | ContextArgs NewContext ContextType | First, create a new session and default context for the given user with the given home-directory. If NewContext is missing, the current home directory is used. If ContextType is missing, a new directory session is created. Load and expand the given page and pass it back to the browser. |
| LoadDirContext | Page NewContext | ContextArgs SpecialArgs | Create a new directory context for the path specified by NewContext and add it to the current session. Execute any SpecialArgs in the new context. Finally return the dynamically expanded page specified by Page to the browser. |
| LoadPkgContext | Page | Prefix Package | ContextArgs SpecialArgs Cache | Load an existing or create a new package context for the path specified by NewContext and add it to the current session. Execute any SpecialArgs in the new context. Finally return the dynamically expanded page specified by Page to the browser. If NewContext is inconvenient to use, it may be replaced by the variables Prefix and Package. If Cache has the value rescan, the complete package structure is rescanned. If Cache has the value update, the package version cache is flushed. |
| LoadPrjContext | Page | Prefix Project | ContextArgs SpecialArgs Cache | Load an existing or create a new package context for the path specified by NewContext and add it to the current session. Execute any SpecialArgs in the new context. Finally return the dynamically expanded page specified by Page to the browser. If NewContext is inconvenient to use, it may be replaced by the variables Prefix and Project. If Cache has the value rescan, the complete project is rescanned. If Cache has the value update, the project cache is updated, i.e. all unsure cached version information is recomputed. |
| LoadPoolContext | Page | Prefix Pool | ContextArgs SpecialArgs TPC | Load an existing or create a new pool context for the path specified by NewContext and add it to the current session. Execute any SpecialArgs in the new context. Finally return the dynamically expanded page specified by Page to the browser. If NewContext is inconvenient to use, it may be replaced by the variables Prefix and Pool. If TPC is specified, the pool context is (re)initialized for this TPC. If Cache has the value update or rescan, the pool cache is rescanned. |
| Back | ContextArgs | Walk backwards in the server session history list and return the appropriate page. This is only useful for special GUI design that are not based on frames. | |
| Forward | ContextArgs | Walk forwards in the server session history list and return the appropriate page. This is only useful for special GUI design that are not based on frames. |
ContextArgs are the arguments that are used by the server to identify the context from which the request originated, i.e. its session and context. As these variables are defined in every session and context environment, a typical use of them in a request looks like this:
&Session=${Session}&Context=${Context}
There are several variable values that have a special meaning when used with some of the dynamic HTTP requests. These SpecialArgs are the following:
Table 15-2. Special arguments for GET requests of ComPactHTTPd
| Name | Values | Semantics | Remarks |
|---|---|---|---|
| ListItem | ListItemValue | Defines an item to be added to or deleted from a list. | Used together with ListAdd or ListDel. |
| ListAdd | ListName | Append an item to a list in the context environment. | Used together with ListItem. |
| ListDel | ListName | Delete an item from a list in the context environment. | Used together with ListItem. |
| ListClear | ListName | Clears a list (sets it to NIL) in the context environment. | |
| LoadEnvFile | CompactEnvRC | Loads a session envrionment (usually the file ~/compact/compact-env-rc or ~/.compact-env-rc) from CompactEnvRC into the current session. | The set of variables in a session environment file is usually determined by the value of the variable env-file-settings. |
| SaveEnvFile | CompactEnvRC | Saves the environment of the current session in CompactEnvRC. | The set of variables in a session environment file is usually determined by the value of the variable env-file-settings. |
| ReInitSession | anything | Re-initializes the current session, i.e. reads and evaluates the ComPact resources compactrc compact-env-rc HTTPdActions PkgBase.DefaultData |